aboutsummaryrefslogtreecommitdiffstats
path: root/scd/app-openpgp.c
diff options
context:
space:
mode:
Diffstat (limited to 'scd/app-openpgp.c')
-rw-r--r--scd/app-openpgp.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c
index 6b4a2f7ef..8f9a303fe 100644
--- a/scd/app-openpgp.c
+++ b/scd/app-openpgp.c
@@ -534,6 +534,13 @@ verify_chv2 (APP app,
return rc;
}
+ if (strlen (pinvalue) < 6)
+ {
+ log_error ("prassphrase (CHV2) is too short; minimum length is 6\n");
+ xfree (pinvalue);
+ return gpg_error (GPG_ERR_BAD_PIN);
+ }
+
rc = iso7816_verify (app->slot, 0x82, pinvalue, strlen (pinvalue));
if (rc)
{
@@ -586,6 +593,13 @@ verify_chv3 (APP app,
return rc;
}
+ if (strlen (pinvalue) < 6)
+ {
+ log_error ("prassphrase (CHV3) is too short; minimum length is 6\n");
+ xfree (pinvalue);
+ return gpg_error (GPG_ERR_BAD_PIN);
+ }
+
rc = iso7816_verify (app->slot, 0x83, pinvalue, strlen (pinvalue));
xfree (pinvalue);
if (rc)
@@ -1041,6 +1055,13 @@ do_sign (APP app, const char *keyidstr, int hashalgo,
return rc;
}
+ if (strlen (pinvalue) < 6)
+ {
+ log_error ("prassphrase (CHV1) is too short; minimum length is 6\n");
+ xfree (pinvalue);
+ return gpg_error (GPG_ERR_BAD_PIN);
+ }
+
rc = iso7816_verify (app->slot, 0x81, pinvalue, strlen (pinvalue));
if (rc)
{