- added new certificate format in ConfCertDialog and ConnectFriendWizard, with a button to switch to old format if necessary

- added automatic cleaning of certificates in both formats
- grouped all certificate cleaning/parsing code in rscertificate.cc
- removed unused files cleanupxpgp.h/cc
- added upper/lower case to rsid template.

The new format is to be tested. It is supposed to be much more robust than the previous format,
in particular, allowing any string for location names.


git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5410 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2012-08-13 19:37:50 +00:00
parent 64e171948c
commit 60f51c358c
21 changed files with 1037 additions and 1099 deletions

View file

@ -41,7 +41,6 @@
#include <sstream>
#include <algorithm>
#include "serialiser/rsconfigitems.h"
#include "cleanupxpgp.h"
#define LIMIT_CERTIFICATE_SIZE 1
#define MAX_CERTIFICATE_SIZE 10000
@ -492,14 +491,18 @@ bool AuthGPG::getGPGSignedList(std::list<std::string> &ids)
bool AuthGPG::getCachedGPGCertificate(const std::string &id, std::string &certificate)
{
RsStackMutex stack(gpgMtxData); /******* LOCKED ******/
certificate = PGPHandler::SaveCertificateToString(PGPIdType(id),false) ;
#ifdef LIMIT_CERTIFICATE_SIZE
std::string cleaned_key ;
if(PGPKeyManagement::createMinimalKey(certificate,cleaned_key))
certificate = cleaned_key ;
certificate = PGPHandler::SaveCertificateToString(PGPIdType(id),false) ;
#else
certificate = PGPHandler::SaveCertificateToString(PGPIdType(id),true) ;
#endif
// #ifdef LIMIT_CERTIFICATE_SIZE
// std::string cleaned_key ;
// if(PGPKeyManagement::createMinimalKey(certificate,cleaned_key))
// certificate = cleaned_key ;
// #endif
return certificate.length() > 0 ;
}
@ -525,14 +528,15 @@ std::string AuthGPG::SaveCertificateToString(const std::string &id,bool include_
std::string tmp = PGPHandler::SaveCertificateToString(PGPIdType(id),include_signatures) ;
// Try to remove signatures manually.
//
std::string cleaned_key ;
// // Try to remove signatures manually.
// //
// std::string cleaned_key ;
//
// if( (!include_signatures) && PGPKeyManagement::createMinimalKey(tmp,cleaned_key))
// return cleaned_key ;
// else
if( (!include_signatures) && PGPKeyManagement::createMinimalKey(tmp,cleaned_key))
return cleaned_key ;
else
return tmp;
return tmp;
}
/* import to GnuPG and other Certificates */