From 237740de9cc81023d3b05d5223f82241648ae2ac Mon Sep 17 00:00:00 2001 From: Jan Pochyla Date: Mon, 6 Nov 2017 17:47:05 +0100 Subject: [PATCH] storage: implement change_pin --- embed/extmod/modtrezorconfig/storage.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/embed/extmod/modtrezorconfig/storage.c b/embed/extmod/modtrezorconfig/storage.c index ae6901f2f..9e4d95098 100644 --- a/embed/extmod/modtrezorconfig/storage.c +++ b/embed/extmod/modtrezorconfig/storage.c @@ -211,10 +211,12 @@ secbool storage_change_pin(const uint8_t *pin, size_t len, const uint8_t *newpin // shutdown(); return secfalse; } + // TODO: check for max length + // TODO: check with fail handling if (sectrue != pin_check(pin, len)) { return secfalse; } - // TODO: change pin in storage + norcow_set(PIN_KEY, (const void *)newpin, (uint16_t)newlen); return sectrue; }