11 bool start()
override;
13 void onTick(uint32_t nowMs)
override;
15 const char*
getVersion()
const override {
return "1.0"; }
25 size_t clen, uint8_t* out)
override;
27 uint8_t* out,
bool* touchRequiredOut)
override;
void mod_2fa_register()
Registers 2FA module initializer in the global module registry.
Challenge-response provider interface.
Base implementation that handles common module lifecycle boilerplate.
ModuleBase(const char *name)
Constructs a module base with the given module name.
const char * getVersion() const override
Returns the module version string.
bool exportBackup(cJSON *out) override
Exports all stored OATH entries into the module's backup section.
uint8_t getMenuItems(core::ModuleMenuItem *items, uint8_t maxItems) override
Provides main-menu entry for the 2FA module.
static TwoFaModule & instance()
Returns singleton 2FA module instance.
void stop() override
Stops the 2FA module and releases list buffers.
core::IModule::BackupResult importBackup(const cJSON *in) override
Restores OATH entries from the module's backup section.
int challengeResponseUsbSlot(const uint8_t *challenge, size_t clen, uint8_t *out, bool *touchRequiredOut) override
Computes the raw HMAC response for the designated USB-CR slot entry.
bool init() override
Initializes module resources, translations, commands, and slot mapping.
void setSlotRange(const core::IModule::SlotRange &range) override
Stores assigned Tropic slot range for the module.
int challengeResponse(const char *entryName, const uint8_t *challenge, size_t clen, uint8_t *out) override
Computes the raw HMAC challenge-response for a named CR entry.
core::IModule::SlotRequest getSlotRequest() const override
Declares minimum slot requirements for the 2FA module.
void onTick(uint32_t nowMs) override
Forwards the BLE CR state machine on the main task.
bool start() override
Starts the 2FA module service.
Per-module restore outcome reported by importBackup().