diff options
Diffstat (limited to 'src/gpg.c')
-rw-r--r-- | src/gpg.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -125,14 +125,14 @@ remove_homedir () | |||
125 | logmsg (LOG_DEBUG, _("removing GNUPG home directory: %s"), homedir); | 125 | logmsg (LOG_DEBUG, _("removing GNUPG home directory: %s"), homedir); |
126 | if (rmdir_r (homedir)) | 126 | if (rmdir_r (homedir)) |
127 | logmsg (LOG_CRIT, _("failed to remove GPG directory %s"), homedir); | 127 | logmsg (LOG_CRIT, _("failed to remove GPG directory %s"), homedir); |
128 | } | 128 | } |
129 | 129 | ||
130 | /* Create a temporary GPG home directory */ | 130 | /* Create a temporary GPG home directory */ |
131 | int | 131 | static int |
132 | wydawca_gpg_homedir () | 132 | create_gpg_homedir () |
133 | { | 133 | { |
134 | if (homedir) | 134 | if (homedir) |
135 | return 0; | 135 | return 0; |
136 | 136 | ||
137 | homedir = xstrdup ("/tmp/wydawca-XXXXXX"); | 137 | homedir = xstrdup ("/tmp/wydawca-XXXXXX"); |
138 | if (!mkdtemp (homedir)) | 138 | if (!mkdtemp (homedir)) |
@@ -219,18 +219,17 @@ gpg_verify_signature (gpgme_ctx_t ctx, gpgme_signature_t sig, | |||
219 | int | 219 | int |
220 | verify_directive_signature (struct file_triplet *trp, | 220 | verify_directive_signature (struct file_triplet *trp, |
221 | const struct spool *spool) | 221 | const struct spool *spool) |
222 | { | 222 | { |
223 | gpgme_ctx_t ctx; | 223 | gpgme_ctx_t ctx; |
224 | gpgme_data_t key_data, directive_data, plain; | 224 | gpgme_data_t key_data, directive_data, plain; |
225 | off_t size; | ||
226 | gpgme_error_t ec; | 225 | gpgme_error_t ec; |
227 | int rc; | 226 | int rc; |
228 | struct uploader_info *uptr; | 227 | struct uploader_info *uptr; |
229 | 228 | ||
230 | wydawca_gpg_homedir (); | 229 | create_gpg_homedir (); |
231 | fail_if_err (gpgme_new (&ctx)); | 230 | fail_if_err (gpgme_new (&ctx)); |
232 | 231 | ||
233 | for (uptr = trp->uploader_list; uptr; uptr = uptr->next) | 232 | for (uptr = trp->uploader_list; uptr; uptr = uptr->next) |
234 | { | 233 | { |
235 | gpgme_import_result_t res; | 234 | gpgme_import_result_t res; |
236 | gpgme_import_status_t pstat; | 235 | gpgme_import_status_t pstat; |
@@ -298,13 +297,13 @@ verify_detached_signature (struct file_triplet *trp, | |||
298 | logmsg (LOG_CRIT, | 297 | logmsg (LOG_CRIT, |
299 | _("cannot find path to gpg binary (attempting to verify " | 298 | _("cannot find path to gpg binary (attempting to verify " |
300 | "the detached signature for %s"), trp->name); | 299 | "the detached signature for %s"), trp->name); |
301 | return 1; | 300 | return 1; |
302 | } | 301 | } |
303 | 302 | ||
304 | wydawca_gpg_homedir (); | 303 | create_gpg_homedir (); |
305 | argv[0] = info->file_name; | 304 | argv[0] = info->file_name; |
306 | argv[1] = "--verify"; | 305 | argv[1] = "--verify"; |
307 | argv[2] = trp->file[file_signature].name; | 306 | argv[2] = trp->file[file_signature].name; |
308 | argv[3] = trp->file[file_dist].name; | 307 | argv[3] = trp->file[file_dist].name; |
309 | argv[4] = NULL; | 308 | argv[4] = NULL; |
310 | 309 | ||