Skip to content

Commit

Permalink
fix(core): fix storage compilation for U5 models without optiga
Browse files Browse the repository at this point in the history
[no changelog]
  • Loading branch information
TychoVrahe committed Jul 3, 2024
1 parent 16b89e5 commit e30a0e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions storage/storage.c
Original file line number Diff line number Diff line change
Expand Up @@ -572,9 +572,9 @@ static void stretch_pin(const uint8_t *pin, size_t pin_len,
ui_progress(PIN_PBKDF2_MS / 10);
}
#ifdef STM32U5
uint8_t stretched_pin_tmp[OPTIGA_PIN_SECRET_SIZE] = {0};
uint8_t stretched_pin_tmp[SHA256_DIGEST_LENGTH] = {0};
pbkdf2_hmac_sha256_Final(&ctx, stretched_pin_tmp);
ensure(secure_aes_ecb_encrypt_hw(stretched_pin_tmp, OPTIGA_PIN_SECRET_SIZE,
ensure(secure_aes_ecb_encrypt_hw(stretched_pin_tmp, SHA256_DIGEST_LENGTH,
stretched_pin, SECURE_AES_KEY_XORK),
"secure_aes pin stretch failed");
memzero(stretched_pin_tmp, sizeof(stretched_pin_tmp));
Expand Down

0 comments on commit e30a0e6

Please sign in to comment.