From 4c72eaa04e6eb17252e5fc956e59454353138fc3 Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 14 Aug 2012 07:34:29 +0000 Subject: [PATCH] added debug #ifdef to certificate handling code git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5414 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/pgp/rscertificate.cc | 7 ++++++- libretroshare/src/pgp/rscertificate.h | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/libretroshare/src/pgp/rscertificate.cc b/libretroshare/src/pgp/rscertificate.cc index f78ce23e9..8ef42d2a9 100644 --- a/libretroshare/src/pgp/rscertificate.cc +++ b/libretroshare/src/pgp/rscertificate.cc @@ -8,6 +8,8 @@ #include #include "rscertificate.h" +#define DEBUG_RSCERTIFICATE + static const std::string PGP_CERTIFICATE_START ( "-----BEGIN PGP PUBLIC KEY BLOCK-----" ); static const std::string PGP_CERTIFICATE_END ( "-----END PGP PUBLIC KEY BLOCK-----" ); static const std::string EXTERNAL_IP_BEGIN_SECTION ( "--EXT--" ); @@ -162,8 +164,9 @@ bool RsCertificate::initFromString(const std::string& instr,std::string& err_str str += instr[i] ; } - +#ifdef DEBUG_RSCERTIFICATE std::cerr << "Decodign from:" << str << std::endl; +#endif // 1 - decode the string. // char *bf = NULL ; @@ -189,7 +192,9 @@ bool RsCertificate::initFromString(const std::string& instr,std::string& err_str return false ; } +#ifdef DEBUG_RSCERTIFICATE std::cerr << "Packet parse: read ptag " << (int)ptag << ", size " << s << ", total_s = " << total_s << ", expected total = " << size << std::endl; +#endif switch(ptag) { diff --git a/libretroshare/src/pgp/rscertificate.h b/libretroshare/src/pgp/rscertificate.h index 3bbe5afd8..52820e46f 100644 --- a/libretroshare/src/pgp/rscertificate.h +++ b/libretroshare/src/pgp/rscertificate.h @@ -42,7 +42,7 @@ class RsCertificate unsigned short loc_port_us() const ; const unsigned char *pgp_key() const { return binary_pgp_key ; } - const size_t pgp_key_size() const { return binary_pgp_key_size ; } + size_t pgp_key_size() const { return binary_pgp_key_size ; } static bool cleanCertificate(const std::string& input,std::string& output,RsCertificate::Format& format,int& error_code) ;