Improve pinpad use detection
Pinpad is used it it is present and if no pin string is provided (pinlen==0). Signed-off-by: Nuno Goncalves <nunojpg@gmail.com>
This commit is contained in:
parent
c6a9201b62
commit
ccc7e2f109
|
@ -268,7 +268,7 @@ _validate_pin(struct sc_pkcs15_card *p15card, struct sc_pkcs15_auth_info *auth_i
|
||||||
return SC_ERROR_BUFFER_TOO_SMALL;
|
return SC_ERROR_BUFFER_TOO_SMALL;
|
||||||
|
|
||||||
/* if we use pinpad, no more checks are needed */
|
/* if we use pinpad, no more checks are needed */
|
||||||
if (p15card->card->reader->capabilities & SC_READER_CAP_PIN_PAD)
|
if (p15card->card->reader->capabilities & SC_READER_CAP_PIN_PAD && !pinlen)
|
||||||
return SC_SUCCESS;
|
return SC_SUCCESS;
|
||||||
|
|
||||||
/* If pin is given, make sure it is within limits */
|
/* If pin is given, make sure it is within limits */
|
||||||
|
@ -371,8 +371,7 @@ _sc_pkcs15_verify_pin(struct sc_pkcs15_card *p15card, struct sc_pkcs15_object *p
|
||||||
data.pin_reference = skey_info->key_reference;
|
data.pin_reference = skey_info->key_reference;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(p15card->card->reader->capabilities & SC_READER_CAP_PIN_PAD) {
|
if(p15card->card->reader->capabilities & SC_READER_CAP_PIN_PAD && !pinlen) {
|
||||||
if (!pincode && !pinlen)
|
|
||||||
data.flags |= SC_PIN_CMD_USE_PINPAD;
|
data.flags |= SC_PIN_CMD_USE_PINPAD;
|
||||||
|
|
||||||
if (auth_info->attrs.pin.flags & SC_PKCS15_PIN_FLAG_SO_PIN)
|
if (auth_info->attrs.pin.flags & SC_PKCS15_PIN_FLAG_SO_PIN)
|
||||||
|
|
Loading…
Reference in New Issue