Mercurial > ~mikael > mcabber > hg
diff mcabber/src/pgp.c @ 1238:80008fe2a4f2
Re-enable gpg-agent (revert 591d8b35c881)
Some people were actually using it... :)
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sat, 16 Jun 2007 12:30:43 +0200 |
parents | 591d8b35c881 |
children | f89844a0448a |
line wrap: on
line diff
--- a/mcabber/src/pgp.c Sat Jun 16 12:28:27 2007 +0200 +++ b/mcabber/src/pgp.c Sat Jun 16 12:30:43 2007 +0200 @@ -253,11 +253,11 @@ { gpgme_ctx_t ctx; gpgme_data_t in, out; + char *p; char *signed_data = NULL; size_t nread; gpgme_key_t key; gpgme_error_t err; - //char *p; if (!gpg.enabled || !gpg.private_key) return NULL; @@ -273,12 +273,9 @@ gpgme_set_textmode(ctx, 0); gpgme_set_armor(ctx, 1); - /* p = getenv("GPG_AGENT_INFO"); if (!(p && strchr(p, ':'))) gpgme_set_passphrase_cb(ctx, passphrase_cb, 0); - */ - gpgme_set_passphrase_cb(ctx, passphrase_cb, 0); err = gpgme_get_key(ctx, gpg.private_key, &key, 1); if (err || !key) { @@ -324,13 +321,12 @@ { gpgme_ctx_t ctx; gpgme_data_t in, out; - char *data; + char *p, *data; char *decrypted_data = NULL; size_t nread; gpgme_error_t err; const char prefix[] = "-----BEGIN PGP MESSAGE-----\n\n"; const char suffix[] = "\n-----END PGP MESSAGE-----\n"; - //char *p; if (!gpg.enabled) return NULL; @@ -344,12 +340,9 @@ gpgme_set_protocol(ctx, GPGME_PROTOCOL_OpenPGP); - /* p = getenv("GPG_AGENT_INFO"); if (!(p && strchr(p, ':'))) gpgme_set_passphrase_cb(ctx, passphrase_cb, 0); - */ - gpgme_set_passphrase_cb(ctx, passphrase_cb, 0); // Surround the given data with the prefix & suffix data = g_new(char, sizeof(prefix) + sizeof(suffix) + strlen(gpg_data));