mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-15 10:54:22 -05:00
solve a bug with gpg private key validity unknown
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2202 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
faa1e15db2
commit
6f9b8bb013
@ -257,21 +257,30 @@ bool AuthGPG::availableGPGCertificatesWithPrivateKeys(std::list<std::string> &id
|
||||
*/
|
||||
int AuthGPG::GPGInit(std::string ownId)
|
||||
{
|
||||
RsStackMutex stack(pgpMtx); /******* LOCKED ******/
|
||||
std::cerr << "AuthGPG::GPGInit() called with own gpg id : " << ownId << std::endl;
|
||||
{
|
||||
RsStackMutex stack(pgpMtx); /******* LOCKED ******/
|
||||
std::cerr << "AuthGPG::GPGInit() called with own gpg id : " << ownId << std::endl;
|
||||
|
||||
if (!gpgmeInit) {
|
||||
if (!gpgmeInit) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
mOwnGpgId = ownId;
|
||||
storeAllKeys_locked();
|
||||
|
||||
if (mOwnGpgCert.id != mOwnGpgId) {
|
||||
std::cerr << "AuthGPG::GPGInit() failed to find your id." << std::endl;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
mOwnGpgId = ownId;
|
||||
storeAllKeys_locked();
|
||||
|
||||
if (mOwnGpgCert.id != mOwnGpgId) {
|
||||
std::cerr << "AuthGPG::GPGInit() failed to find your id." << std::endl;
|
||||
return 0;
|
||||
//check the validity of the private key. When set to unknown, it caused signature and text encryptions bugs
|
||||
if (mOwnGpgCert.validLvl < 2) {
|
||||
std::cerr << "AuthGPG::GPGInit() abnormal validity set to private key. Switch it to none by default." << std::endl;
|
||||
privateTrustCertificate(mOwnGpgId, 2);
|
||||
}
|
||||
|
||||
|
||||
gpgmeKeySelected = true;
|
||||
//printAllKeys_locked();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user