3#include "mf_ultralight_listener.h"
4#include <lib/nfc/protocols/iso14443_3a/iso14443_3a_listener.h>
12 MfUltralightListenerAuthStateIdle,
13 MfUltralightListenerAuthStateSuccess,
14} MfUltralightListenerAuthState;
17 MfUltralightListenerAccessTypeRead,
18 MfUltralightListenerAccessTypeWrite,
19} MfUltralightListenerAccessType;
22 MfUltralightCommandNotFound,
23 MfUltralightCommandProcessed,
24 MfUltralightCommandProcessedACK,
25 MfUltralightCommandProcessedSilent,
26 MfUltralightCommandNotProcessedNAK,
27 MfUltralightCommandNotProcessedSilent,
28 MfUltralightCommandNotProcessedAuthNAK,
31typedef MfUltralightCommand (
34typedef uint8_t MfUltralightListenerCompositeCommandData;
37 MfUltralightListenerCompositeCommandData data;
38 MfUltralightListenerCommandCallback callback;
45 uint8_t mirror_last_page;
46 MfUltralightMirrorConf actual_mode;
50typedef uint16_t MfUltralightStaticLockData;
51typedef uint32_t MfUltralightDynamicLockData;
55 MfUltralightListenerAuthState auth_state;
58 MfUltralightFeatureSupport features;
60 MfUltralightStaticLockData* static_lock;
61 MfUltralightDynamicLockData* dynamic_lock;
68 bool single_counter_increased;
71 mbedtls_des3_context des_context;
72 uint8_t rndB[MF_ULTRALIGHT_C_AUTH_RND_BLOCK_SIZE];
73 uint8_t encB[MF_ULTRALIGHT_C_AUTH_RND_BLOCK_SIZE];
78void mf_ultralight_single_counter_try_to_unlock(
80 Iso14443_3aListenerEventType type);
85void mf_ultralight_mirror_read_handler(
86 uint8_t mirror_page_num,
90void mf_ultralight_composite_command_set_next(
92 const MfUltralightListenerCommandCallback handler);
98bool mf_ultralight_is_i2c_tag(MfUltralightType type);
99bool mf_ultralight_i2c_validate_pages(
108void mf_ultralight_static_lock_bytes_write(
109 MfUltralightStaticLockData*
const lock_bits,
111bool mf_ultralight_static_lock_check_page(
112 const MfUltralightStaticLockData*
const lock_bits,
115void mf_ultralight_capability_container_write(
117 const uint8_t*
const new_data);
120bool mf_ultralight_is_page_dynamic_lock(
const MfUltralightListener* instance, uint16_t start_page);
121void mf_ultralight_dynamic_lock_bytes_write(
122 MfUltralightDynamicLockData*
const lock_bits,
125bool mf_ultralight_auth_limit_check_and_update(
MfUltralightListener* instance,
bool auth_success);
126bool mf_ultralight_auth_check_password(
130bool mf_ultralight_common_check_access(
132 const uint16_t start_page,
133 const MfUltralightListenerAccessType access_type);
135bool mf_ultralight_c_check_access(
137 const uint16_t start_page,
138 const MfUltralightListenerAccessType access_type,
139 const MfUltralightListenerAuthState auth_state);
Generic Nfc stack event definitions.
NfcCommand(* NfcGenericCallback)(NfcGenericEvent event, void *context)
Generic Nfc event callback type.
Definition nfc_generic_event.h:75
Definition bit_buffer.c:7
Definition hid_profile.c:33
Definition iso14443_3a_listener_i.h:15
Definition mf_ultralight.h:127
Definition mf_ultralight.h:178
Definition mf_ultralight_listener_i.h:36
Definition mf_ultralight_listener.h:15
Definition mf_ultralight_listener.h:21
Definition mf_ultralight_listener_i.h:53
Definition mf_ultralight_listener_i.h:41
Definition mf_ultralight.h:95
Generic Nfc event type.
Definition nfc_generic_event.h:58