Fix generating random IV on credential creation.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2022-09-28 11:52:48 +02:00
parent fa17d5c906
commit 174241c0a0

View File

@@ -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);