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
@@ -134,7 +134,7 @@ create_gpg_homedir()
134} 134}
135 135
136static int 136static int
137checksig(gpgme_signature_t sig, const char *uid, struct file_triplet *trp) 137checksig(gpgme_signature_t sig, const char *uid, struct wy_triplet *trp)
138{ 138{
139 switch (gpg_err_code(sig->status)) { 139 switch (gpg_err_code(sig->status)) {
140 case GPG_ERR_NO_ERROR: 140 case GPG_ERR_NO_ERROR:
@@ -184,7 +184,7 @@ checksig(gpgme_signature_t sig, const char *uid, struct file_triplet *trp)
184 184
185static int 185static int
186gpg_verify_signature(gpgme_ctx_t ctx, gpgme_signature_t sig, 186gpg_verify_signature(gpgme_ctx_t ctx, gpgme_signature_t sig,
187 struct file_triplet *trp) 187 struct wy_triplet *trp)
188{ 188{
189 if (!sig) 189 if (!sig)
190 return 0; 190 return 0;
@@ -208,7 +208,7 @@ gpg_verify_signature(gpgme_ctx_t ctx, gpgme_signature_t sig,
208 208
209/* Verify the directive file from TRP using public key PUBKEY */ 209/* Verify the directive file from TRP using public key PUBKEY */
210int 210int
211verify_directive_signature(struct file_triplet *trp) 211verify_directive_signature(struct wy_triplet *trp)
212{ 212{
213 gpgme_ctx_t ctx; 213 gpgme_ctx_t ctx;
214 gpgme_data_t key_data, directive_data, plain = NULL; 214 gpgme_data_t key_data, directive_data, plain = NULL;
@@ -219,7 +219,7 @@ verify_directive_signature(struct file_triplet *trp)
219 create_gpg_homedir(); 219 create_gpg_homedir();
220 fail_if_err(gpgme_new(&ctx)); 220 fail_if_err(gpgme_new(&ctx));
221 221
222 for (uptr = triplet_get_uploaders(trp); uptr; uptr = uptr->next) { 222 for (uptr = wy_triplet_get_uploaders(trp); uptr; uptr = uptr->next) {
223 gpgme_import_result_t res; 223 gpgme_import_result_t res;
224 gpgme_import_status_t pstat; 224 gpgme_import_status_t pstat;
225 225
@@ -246,7 +246,7 @@ verify_directive_signature(struct file_triplet *trp)
246 if (!gpg_verify_signature(ctx, result->signatures, trp)) { 246 if (!gpg_verify_signature(ctx, result->signatures, trp)) {
247 UPDATE_STATS(STAT_BAD_SIGNATURE); 247 UPDATE_STATS(STAT_BAD_SIGNATURE);
248 notify(trp->spool->notification, trp, 248 notify(trp->spool->notification, trp,
249 ev_bad_directive_signature); 249 wy_ev_bad_directive_signature);
250 rc = 1; 250 rc = 1;
251 } else 251 } else
252 rc = 0; 252 rc = 0;
@@ -269,7 +269,7 @@ verify_directive_signature(struct file_triplet *trp)
269 NOTE: It is assumed that the public key is already registered (by 269 NOTE: It is assumed that the public key is already registered (by
270 a previous call to verify_directive_signature). */ 270 a previous call to verify_directive_signature). */
271int 271int
272verify_detached_signature(struct file_triplet *trp) 272verify_detached_signature(struct wy_triplet *trp)
273{ 273{
274 gpgme_engine_info_t info; 274 gpgme_engine_info_t info;
275 const char *argv[5]; 275 const char *argv[5];
@@ -302,7 +302,7 @@ verify_detached_signature(struct file_triplet *trp)
302 case exec_fail: 302 case exec_fail:
303 UPDATE_STATS(STAT_BAD_SIGNATURE); 303 UPDATE_STATS(STAT_BAD_SIGNATURE);
304 wy_log(LOG_ERR, _("BAD detached signature for %s"), trp->name); 304 wy_log(LOG_ERR, _("BAD detached signature for %s"), trp->name);
305 notify(spool->notification, trp, ev_bad_detached_signature); 305 notify(spool->notification, trp, wy_ev_bad_detached_signature);
306 break; 306 break;
307 307
308 case exec_error: 308 case exec_error:

Return to:

Send suggestions and report system problems to the System administrator.