From 71ed00cd68db8529d7e7245f060b8924cf76c9c0 Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 11 Dec 2012 21:55:47 +0000 Subject: [PATCH] made warning about missign fingerprint beingprinted only once git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5969 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/pqi/authgpg.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libretroshare/src/pqi/authgpg.cc b/libretroshare/src/pqi/authgpg.cc index cdf9dcb80..d9da5e911 100644 --- a/libretroshare/src/pqi/authgpg.cc +++ b/libretroshare/src/pqi/authgpg.cc @@ -291,9 +291,12 @@ bool AuthGPG::DoOwnSignature(const void *data, unsigned int datalen, void *buf_s /* import to GnuPG and other Certificates */ bool AuthGPG::VerifySignature(const void *data, int datalen, const void *sig, unsigned int siglen, const std::string &withfingerprint) { - if(withfingerprint.length() != 40) + static bool already_reported = false ; + + if(withfingerprint.length() != 40 && !already_reported) { - std::cerr << "AuthGPG::VerifySignature(): no (or dammaged) fingerprint. Nor verifying signature. This is likely to be an unknown peer. fingerprint=\"" << withfingerprint << "\"." << std::endl; + std::cerr << "AuthGPG::VerifySignature(): no (or dammaged) fingerprint. Nor verifying signature. This is likely to be an unknown peer. fingerprint=\"" << withfingerprint << "\". Not reporting other errors." << std::endl; + already_reported = true ; return false ; }