mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-31 03:07:29 +02:00
Check for WOLFSSL_AEAD_ONLY in wolfSSL_dtls_import_internal
This commit is contained in:
@ -1539,25 +1539,26 @@ int wolfSSL_dtls_import_internal(WOLFSSL* ssl, byte* buf, word32 sz)
|
|||||||
idx += ret;
|
idx += ret;
|
||||||
|
|
||||||
SetKeysSide(ssl, ENCRYPT_AND_DECRYPT_SIDE);
|
SetKeysSide(ssl, ENCRYPT_AND_DECRYPT_SIDE);
|
||||||
|
|
||||||
/* set hmac function to use when verifying */
|
|
||||||
if (ssl->options.tls == 1 || ssl->options.tls1_1 == 1 ||
|
|
||||||
ssl->options.dtls == 1) {
|
|
||||||
ssl->hmac = TLS_hmac;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* make sure is a valid suite used */
|
/* make sure is a valid suite used */
|
||||||
if (wolfSSL_get_cipher(ssl) == NULL) {
|
if (wolfSSL_get_cipher(ssl) == NULL) {
|
||||||
WOLFSSL_MSG("Can not match cipher suite imported");
|
WOLFSSL_MSG("Can not match cipher suite imported");
|
||||||
return MATCH_SUITE_ERROR;
|
return MATCH_SUITE_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef WOLFSSL_AEAD_ONLY
|
||||||
|
/* set hmac function to use when verifying */
|
||||||
|
if (ssl->options.tls == 1 || ssl->options.tls1_1 == 1 ||
|
||||||
|
ssl->options.dtls == 1) {
|
||||||
|
ssl->hmac = TLS_hmac;
|
||||||
|
}
|
||||||
|
|
||||||
/* do not allow stream ciphers with DTLS, except for NULL cipher */
|
/* do not allow stream ciphers with DTLS, except for NULL cipher */
|
||||||
if (ssl->specs.cipher_type == stream &&
|
if (ssl->specs.cipher_type == stream &&
|
||||||
ssl->specs.bulk_cipher_algorithm != wolfssl_cipher_null) {
|
ssl->specs.bulk_cipher_algorithm != wolfssl_cipher_null) {
|
||||||
WOLFSSL_MSG("Can not import stream ciphers for DTLS");
|
WOLFSSL_MSG("Can not import stream ciphers for DTLS");
|
||||||
return SANITY_CIPHER_E;
|
return SANITY_CIPHER_E;
|
||||||
}
|
}
|
||||||
|
#endif /* !WOLFSSL_AEAD_ONLY */
|
||||||
|
|
||||||
return idx;
|
return idx;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user