summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2004-10-22 11:41:56 +0200
committerWerner Koch <wk@gnupg.org>2004-10-22 11:41:56 +0200
commit9aa7d0bc353daa9728bfb69a6e775ddc82075f87 (patch)
tree20b556c54c7171aac24f345657338ca99e23cd8b
parent* logging.c (do_logv): Use set_log_stream to setup a default. (diff)
downloadgnupg2-9aa7d0bc353daa9728bfb69a6e775ddc82075f87.tar.xz
gnupg2-9aa7d0bc353daa9728bfb69a6e775ddc82075f87.zip
* app-openpgp.c (do_sign): Replace asprintf by direct allocation.
This avoids problems with missing vasprintf implementations in gnupg 1.4. * app-common.h (app_openpgp_storekey: Add prototype.
-rw-r--r--scd/ChangeLog8
-rw-r--r--scd/app-common.h7
-rw-r--r--scd/app-openpgp.c9
3 files changed, 22 insertions, 2 deletions
diff --git a/scd/ChangeLog b/scd/ChangeLog
index eba39c731..32fbdf9d9 100644
--- a/scd/ChangeLog
+++ b/scd/ChangeLog
@@ -1,3 +1,11 @@
+2004-10-21 Werner Koch <wk@g10code.com>
+
+ * app-openpgp.c (do_sign): Replace asprintf by direct allocation.
+ This avoids problems with missing vasprintf implementations in
+ gnupg 1.4.
+
+ * app-common.h (app_openpgp_storekey: Add prototype.
+
2004-10-20 Werner Koch <wk@g10code.com>
* sc-investigate: Removed.
diff --git a/scd/app-common.h b/scd/app-common.h
index f54f6da92..48bd349f4 100644
--- a/scd/app-common.h
+++ b/scd/app-common.h
@@ -88,6 +88,13 @@ struct app_ctx_s {
#if GNUPG_MAJOR_VERSION == 1
int app_select_openpgp (app_t app);
int app_get_serial_and_stamp (app_t app, char **serial, time_t *stamp);
+int app_openpgp_storekey (app_t app, int keyno,
+ unsigned char *template, size_t template_len,
+ time_t created_at,
+ const unsigned char *m, size_t mlen,
+ const unsigned char *e, size_t elen,
+ int (*pincb)(void*, const char *, char **),
+ void *pincb_arg);
#else
/*-- app-help.c --*/
gpg_error_t app_help_get_keygrip_string (ksba_cert_t cert, char *hexkeygrip);
diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c
index d6cbe88a6..f73b4f946 100644
--- a/scd/app-openpgp.c
+++ b/scd/app-openpgp.c
@@ -824,7 +824,7 @@ verify_chv3 (app_t app,
if (strlen (pinvalue) < 6)
{
- log_error (_("prassphrase (CHV%d) is too short;"
+ log_error (_("passphrase (CHV%d) is too short;"
" minimum length is %d\n"), 3, 6);
xfree (pinvalue);
return gpg_error (GPG_ERR_BAD_PIN);
@@ -1298,10 +1298,15 @@ do_sign (app_t app, const char *keyidstr, int hashalgo,
{
char *prompt;
- if (asprintf (&prompt, _("PIN [sigs done: %lu]"), sigcount) < 0)
+#define PROMPTSTRING _("PIN [sigs done: %lu]")
+
+ prompt = malloc (strlen (PROMPTSTRING) + 50);
+ if (!prompt)
return gpg_error_from_errno (errno);
+ sprintf (prompt, PROMPTSTRING, sigcount);
rc = pincb (pincb_arg, prompt, &pinvalue);
free (prompt);
+#undef PROMPTSTRING
}
if (rc)
{