1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-23 06:48:16 +00:00
trezor-firmware/embed/extmod/modtrezorconfig/storage.h
Jochen Hoenicke 87f7054e46 Added callback for PIN timeout
When PIN is entered or changed and their were failed tries the function
waits for time (exponential slow down).  For every second it waits, it
now calls back into python to give it the chance to show a message.

GUI still needs to be implemented
2017-12-14 17:19:51 +01:00

21 lines
675 B
C

/*
* Copyright (c) Pavol Rusnak, Jan Pochyla, SatoshiLabs
*
* Licensed under TREZOR License
* see LICENSE file for details
*/
#include <stdint.h>
#include <stddef.h>
#include "../../trezorhal/secbool.h"
#include "py/obj.h"
void storage_init(void);
void storage_wipe(void);
secbool storage_unlock(const uint8_t *pin, size_t len, mp_obj_t callback);
secbool storage_has_pin(void);
uint32_t storage_pin_wait_time(void);
secbool storage_change_pin(const uint8_t *pin, size_t len, const uint8_t *newpin, size_t newlen, mp_obj_t callback);
secbool storage_get(uint16_t key, const void **val, uint16_t *len);
secbool storage_set(uint16_t key, const void *val, uint16_t len);