From 174241c0a032e4abca8c751bed6c65f801c7ff90 Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Wed, 28 Sep 2022 11:52:48 +0200 Subject: [PATCH] Fix generating random IV on credential creation. Signed-off-by: Pol Henarejos --- src/fido/credential.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fido/credential.c b/src/fido/credential.c index 45fb794..d471378 100644 --- a/src/fido/credential.c +++ b/src/fido/credential.c @@ -90,7 +90,7 @@ int credential_create(CborCharString *rpId, CborByteString *userId, CborCharStri memset(key, 0, sizeof(key)); credential_derive_chacha_key(key); uint8_t iv[12]; - random_gen(NULL, iv, sizeof(12)); + random_gen(NULL, iv, sizeof(iv)); mbedtls_chachapoly_context chatx; mbedtls_chachapoly_init(&chatx); mbedtls_chachapoly_setkey(&chatx, key);