cardos,incrypto34: restored semantics of select_pin_reference

This commit is contained in:
Frank Morgner 2014-03-03 08:05:10 +01:00 committed by Viktor Tarasov
parent 511c8e6382
commit e1fd9d2a4c
2 changed files with 4 additions and 0 deletions

View File

@ -165,6 +165,8 @@ cardos_select_pin_reference(sc_profile_t *profile, sc_pkcs15_card_t *p15card,
if (auth_info->attrs.pin.flags & SC_PKCS15_PIN_FLAG_SO_PIN) {
preferred = 1;
if (current > preferred)
return SC_ERROR_TOO_MANY_OBJECTS;
} else {
preferred = current;
/* PINs are even numbered, PUKs are odd */

View File

@ -184,6 +184,8 @@ incrypto34_select_pin_reference(sc_profile_t *profile, sc_pkcs15_card_t *p15card
if (auth_info->attrs.pin.flags & SC_PKCS15_PIN_FLAG_SO_PIN) {
preferred = 1;
if (current > preferred)
return SC_ERROR_TOO_MANY_OBJECTS;
} else {
preferred = current;
/* PINs are even numbered, PUKs are odd */