aboutsummaryrefslogtreecommitdiff
path: root/src/gpg.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2013-03-12 15:03:59 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2013-03-12 15:22:13 +0200
commit1ba8cf95a5f536d4aa6293f9848271a7285bc092 (patch)
treedede8a4bccb1daad8b67530d87845e7fe05749e6 /src/gpg.c
parent293108d7806aa3c0c5e706237b3788b261779e66 (diff)
downloadwydawca-1ba8cf95a5f536d4aa6293f9848271a7285bc092.tar.gz
wydawca-1ba8cf95a5f536d4aa6293f9848271a7285bc092.tar.bz2
Namespace normalization (2). Provide installable headers.
* Makefile.am (SUBDIRS): Add include. * configure.ac: Build include/*/Makefile Set-up grecs as a shared convenience library. Install its headers. * include/Makefile.am: New file. * include/wydawca/Makefile.am: New file. * include/wydawca/cfg.h: New file. * include/wydawca/wydawca.h: New file. * modules/mailutils/Makefile.am (AM_CPPFLAGS): Add include/ * src/Makefile.am (LDADD): Use @GRECS_LDADD@ (AM_CPPFLAGS): Add include/. * tests/Makefile.am: Likewise. * src/wydawca.h: Include wydawca/wydawca.h. (__cat2__, __cat3__): Move to installable header and rename. (struct wy_user): Move to installable header. (struct file_triplet): Rename to wy_triplet. All uses changed. (enum notification_event): Rename to wy_event and move to installable header. (struct metadef): Rename to wy_metadef and move to installable header. (dry_run_mode): Rename to wy_dry_run and move to installable header. (wydawca_gpg_homedir): Rename to wy_gpg_homedir and move to installable header. (wy_version, wy_debug_level, wy_log_to_stderr) (wy_log_facility, wy_syslog_tag) (wy_log,wy_dbg): Move to installable header. * modules/mailutils/mod_mailutils.c: Update. * src/cmdline.opt * src/config.c * src/directive.c * src/diskio.c * src/event.c * src/gpg.c * src/job.c * src/meta.c * src/module.c * src/null.c * src/timer.c * src/triplet.c * src/verify.c * src/vtab.c * src/watcher.c * src/wydawca.c
Diffstat (limited to 'src/gpg.c')
-rw-r--r--src/gpg.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gpg.c b/src/gpg.c
index ca7c185..ff55619 100644
--- a/src/gpg.c
+++ b/src/gpg.c
@@ -131,13 +131,13 @@ create_gpg_homedir()
wy_debug(2, (_("GNUPG home directory: %s"), temp_homedir));
setenv("GNUPGHOME", temp_homedir, 1);
return 0;
}
static int
-checksig(gpgme_signature_t sig, const char *uid, struct file_triplet *trp)
+checksig(gpgme_signature_t sig, const char *uid, struct wy_triplet *trp)
{
switch (gpg_err_code(sig->status)) {
case GPG_ERR_NO_ERROR:
wy_debug(1, (_("Good signature from %s"), uid));
trp->uploader = uploader_find_frp(trp->uploader_list,
sig->fpr);
@@ -181,13 +181,13 @@ checksig(gpgme_signature_t sig, const char *uid, struct file_triplet *trp)
}
return -1;
}
static int
gpg_verify_signature(gpgme_ctx_t ctx, gpgme_signature_t sig,
- struct file_triplet *trp)
+ struct wy_triplet *trp)
{
if (!sig)
return 0;
for (; sig; sig = sig->next) {
const char *uid;
@@ -205,24 +205,24 @@ gpg_verify_signature(gpgme_ctx_t ctx, gpgme_signature_t sig,
}
return 1;
}
/* Verify the directive file from TRP using public key PUBKEY */
int
-verify_directive_signature(struct file_triplet *trp)
+verify_directive_signature(struct wy_triplet *trp)
{
gpgme_ctx_t ctx;
gpgme_data_t key_data, directive_data, plain = NULL;
gpgme_error_t ec;
int rc;
struct wy_user *uptr;
create_gpg_homedir();
fail_if_err(gpgme_new(&ctx));
- for (uptr = triplet_get_uploaders(trp); uptr; uptr = uptr->next) {
+ for (uptr = wy_triplet_get_uploaders(trp); uptr; uptr = uptr->next) {
gpgme_import_result_t res;
gpgme_import_status_t pstat;
fail_if_err(gpgme_data_new_from_mem(&key_data,
uptr->gpg_key,
strlen(uptr->gpg_key), 0));
@@ -243,13 +243,13 @@ verify_directive_signature(struct file_triplet *trp)
gpgme_verify_result_t result;
result = gpgme_op_verify_result(ctx);
if (!gpg_verify_signature(ctx, result->signatures, trp)) {
UPDATE_STATS(STAT_BAD_SIGNATURE);
notify(trp->spool->notification, trp,
- ev_bad_directive_signature);
+ wy_ev_bad_directive_signature);
rc = 1;
} else
rc = 0;
} else {
rc = 1;
UPDATE_STATS(STAT_BAD_SIGNATURE);
@@ -266,13 +266,13 @@ verify_directive_signature(struct file_triplet *trp)
}
/* Verify the detached signature of TRP.
NOTE: It is assumed that the public key is already registered (by
a previous call to verify_directive_signature). */
int
-verify_detached_signature(struct file_triplet *trp)
+verify_detached_signature(struct wy_triplet *trp)
{
gpgme_engine_info_t info;
const char *argv[5];
const struct spool *spool;
ASGN_SPOOL(spool, trp, return 1);
@@ -299,13 +299,13 @@ verify_detached_signature(struct file_triplet *trp)
wy_debug(1, (_("good detached signature for %s"), trp->name));
return 0;
case exec_fail:
UPDATE_STATS(STAT_BAD_SIGNATURE);
wy_log(LOG_ERR, _("BAD detached signature for %s"), trp->name);
- notify(spool->notification, trp, ev_bad_detached_signature);
+ notify(spool->notification, trp, wy_ev_bad_detached_signature);
break;
case exec_error:
wy_log(LOG_CRIT, _("cannot verify detached signature for %s"),
trp->name);
break;

Return to:

Send suggestions and report system problems to the System administrator.