summaryrefslogtreecommitdiff
path: root/board/cr50/tpm2/rsa.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/cr50/tpm2/rsa.c')
-rw-r--r--board/cr50/tpm2/rsa.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/board/cr50/tpm2/rsa.c b/board/cr50/tpm2/rsa.c
index 78cc3562de..97797d440a 100644
--- a/board/cr50/tpm2/rsa.c
+++ b/board/cr50/tpm2/rsa.c
@@ -397,10 +397,12 @@ CRYPT_RESULT _cpri__GenerateKeyRSA(
{
struct hmac_sha256_ctx hmac;
- HMAC_SHA256_hw_init(&hmac, seed->buffer, seed->size);
+ if (DCRYPTO_hw_hmac_sha256_init(&hmac, seed->buffer,
+ seed->size) != DCRYPTO_OK)
+ return CRYPT_FAIL;
HMAC_SHA256_update(&hmac, "RSA", 4);
- memcpy(local_seed.t.buffer, HMAC_SHA256_hw_final(&hmac),
- local_seed.t.size);
+ memcpy(local_seed.t.buffer, HMAC_SHA256_final(&hmac),
+ local_seed.t.size);
}
if (e_buf == 0)