mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-29 04:09:58 -07:00
nfc: Attempt to authenticate with default PWD when possible when reading NTAG
This commit is contained in:
@@ -756,6 +756,23 @@ bool mf_ul_read_card(
|
||||
mf_ultralight_read_tearing_flags(tx_rx, data);
|
||||
}
|
||||
data->curr_authlim = 0;
|
||||
|
||||
if(reader->pages_read == reader->pages_to_read &&
|
||||
reader->supported_features & MfUltralightSupportAuth) {
|
||||
MfUltralightConfigPages* config = mf_ultralight_get_config_pages(data);
|
||||
if(config->access.authlim == 0) {
|
||||
// Attempt to auth with default PWD
|
||||
uint16_t pack;
|
||||
data->auth_success = mf_ultralight_authenticate(tx_rx, MF_UL_DEFAULT_PWD, &pack);
|
||||
if(data->auth_success) {
|
||||
config->auth_data.pwd.value = MF_UL_DEFAULT_PWD;
|
||||
config->auth_data.pack.value = pack;
|
||||
} else {
|
||||
furi_hal_nfc_sleep();
|
||||
furi_hal_nfc_activate_nfca(300, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(reader->pages_read != reader->pages_to_read) {
|
||||
|
||||
@@ -28,6 +28,8 @@
|
||||
|
||||
#define MF_UL_NTAG203_COUNTER_PAGE (41)
|
||||
|
||||
#define MF_UL_DEFAULT_PWD (0xFFFFFFFF)
|
||||
|
||||
typedef enum {
|
||||
MfUltralightAuthMethodManual,
|
||||
MfUltralightAuthMethodAmeebo,
|
||||
|
||||
Reference in New Issue
Block a user