authentication failed is supposed to be 0x63cX not 0x630X

so mask everything but the low 4 bits for remaining tries
This commit is contained in:
Klas Lindfors
2015-08-24 08:28:49 +02:00
parent 81f3b608fd
commit da29e6947c
+1 -1
View File
@@ -680,7 +680,7 @@ ykpiv_rc ykpiv_verify(ykpiv_state *state, const char *pin, int *tries) {
} else if(sw == 0x9000) { } else if(sw == 0x9000) {
return YKPIV_OK; return YKPIV_OK;
} else if((sw >> 8) == 0x63) { } else if((sw >> 8) == 0x63) {
*tries = (sw & 0xff); *tries = (sw & 0xf);
return YKPIV_WRONG_PIN; return YKPIV_WRONG_PIN;
} else if(sw == 0x6983) { } else if(sw == 0x6983) {
*tries = 0; *tries = 0;