Switch around some logic in ul_auth_select to make the client print the UID properly in fully read-protected cards when 'hf mfu info' is called with a key

This commit is contained in:
Lucifer Voeltner 2025-02-16 11:45:34 +07:00
commit f6b5281a5c
No known key found for this signature in database

View file

@ -669,6 +669,9 @@ static int try_default_aes_keys(bool override) {
}
static int ul_auth_select(iso14a_card_select_t *card, uint64_t tagtype, bool hasAuthKey, uint8_t *authkey, uint8_t *pack, uint8_t packSize) {
if (ul_select(card) == false) {
return PM3_ESOFT;
}
if (hasAuthKey && (tagtype & MFU_TT_UL_C)) {
//will select card automatically and close connection on error
@ -676,12 +679,7 @@ static int ul_auth_select(iso14a_card_select_t *card, uint64_t tagtype, bool has
PrintAndLogEx(WARNING, "Authentication Failed UL-C");
return PM3_ESOFT;
}
} else {
if (ul_select(card) == false) {
return PM3_ESOFT;
}
if (hasAuthKey) {
if (ulev1_requestAuthentication(authkey, pack, packSize) == PM3_EWRONGANSWER) {
DropField();