mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-31 11:17:29 +02:00
fix: dtls13: use aes for record numbers encryption if using aes-ccm
This commit is contained in:
@ -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) {
|
||||||
|
Reference in New Issue
Block a user