aboutsummaryrefslogtreecommitdiffstats
path: root/g10/cardglue.c
diff options
context:
space:
mode:
Diffstat (limited to 'g10/cardglue.c')
-rw-r--r--g10/cardglue.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/g10/cardglue.c b/g10/cardglue.c
index 1bd36b342..0cbb70336 100644
--- a/g10/cardglue.c
+++ b/g10/cardglue.c
@@ -664,7 +664,19 @@ agent_scd_pkdecrypt (const char *serialno,
int
agent_scd_change_pin (int chvno)
{
+ APP app;
+ char chvnostr[20];
+ int reset = 0;
+
+ reset = (chvno >= 100);
+ chvno %= 100;
+
+ app = current_app? current_app : open_card ();
+ if (!app)
+ return gpg_error (GPG_ERR_CARD);
- return gpg_error (GPG_ERR_CARD);
+ sprintf (chvnostr, "%d", chvno);
+ return app->fnc.change_pin (app, NULL, chvnostr, reset,
+ pin_cb, NULL);
}