summaryrefslogtreecommitdiffabout
path: root/src/gpg.c
Unidiff
Diffstat (limited to 'src/gpg.c') (more/less context) (ignore whitespace changes)
-rw-r--r--src/gpg.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gpg.c b/src/gpg.c
index 474d94b..d4f9b71 100644
--- a/src/gpg.c
+++ b/src/gpg.c
@@ -129,13 +129,13 @@ remove_homedir ()
129static int 129static int
130create_gpg_homedir () 130create_gpg_homedir ()
131{ 131{
132 if (temp_homedir) 132 if (temp_homedir)
133 return 0; 133 return 0;
134 134
135 temp_homedir = xstrdup ("/tmp/wydawca-XXXXXX"); 135 temp_homedir = grecs_strdup ("/tmp/wydawca-XXXXXX");
136 if (!mkdtemp (temp_homedir)) 136 if (!mkdtemp (temp_homedir))
137 { 137 {
138 logmsg (LOG_CRIT, _("cannot create GPG home directory (%s): %s"), 138 logmsg (LOG_CRIT, _("cannot create GPG home directory (%s): %s"),
139 temp_homedir, strerror (errno)); 139 temp_homedir, strerror (errno));
140 return 1; 140 return 1;
141 } 141 }
@@ -234,13 +234,13 @@ verify_directive_signature (struct file_triplet *trp)
234 uptr->gpg_key, 234 uptr->gpg_key,
235 strlen (uptr->gpg_key), 235 strlen (uptr->gpg_key),
236 0)); 236 0));
237 fail_if_err (gpgme_op_import (ctx, key_data)); 237 fail_if_err (gpgme_op_import (ctx, key_data));
238 res = gpgme_op_import_result (ctx); 238 res = gpgme_op_import_result (ctx);
239 pstat = res->imports; 239 pstat = res->imports;
240 uptr->fpr = xstrdup (pstat->fpr); 240 uptr->fpr = grecs_strdup (pstat->fpr);
241 if (debug_level > 2) 241 if (debug_level > 2)
242 logmsg (LOG_DEBUG, _("imported key: user = %s, fingerprint = %s"), 242 logmsg (LOG_DEBUG, _("imported key: user = %s, fingerprint = %s"),
243 uptr->name, uptr->fpr); 243 uptr->name, uptr->fpr);
244 } 244 }
245 245
246 fail_if_err (gpgme_data_new_from_file (&directive_data, 246 fail_if_err (gpgme_data_new_from_file (&directive_data,
@@ -268,13 +268,14 @@ verify_directive_signature (struct file_triplet *trp)
268 logmsg (LOG_ERR, _("%s: directive verification failed: %s"), 268 logmsg (LOG_ERR, _("%s: directive verification failed: %s"),
269 trp->name, gpgme_strerror (ec)); 269 trp->name, gpgme_strerror (ec));
270 } 270 }
271 271
272 gpgme_data_release (directive_data); 272 gpgme_data_release (directive_data);
273 gpgme_data_release (key_data); 273 gpgme_data_release (key_data);
274 274 gpgme_release (ctx);
275
275 return rc; 276 return rc;
276} 277}
277 278
278/* Verify the detached signature of TRP. 279/* Verify the detached signature of TRP.
279 NOTE: It is assumed that the public key is already registered (by 280 NOTE: It is assumed that the public key is already registered (by
280 a previous call to verify_directive_signature). */ 281 a previous call to verify_directive_signature). */

Return to:

Send suggestions and report system problems to the System administrator.