mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
add the clean cert routine for gpg certs
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2090 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
868e60af06
commit
c0acb71136
@ -30,6 +30,7 @@
|
||||
#include <sstream>
|
||||
#include <algorithm>
|
||||
#include "serialiser/rsconfigitems.h"
|
||||
#include "cleanupxpgp.h"
|
||||
|
||||
|
||||
// initialisation du pointeur de singleton à zéro
|
||||
@ -1201,8 +1202,12 @@ bool AuthGPG::LoadCertificateFromString(std::string str, std::string &gpg_id)
|
||||
|
||||
RsStackMutex stack(pgpMtx); /******* LOCKED ******/
|
||||
|
||||
std::string cleancert = cleanUpCertificate(str);
|
||||
|
||||
std::cerr << "AuthGPG::LoadCertificateFromString() cleancert : " << cleancert;
|
||||
|
||||
gpgme_data_t gpgmeData;
|
||||
if (GPG_ERR_NO_ERROR != gpgme_data_new_from_mem(&gpgmeData, str.c_str(), str.length(), 1))
|
||||
if (GPG_ERR_NO_ERROR != gpgme_data_new_from_mem(&gpgmeData, cleancert.c_str(), cleancert.length(), 1))
|
||||
{
|
||||
std::cerr << "Error create Data";
|
||||
std::cerr << std::endl;
|
||||
|
@ -225,6 +225,20 @@ std::string cleanUpCertificate(std::string badCertificate)
|
||||
{
|
||||
currBadCertIdx++;
|
||||
}
|
||||
|
||||
//keep the first line : gnupg version
|
||||
cleanCertificate[currCleanCertIdx]= badCertificate[currBadCertIdx];
|
||||
currBadCertIdx++;
|
||||
while(badCertificate[currBadCertIdx]!='\n')
|
||||
{
|
||||
cleanCertificate[currCleanCertIdx]= badCertificate[currBadCertIdx];
|
||||
currCleanCertIdx++;
|
||||
currBadCertIdx++;
|
||||
}
|
||||
cleanCertificate[currCleanCertIdx]= badCertificate[currBadCertIdx];
|
||||
currCleanCertIdx++;
|
||||
currBadCertIdx++;
|
||||
|
||||
//Start of the actual certificate. Remove spaces in the certificate
|
||||
//and make sure there are 64 characters per line in the
|
||||
//new cleaned certificate
|
||||
|
@ -813,7 +813,7 @@ void ConclusionPage::initializePage() {
|
||||
//set the radio button to sign the GPG key
|
||||
if (detail.accept_connection && !detail.ownsign) {
|
||||
//gpg key connection is already accepted, don't propose to accept it again
|
||||
signGPGRadioButton->setText(tr("Peer is already a GPG key is already a retroshare friend. Sign his GPG key."));
|
||||
signGPGRadioButton->setText(tr("Peer is already a retroshare friend. Sign his GPG key."));
|
||||
signGPGRadioButton->setChecked(true);
|
||||
acceptNoSignGPGRadioButton->hide();
|
||||
acceptNoSignGPGRadioButton->setChecked(false);
|
||||
|
Loading…
Reference in New Issue
Block a user