summaryrefslogtreecommitdiffabout
path: root/src/gpg.c
Unidiff
Diffstat (limited to 'src/gpg.c') (more/less context) (ignore whitespace changes)
-rw-r--r--src/gpg.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gpg.c b/src/gpg.c
index cca5048..979d0c0 100644
--- a/src/gpg.c
+++ b/src/gpg.c
@@ -212,23 +212,21 @@ gpg_verify_signature (gpgme_ctx_t ctx, gpgme_signature_t sig,
212 } 212 }
213 } 213 }
214 return 1; 214 return 1;
215} 215}
216 216
217/* Verify the directive file from TRP using public key PUBKEY */ 217/* Verify the directive file from TRP using public key PUBKEY */
218/* FIXME: spool currently unused */
219int 218int
220verify_directive_signature (struct file_triplet *trp, 219verify_directive_signature (struct file_triplet *trp)
221 const struct spool *spool)
222{ 220{
223 gpgme_ctx_t ctx; 221 gpgme_ctx_t ctx;
224 gpgme_data_t key_data, directive_data, plain; 222 gpgme_data_t key_data, directive_data, plain;
225 gpgme_error_t ec; 223 gpgme_error_t ec;
226 int rc; 224 int rc;
227 struct uploader_info *uptr; 225 struct uploader_info *uptr;
228 226
229 create_gpg_homedir (); 227 create_gpg_homedir ();
230 fail_if_err (gpgme_new (&ctx)); 228 fail_if_err (gpgme_new (&ctx));
231 229
232 for (uptr = trp->uploader_list; uptr; uptr = uptr->next) 230 for (uptr = trp->uploader_list; uptr; uptr = uptr->next)
233 { 231 {
234 gpgme_import_result_t res; 232 gpgme_import_result_t res;
@@ -256,13 +254,13 @@ verify_directive_signature (struct file_triplet *trp,
256 gpgme_verify_result_t result; 254 gpgme_verify_result_t result;
257 255
258 result = gpgme_op_verify_result (ctx); 256 result = gpgme_op_verify_result (ctx);
259 if (!gpg_verify_signature (ctx, result->signatures, trp)) 257 if (!gpg_verify_signature (ctx, result->signatures, trp))
260 { 258 {
261 UPDATE_STATS (STAT_BAD_SIGNATURE); 259 UPDATE_STATS (STAT_BAD_SIGNATURE);
262 notify (spool->notification, trp, ev_bad_directive_signature); 260 notify (trp->spool->notification, trp, ev_bad_directive_signature);
263 rc = 1; 261 rc = 1;
264 } 262 }
265 else 263 else
266 rc = 0; 264 rc = 0;
267 } 265 }
268 else 266 else
@@ -280,18 +278,20 @@ verify_directive_signature (struct file_triplet *trp,
280} 278}
281 279
282/* Verify the detached signature of TRP. 280/* Verify the detached signature of TRP.
283 NOTE: It is assumed that the public key is already registered (by 281 NOTE: It is assumed that the public key is already registered (by
284 a previous call to verify_directive_signature). */ 282 a previous call to verify_directive_signature). */
285int 283int
286verify_detached_signature (struct file_triplet *trp, 284verify_detached_signature (struct file_triplet *trp)
287 const struct spool *spool)
288{ 285{
289 gpgme_engine_info_t info; 286 gpgme_engine_info_t info;
290 const char *argv[5]; 287 const char *argv[5];
288 const struct spool *spool;
291 289
290 ASGN_SPOOL (spool, trp, return 1);
291
292 fail_if_err (gpgme_get_engine_info (&info)); 292 fail_if_err (gpgme_get_engine_info (&info));
293 while (info && info->protocol != GPGME_PROTOCOL_OpenPGP) 293 while (info && info->protocol != GPGME_PROTOCOL_OpenPGP)
294 info = info->next; 294 info = info->next;
295 if (!info) 295 if (!info)
296 { 296 {
297 logmsg (LOG_CRIT, 297 logmsg (LOG_CRIT,

Return to:

Send suggestions and report system problems to the System administrator.