1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

card: Netkey improvement for passwd.

* tools/gpg-card.c (cmd_passwd) [Netkey]: No Standard/QES menu if the
card does not support it.  Print no error in cases the user canceled.
This commit is contained in:
Werner Koch 2020-11-27 09:59:19 +01:00
parent bb591222c3
commit 5804db1a13
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -2733,6 +2733,12 @@ cmd_passwd (card_info_t info, char *argstr)
menu_used = 1;
log_assert (DIM (info->chvinfo) >= 4);
/* If there is a qualified signature use a a menu to select
* between standard PIN and QES PINs. */
if (info->chvinfo[2] != -2 || info->chvinfo[3] != -2)
{
for (;;)
{
xfree (answer);
@ -2749,8 +2755,8 @@ cmd_passwd (card_info_t info, char *argstr)
break;
}
}
}
log_assert (DIM (info->chvinfo) >= 4);
if (info->chvinfo[for_qualified? 2 : 0] == -4)
{
while (!pinref)
@ -2817,6 +2823,9 @@ cmd_passwd (card_info_t info, char *argstr)
{
if (!opt.interactive && !menu_used && !opt.verbose)
;
else if (gpg_err_code (err) == GPG_ERR_CANCELED
&& gpg_err_source (err) == GPG_ERR_SOURCE_PINENTRY)
log_info ("%s\n", gpg_strerror (err));
else if (!ascii_strcasecmp (pinref, "PIV.81"))
log_error ("Error changing the PUK.\n");
else if (!ascii_strcasecmp (pinref, "OPENPGP.1") && reset_mode)