better txrx error handling

This commit is contained in:
Michele Balistreri 2024-02-06 10:40:35 +01:00
parent 7dc6803026
commit 48085ce635
No known key found for this signature in database
GPG Key ID: E9567DA33A4F791A
1 changed files with 5 additions and 4 deletions

View File

@ -367,12 +367,13 @@ static app_err_t keycard_setup(keycard_t* kc, uint8_t* pin, uint8_t* cached_pin)
err = securechannel_open(&kc->ch, &kc->sc, &kc->apdu, &pairing, info.sc_key);
if (err != ERR_OK) {
if (err == ERR_CRYPTO) {
if (err != ERR_TXRX) {
pairing_erase(&pairing);
ui_keycard_secure_channel_failed();
return ERR_RETRY;
} else {
return ERR_TXRX;
}
ui_keycard_secure_channel_failed();
return ERR_RETRY;
}
ui_keycard_secure_channel_ok();