mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-17 14:07:03 +01:00
scd:p15: Add pre-check for ascii-numeric PINs.
* scd/app-p15.c (verify_pin): acii-numerix is different than BCD.
This commit is contained in:
parent
544ec7872a
commit
029924a46e
@ -5145,7 +5145,6 @@ verify_pin (app_t app,
|
||||
switch (aodf->pintype)
|
||||
{
|
||||
case PIN_TYPE_BCD:
|
||||
case PIN_TYPE_ASCII_NUMERIC:
|
||||
for (s=pinvalue; digitp (s); s++)
|
||||
;
|
||||
if (*s)
|
||||
@ -5154,6 +5153,15 @@ verify_pin (app_t app,
|
||||
err = gpg_error (GPG_ERR_BAD_PIN);
|
||||
}
|
||||
break;
|
||||
case PIN_TYPE_ASCII_NUMERIC:
|
||||
for (s=pinvalue; *s && !(*s & 0x80); s++)
|
||||
;
|
||||
if (*s)
|
||||
{
|
||||
errstr = "Non-ascii characters found in PIN";
|
||||
err = gpg_error (GPG_ERR_BAD_PIN);
|
||||
}
|
||||
break;
|
||||
case PIN_TYPE_UTF8:
|
||||
break;
|
||||
case PIN_TYPE_HALF_NIBBLE_BCD:
|
||||
|
Loading…
x
Reference in New Issue
Block a user