diff --git a/libretroshare/src/pqi/authgpg.cc b/libretroshare/src/pqi/authgpg.cc index e01aa1d72..b1046c4bd 100644 --- a/libretroshare/src/pqi/authgpg.cc +++ b/libretroshare/src/pqi/authgpg.cc @@ -30,6 +30,7 @@ #include #include #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; diff --git a/libretroshare/src/pqi/cleanupxpgp.cc b/libretroshare/src/pqi/cleanupxpgp.cc index 99b7077ea..45e1a954c 100644 --- a/libretroshare/src/pqi/cleanupxpgp.cc +++ b/libretroshare/src/pqi/cleanupxpgp.cc @@ -224,7 +224,21 @@ std::string cleanUpCertificate(std::string badCertificate) while(badCertificate[currBadCertIdx]=='\n'|| badCertificate[currBadCertIdx]==' ') { 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 diff --git a/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp b/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp index 9ff87c8fa..dc60ca755 100755 --- a/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp +++ b/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp @@ -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);