1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-18 04:18:10 +00:00

fix(legacy): Clear CoSi nonce when device is wiped to fix CI.

[no changelog]
This commit is contained in:
Andrew Kozlik 2022-09-06 16:05:39 +02:00 committed by Andrew Kozlik
parent 7ba7eff118
commit d96d3e705b
3 changed files with 9 additions and 1 deletions

View File

@ -976,6 +976,8 @@ void config_wipe(void) {
storage_set(KEY_UUID, config_uuid, sizeof(config_uuid)); storage_set(KEY_UUID, config_uuid, sizeof(config_uuid));
storage_set(KEY_VERSION, &CONFIG_VERSION, sizeof(CONFIG_VERSION)); storage_set(KEY_VERSION, &CONFIG_VERSION, sizeof(CONFIG_VERSION));
session_clear(false); session_clear(false);
fsm_abortWorkflows();
fsm_clearCosiNonce();
#if USE_BIP32_CACHE #if USE_BIP32_CACHE
bip32_cache_clear(); bip32_cache_clear();

View File

@ -87,6 +87,7 @@ void fsm_msgSignIdentity(const SignIdentity *msg);
void fsm_msgGetECDHSessionKey(const GetECDHSessionKey *msg); void fsm_msgGetECDHSessionKey(const GetECDHSessionKey *msg);
void fsm_msgCosiCommit(const CosiCommit *msg); void fsm_msgCosiCommit(const CosiCommit *msg);
void fsm_msgCosiSign(const CosiSign *msg); void fsm_msgCosiSign(const CosiSign *msg);
void fsm_clearCosiNonce(void);
// debug // debug
#if DEBUG_LINK #if DEBUG_LINK

View File

@ -334,6 +334,11 @@ void fsm_msgCosiSign(const CosiSign *msg) {
} else { } else {
fsm_sendFailure(FailureType_Failure_FirmwareError, NULL); fsm_sendFailure(FailureType_Failure_FirmwareError, NULL);
} }
memzero(cosi_nonce, sizeof(cosi_nonce)); fsm_clearCosiNonce();
layoutHome(); layoutHome();
} }
void fsm_clearCosiNonce(void) {
cosi_nonce_is_set = false;
memzero(cosi_nonce, sizeof(cosi_nonce));
}