summaryrefslogtreecommitdiffstats
path: root/scd/app-openpgp.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2017-03-06 07:14:18 +0100
committerNIIBE Yutaka <gniibe@fsij.org>2017-03-06 07:14:18 +0100
commite6ca015ae182a6dbb0466441efc17c99683e9375 (patch)
treec27ca46c5fd4ee452425289186ae580097f8625b /scd/app-openpgp.c
parentscd: More cleanup of old code. (diff)
downloadgnupg2-e6ca015ae182a6dbb0466441efc17c99683e9375.tar.xz
gnupg2-e6ca015ae182a6dbb0466441efc17c99683e9375.zip
scd: Fix compiler warnings for app-openpgp.c.
* scd/app-openpgp.c (retrieve_key_material): Remove touching I. (do_change_pin): Make sure going to leave if PINVALUE == 0. (rsa_writekey): Emit simpler log. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'scd/app-openpgp.c')
-rw-r--r--scd/app-openpgp.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c
index 5e75d4bdd..af81dce65 100644
--- a/scd/app-openpgp.c
+++ b/scd/app-openpgp.c
@@ -1280,7 +1280,6 @@ retrieve_key_material (FILE *fp, const char *hexkeyid,
if ( strcmp (fields[0], "pkd") )
continue; /* Not a key data record. */
- i = 0; /* Avoid erroneous compiler warning. */
if ( nfields < 4 || (i = atoi (fields[1])) < 0 || i > 1
|| (!i && m_new) || (i && e_new))
{
@@ -2652,7 +2651,7 @@ do_change_pin (app_t app, ctrl_t ctrl, const char *chvnostr,
rc = pincb (pincb_arg, set_resetcode? _("|RN|New Reset Code") :
chvno == 3? _("|AN|New Admin PIN") : _("|N|New PIN"),
&pinvalue);
- if (rc)
+ if (rc || pinvalue == NULL)
{
log_error (_("error getting new PIN: %s\n"), gpg_strerror (rc));
goto leave;
@@ -3352,8 +3351,7 @@ rsa_writekey (app_t app, gpg_error_t (*pincb)(void*, const char *, char **),
maxbits = app->app_local->keyattr[keyno].rsa.n_bits;
nbits = rsa_n? count_bits (rsa_n, rsa_n_len) : 0;
if (opt.verbose)
- log_info ("RSA modulus size is %u bits (%u bytes)\n",
- nbits, (unsigned int)rsa_n_len);
+ log_info ("RSA modulus size is %u bits\n", nbits);
if (nbits && nbits != maxbits
&& app->app_local->extcap.algo_attr_change)
{