- 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

@ -378,6 +378,7 @@ HEADERS += ft/ftchunkmap.h \
HEADERS += pqi/authssl.h \
pqi/authgpg.h \
pgp/pgphandler.h \
pgp/pgpkeyutil.h \
pqi/cleanupxpgp.h \
pqi/p3cfgmgr.h \
pqi/p3peermgr.h \
@ -493,7 +494,6 @@ HEADERS += util/folderiterator.h \
util/rsrandom.h \
util/pugiconfig.h \
util/radix64.h \
util/pgpkey.h \
util/pugixml.h
SOURCES += dbase/cachestrapper.cc \
@ -518,6 +518,7 @@ SOURCES += ft/ftchunkmap.cc \
SOURCES += pqi/authgpg.cc \
pqi/authssl.cc \
pgp/pgphandler.cc \
pgp/pgpkeyutil.cc \
pqi/cleanupxpgp.cc \
pqi/p3cfgmgr.cc \
pqi/p3peermgr.cc \
@ -634,7 +635,6 @@ SOURCES += util/folderiterator.cc \
util/rsversion.cc \
util/rswin.cc \
util/rsrandom.cc \
util/pgpkey.cc \
util/pugixml.cc
minimal {

View File

@ -22,7 +22,7 @@ extern "C" {
#include "pgphandler.h"
#include "retroshare/rsiface.h" // For rsicontrol.
#include "util/rsdir.h"
#include "util/pgpkey.h"
#include "pgp/pgpkeyutil.h"
//#define DEBUG_PGPHANDLER 1
@ -434,7 +434,6 @@ std::string PGPHandler::makeRadixEncodedPGPKey(const ops_keydata_t *key)
ops_memory_t *buf = NULL ;
ops_setup_memory_write(&cinfo, &buf, 0);
const unsigned char *passphrase = NULL ;
if(key->type == OPS_PTAG_CT_PUBLIC_KEY)
{

View File

@ -1,6 +1,6 @@
#include <stdint.h>
#include <util/radix64.h>
#include "pgpkey.h"
#include "pgpkeyutil.h"
#include <iostream>
#include <stdexcept>

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] == '=')
// {

View File

@ -78,6 +78,7 @@ const int RS_PEER_CERT_CLEANING_CODE_UNKOWN_ERROR = 0x01 ;
const int RS_PEER_CERT_CLEANING_CODE_NO_BEGIN_TAG = 0x02 ;
const int RS_PEER_CERT_CLEANING_CODE_NO_END_TAG = 0x03 ;
const int RS_PEER_CERT_CLEANING_CODE_NO_CHECKSUM = 0x04 ;
const int RS_PEER_CERT_CLEANING_CODE_WRONG_NUMBER = 0x05 ;
/* LinkType Flags */