path: root/src/gpg.c
diff options
authorSergey Poznyakoff <gray@gnu.org.ua>2009-12-08 22:08:36 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2009-12-08 22:11:04 +0200
commit67ca2ef061a73bc90e4399471ee0cb3ce6f0ee41 (patch)
treed45493df75f3f613ca6b3d13a7f5d7a0280650a6 /src/gpg.c
parente1afd42340c0b2c22660744e0f88258a44617e88 (diff)
Implement GPG signing of the outgoing notifications.
* src/config.c (mail_statistics_kw): New keyword gpg-sign. (notify_event_kw): Likewise. (wydawca_kw): New keyword gpg-homedir. * src/gpg.c (wydawca_gpg_homedir): Rename to create_gpg_homedir. Make static. All uses updated. * src/mail.c (admin_stat_sign_key): New global. (mu_stream_data_read_cb) (gpg_sign, sign_message): New functions. (mail_send_message): Take 3rd argument: ID of the PGP key to sign the message with. All callers updated. (do_notify): Rewrite. * src/wydawca.c (wydawca_gpg_homedir): New variable. * src/wydawca.h (struct notification): New member sign_keys. (admin_stat_sign_key): New extern. (wydawca_gpg_homedir): New extern.
Diffstat (limited to 'src/gpg.c')
1 files changed, 4 insertions, 5 deletions
diff --git a/src/gpg.c b/src/gpg.c
index 71be53c..1389845 100644
--- a/src/gpg.c
+++ b/src/gpg.c
@@ -125,14 +125,14 @@ remove_homedir ()
logmsg (LOG_DEBUG, _("removing GNUPG home directory: %s"), homedir);
if (rmdir_r (homedir))
logmsg (LOG_CRIT, _("failed to remove GPG directory %s"), homedir);
/* Create a temporary GPG home directory */
-wydawca_gpg_homedir ()
+static int
+create_gpg_homedir ()
if (homedir)
return 0;
homedir = xstrdup ("/tmp/wydawca-XXXXXX");
if (!mkdtemp (homedir))
@@ -219,18 +219,17 @@ gpg_verify_signature (gpgme_ctx_t ctx, gpgme_signature_t sig,
verify_directive_signature (struct file_triplet *trp,
const struct spool *spool)
gpgme_ctx_t ctx;
gpgme_data_t key_data, directive_data, plain;
- off_t size;
gpgme_error_t ec;
int rc;
struct uploader_info *uptr;
- wydawca_gpg_homedir ();
+ create_gpg_homedir ();
fail_if_err (gpgme_new (&ctx));
for (uptr = trp->uploader_list; uptr; uptr = uptr->next)
gpgme_import_result_t res;
gpgme_import_status_t pstat;
@@ -298,13 +297,13 @@ verify_detached_signature (struct file_triplet *trp,
logmsg (LOG_CRIT,
_("cannot find path to gpg binary (attempting to verify "
"the detached signature for %s"), trp->name);
return 1;
- wydawca_gpg_homedir ();
+ create_gpg_homedir ();
argv[0] = info->file_name;
argv[1] = "--verify";
argv[2] = trp->file[file_signature].name;
argv[3] = trp->file[file_dist].name;
argv[4] = NULL;

Return to:

Send suggestions and report system problems to the System administrator.