corrected bug in conversion char * (from gpgme) into string

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1586 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2009-09-02 19:31:10 +00:00
parent d00a33ca14
commit 6de5024634
2 changed files with 2 additions and 0 deletions

View File

@ -1077,6 +1077,7 @@ bool GPGAuthMgr::DoOwnSignature_locked(void *data, unsigned int datalen, void *b
/* now extract the data from gpgmeSig */ /* now extract the data from gpgmeSig */
size_t len = 0; size_t len = 0;
int len2 = len; int len2 = len;
gpgme_data_write (gpgmeSig, "", 1); // to be able to convert it into a string
char *export_sig = gpgme_data_release_and_get_mem(gpgmeSig, &len); char *export_sig = gpgme_data_release_and_get_mem(gpgmeSig, &len);
fprintf(stderr, "GPGAuthMgr::Signature len: %d \n", len2); fprintf(stderr, "GPGAuthMgr::Signature len: %d \n", len2);
if (len < *outl) if (len < *outl)

View File

@ -1337,6 +1337,7 @@ int RsInit::LoadCertificates(bool autoLoginNT)
gpgme_error_t error_reading_file = gpgme_data_new_from_stream (&cipher, sslPassphraseFile); gpgme_error_t error_reading_file = gpgme_data_new_from_stream (&cipher, sslPassphraseFile);
if (0 < authMgr->decryptText(cipher, plain)) { if (0 < authMgr->decryptText(cipher, plain)) {
std::cerr << "Decrypting went ok !" << std::endl; std::cerr << "Decrypting went ok !" << std::endl;
gpgme_data_write (plain, "", 1);
sslPassword = gpgme_data_release_and_get_mem(plain, NULL); sslPassword = gpgme_data_release_and_get_mem(plain, NULL);
} else { } else {
gpgme_data_release (plain); gpgme_data_release (plain);