- moved pgpkey.h/cc into pgp directory

- fixed bug in key cleaning code


git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-OpenPGP@5291 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2012-07-13 11:08:13 +00:00
parent f5c276c9b5
commit ddf503a793
7 changed files with 18 additions and 7 deletions

View file

@ -34,7 +34,7 @@
#include "pgp/pgphandler.h"
#include <util/rsdir.h>
#include <util/pgpkey.h>
#include <pgp/pgpkeyutil.h>
#include <iostream>
#include <stdexcept>
#include <sstream>

View file

@ -287,7 +287,18 @@ std::string cleanUpCertificate(const std::string& badCertificate,int& error_code
while(currBadCertIdx < endCertStartIdx1 && (badCertificate[currBadCertIdx] == '=' || badCertificate[currBadCertIdx] == ' ' || badCertificate[currBadCertIdx] == '\n' ))
currBadCertIdx++ ;
cleanCertificate += "==\n=";
switch(cntPerLine % 4)
{
case 0: break ;
case 1: std::cerr<<"Certificate corrupted beyond repair: wrongnumber of chars on last line (n%4=1)"<<std::endl;
error_code = RS_PEER_CERT_CLEANING_CODE_WRONG_NUMBER;
return badCertificate ;
case 2: cleanCertificate += "==" ;
break ;
case 3: cleanCertificate += "=" ;
break ;
}
cleanCertificate += "\n=";
// if (badCertificate[currBadCertIdx] == '=')
// {