From e30a0e62313afd47df390846b3d33dc0bc2198f1 Mon Sep 17 00:00:00 2001 From: tychovrahe Date: Wed, 3 Jul 2024 16:40:12 +0200 Subject: [PATCH] fix(core): fix storage compilation for U5 models without optiga [no changelog] --- storage/storage.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/storage/storage.c b/storage/storage.c index 59b0a8e4a..1d9713c7b 100644 --- a/storage/storage.c +++ b/storage/storage.c @@ -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));