mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-01 11:44:38 +02:00
Merge pull request #2267 from ejohnstown/aesgcm-selftest
NetBSD Selftest, TLSv1.3, and wolfCrypt v4
This commit is contained in:
14
src/tls13.c
14
src/tls13.c
@@ -1696,6 +1696,12 @@ static int EncryptTls13(WOLFSSL* ssl, byte* output, const byte* input,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
nonceSz = AESGCM_NONCE_SZ;
|
nonceSz = AESGCM_NONCE_SZ;
|
||||||
|
#if ((defined(HAVE_FIPS) || defined(HAVE_SELFTEST)) && \
|
||||||
|
(!defined(HAVE_FIPS_VERSION) || (HAVE_FIPS_VERSION < 2)))
|
||||||
|
ret = wc_AesGcmEncrypt(ssl->encrypt.aes, output, input,
|
||||||
|
dataSz, ssl->encrypt.nonce, nonceSz,
|
||||||
|
output + dataSz, macSz, aad, aadSz);
|
||||||
|
#else
|
||||||
ret = wc_AesGcmSetExtIV(ssl->encrypt.aes,
|
ret = wc_AesGcmSetExtIV(ssl->encrypt.aes,
|
||||||
ssl->encrypt.nonce, nonceSz);
|
ssl->encrypt.nonce, nonceSz);
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
@@ -1703,6 +1709,7 @@ static int EncryptTls13(WOLFSSL* ssl, byte* output, const byte* input,
|
|||||||
input, dataSz, ssl->encrypt.nonce, nonceSz,
|
input, dataSz, ssl->encrypt.nonce, nonceSz,
|
||||||
output + dataSz, macSz, aad, aadSz);
|
output + dataSz, macSz, aad, aadSz);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1717,6 +1724,12 @@ static int EncryptTls13(WOLFSSL* ssl, byte* output, const byte* input,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
nonceSz = AESCCM_NONCE_SZ;
|
nonceSz = AESCCM_NONCE_SZ;
|
||||||
|
#if ((defined(HAVE_FIPS) || defined(HAVE_SELFTEST)) && \
|
||||||
|
(!defined(HAVE_FIPS_VERSION) || (HAVE_FIPS_VERSION < 2)))
|
||||||
|
ret = wc_AesCcmEncrypt(ssl->encrypt.aes, output, input,
|
||||||
|
dataSz, ssl->encrypt.nonce, nonceSz,
|
||||||
|
output + dataSz, macSz, aad, aadSz);
|
||||||
|
#else
|
||||||
ret = wc_AesCcmSetNonce(ssl->encrypt.aes,
|
ret = wc_AesCcmSetNonce(ssl->encrypt.aes,
|
||||||
ssl->encrypt.nonce, nonceSz);
|
ssl->encrypt.nonce, nonceSz);
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
@@ -1724,6 +1737,7 @@ static int EncryptTls13(WOLFSSL* ssl, byte* output, const byte* input,
|
|||||||
input, dataSz, ssl->encrypt.nonce, nonceSz,
|
input, dataSz, ssl->encrypt.nonce, nonceSz,
|
||||||
output + dataSz, macSz, aad, aadSz);
|
output + dataSz, macSz, aad, aadSz);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user