From c91e30fda49244ee89edc74acd1a9897f35e6539 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 7 Mar 2005 13:59:59 +0000 Subject: * primegen.c (is_prime): Free A2. Noted by pmike2001@mail.ru. Fixes #423. * DETAILS: Document new status codes. * cardglue.c (agent_scd_pkdecrypt, agent_scd_pksign) (agent_scd_genkey, agent_scd_setattr, agent_scd_change_pin) (agent_scd_checkpin, agent_openpgp_storekey): Make sure to send a SC_OP_FAILURE after card operations which might change data. * card-util.c (change_pin): Send a SC_OP_SUCCESS after a PIN has been changed. (change_name): Removed a debug output. * status.h, status.c: New codes BAD_PASSPHRASE_PIN, SC_OP_FAILURE and SC_OP_SUCCESS. * de.po: Updated. Translation is still in the works, though. --- g10/card-util.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'g10/card-util.c') diff --git a/g10/card-util.c b/g10/card-util.c index cbf8ec606..5c0f76b93 100644 --- a/g10/card-util.c +++ b/g10/card-util.c @@ -77,7 +77,10 @@ change_pin (int chvno, int allow_admin) if (rc) tty_printf ("Error changing the PIN: %s\n", gpg_strerror (rc)); else - tty_printf ("PIN changed.\n"); + { + write_status (STATUS_SC_OP_SUCCESS); + tty_printf ("PIN changed.\n"); + } } else for (;;) @@ -103,7 +106,10 @@ change_pin (int chvno, int allow_admin) if (rc) tty_printf ("Error changing the PIN: %s\n", gpg_strerror (rc)); else - tty_printf ("PIN changed.\n"); + { + write_status (STATUS_SC_OP_SUCCESS); + tty_printf ("PIN changed.\n"); + } } else if (*answer == '2') { @@ -111,15 +117,21 @@ change_pin (int chvno, int allow_admin) if (rc) tty_printf ("Error unblocking the PIN: %s\n", gpg_strerror (rc)); else - tty_printf ("PIN unblocked and new PIN set.\n"); - } + { + write_status (STATUS_SC_OP_SUCCESS); + tty_printf ("PIN unblocked and new PIN set.\n"); + } + } else if (*answer == '3') { rc = agent_scd_change_pin (3); if (rc) tty_printf ("Error changing the PIN: %s\n", gpg_strerror (rc)); else - tty_printf ("PIN changed.\n"); + { + write_status (STATUS_SC_OP_SUCCESS); + tty_printf ("PIN changed.\n"); + } } else if (*answer == 'q' || *answer == 'Q') { @@ -529,7 +541,6 @@ change_name (void) return -1; } - log_debug ("setting Name to `%s'\n", isoname); rc = agent_scd_setattr ("DISP-NAME", isoname, strlen (isoname) ); if (rc) log_error ("error setting Name: %s\n", gpg_strerror (rc)); -- cgit