forked from wolfSSL/wolfssl
Maintenance: DTLS
When encrypting with AES-GCM, AES-CCM, or PolyChacha, do not increment the DTLS sequence number. The sequence number should only be incremented in BuildMessage. This was done because the sequence number used to be incremented after calculating the HMAC or after the encrypt for AEAD ciphers. The HMAC has been separated from the sequence increment.
This commit is contained in:
@ -12529,7 +12529,6 @@ static int ChachaAEADEncrypt(WOLFSSL* ssl, byte* out, const byte* input,
|
||||
#ifdef WOLFSSL_DTLS
|
||||
if (ssl->options.dtls) {
|
||||
additionalSrc -= DTLS_HANDSHAKE_EXTRA;
|
||||
DtlsSEQIncrement(ssl, CUR_ORDER);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -13069,11 +13068,6 @@ static WC_INLINE int Encrypt(WOLFSSL* ssl, byte* out, const byte* input, word16
|
||||
#endif
|
||||
if (ssl->encrypt.nonce)
|
||||
ForceZero(ssl->encrypt.nonce, AESGCM_NONCE_SZ);
|
||||
|
||||
#ifdef WOLFSSL_DTLS
|
||||
if (ssl->options.dtls)
|
||||
DtlsSEQIncrement(ssl, CUR_ORDER);
|
||||
#endif
|
||||
}
|
||||
#endif /* BUILD_AESGCM || HAVE_AESCCM */
|
||||
break;
|
||||
|
Reference in New Issue
Block a user