fix: dtls13: use aes for record numbers encryption if using aes-ccm

This commit is contained in:
Marco Oliverio
2022-07-20 14:51:49 +02:00
parent 066f17faad
commit 3850e6b554

View File

@ -269,14 +269,15 @@ static int Dtls13GetRnMask(WOLFSSL* ssl, const byte* ciphertext, byte* mask,
else else
c = &ssl->dtlsRecordNumberDecrypt; c = &ssl->dtlsRecordNumberDecrypt;
#ifdef HAVE_AESGCM #if defined(HAVE_AESGCM) || defined(HAVE_AESCCM)
if (ssl->specs.bulk_cipher_algorithm == wolfssl_aes_gcm) { if (ssl->specs.bulk_cipher_algorithm == wolfssl_aes_gcm ||
ssl->specs.bulk_cipher_algorithm == wolfssl_aes_ccm) {
if (c->aes == NULL) if (c->aes == NULL)
return BAD_STATE_E; return BAD_STATE_E;
return wc_AesEncryptDirect(c->aes, mask, ciphertext); return wc_AesEncryptDirect(c->aes, mask, ciphertext);
} }
#endif /* HAVE_AESGCM */ #endif /* HAVE_AESGCM || HAVE_AESCCM */
#ifdef HAVE_CHACHA #ifdef HAVE_CHACHA
if (ssl->specs.bulk_cipher_algorithm == wolfssl_chacha) { if (ssl->specs.bulk_cipher_algorithm == wolfssl_chacha) {