solve a bug with gpg signature summary

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2119 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
joss17 2010-01-24 22:20:13 +00:00
parent bf36fd86bf
commit 8bfd696430
2 changed files with 9 additions and 6 deletions

View File

@ -821,11 +821,11 @@ bool AuthGPG::VerifySignature_locked(const void *data, int datalen, const void *
while(sg != NULL)
{
#ifdef GPG_DEBUG
fprintf(stderr, "AuthGPG::Verify Sig by: %s, Result: %d\n", sg->fpr, sg->summary);
fprintf(stderr, "AuthGPG::Verify Sig by: %s, status: %d\n", sg->fpr, sg->status);
print_pgpme_verify_summary(sg->summary);
#endif
if (sg->summary & GPGME_SIGSUM_VALID)
if (sg->status == GPG_ERR_NO_ERROR)
{
#ifdef GPG_DEBUG
fprintf(stderr, "AuthGPG::VerifySignature() OK\n");

View File

@ -950,9 +950,10 @@ bool RsInit::GenerateSSLCertificate(std::string gpg_id, std::string org, std
/* try to load it, and get Id */
std::string location;
int ret = 0;
ret = LoadCheckX509andGetLocation(cert_name.c_str(), location, sslId);
if (LoadCheckX509andGetLocation(cert_name.c_str(), location, sslId) == 0) {
std::cerr << "RsInit::GenerateSSLCertificate() Cannot check own signature, maybe the files are corrupted." << std::endl;
return false;
}
/* Move directory to correct id */
std::string finalbase = RsInitConfig::basedir + RsInitConfig::dirSeperator + sslId + RsInitConfig::dirSeperator;
@ -1106,7 +1107,9 @@ int RsInit::LoadCertificates(bool autoLoginNT)
gpgme_data_new_from_stream (&cipher, sslPassphraseFile);
if (0 < AuthGPG::getAuthGPG()->encryptText(plain, cipher)) {
std::cerr << "Encrypting went ok !" << std::endl;
}
} else {
std::cerr << "Encrypting went wrong !" << std::endl;
}
gpgme_data_release (cipher);
gpgme_data_release (plain);
fclose(sslPassphraseFile);