1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-06-02 06:08:46 +00:00

modtrezorconfig: fix wipe error

This commit is contained in:
Pavol Rusnak 2017-12-14 16:27:18 +01:00
parent 44196be481
commit b7444ac13e
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
2 changed files with 2 additions and 4 deletions

View File

@ -107,9 +107,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_3(mod_trezorconfig_set_obj, mod_trezorconfig_set)
/// Erases the whole config. Use with caution! /// Erases the whole config. Use with caution!
/// ''' /// '''
STATIC mp_obj_t mod_trezorconfig_wipe(void) { STATIC mp_obj_t mod_trezorconfig_wipe(void) {
if (sectrue != storage_wipe()) { storage_wipe();
mp_raise_msg(&mp_type_RuntimeError, "Could not wipe storage");
}
return mp_const_none; return mp_const_none;
} }
STATIC MP_DEFINE_CONST_FUN_OBJ_0(mod_trezorconfig_wipe_obj, mod_trezorconfig_wipe); STATIC MP_DEFINE_CONST_FUN_OBJ_0(mod_trezorconfig_wipe_obj, mod_trezorconfig_wipe);

View File

@ -10,7 +10,7 @@
#include "../../trezorhal/secbool.h" #include "../../trezorhal/secbool.h"
void storage_init(void); void storage_init(void);
secbool storage_wipe(void); void storage_wipe(void);
secbool storage_unlock(const uint8_t *pin, size_t len); secbool storage_unlock(const uint8_t *pin, size_t len);
secbool storage_has_pin(void); secbool storage_has_pin(void);
secbool storage_change_pin(const uint8_t *pin, size_t len, const uint8_t *newpin, size_t newlen); secbool storage_change_pin(const uint8_t *pin, size_t len, const uint8_t *newpin, size_t newlen);