|
|
|
@ -484,6 +484,17 @@ bool SSL_get_traffic_secrets(const SSL *ssl, |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void SSL_CTX_set_aes_hw_override_for_testing(SSL_CTX *ctx, |
|
|
|
|
bool override_value) { |
|
|
|
|
ctx->aes_hw_override = true; |
|
|
|
|
ctx->aes_hw_override_value = override_value; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void SSL_set_aes_hw_override_for_testing(SSL *ssl, bool override_value) { |
|
|
|
|
ssl->config->aes_hw_override = true; |
|
|
|
|
ssl->config->aes_hw_override_value = override_value; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
BSSL_NAMESPACE_END |
|
|
|
|
|
|
|
|
|
using namespace bssl; |
|
|
|
@ -525,7 +536,9 @@ ssl_ctx_st::ssl_ctx_st(const SSL_METHOD *ssl_method) |
|
|
|
|
false_start_allowed_without_alpn(false), |
|
|
|
|
handoff(false), |
|
|
|
|
enable_early_data(false), |
|
|
|
|
only_fips_cipher_suites_in_tls13(false) { |
|
|
|
|
only_fips_cipher_suites_in_tls13(false), |
|
|
|
|
aes_hw_override(false), |
|
|
|
|
aes_hw_override_value(false) { |
|
|
|
|
CRYPTO_MUTEX_init(&lock); |
|
|
|
|
CRYPTO_new_ex_data(&ex_data); |
|
|
|
|
} |
|
|
|
@ -647,6 +660,8 @@ SSL *SSL_new(SSL_CTX *ctx) { |
|
|
|
|
ssl->config->permute_extensions = ctx->permute_extensions; |
|
|
|
|
ssl->config->only_fips_cipher_suites_in_tls13 = |
|
|
|
|
ctx->only_fips_cipher_suites_in_tls13; |
|
|
|
|
ssl->config->aes_hw_override = ctx->aes_hw_override; |
|
|
|
|
ssl->config->aes_hw_override_value = ctx->aes_hw_override_value; |
|
|
|
|
|
|
|
|
|
if (!ssl->config->supported_group_list.CopyFrom(ctx->supported_group_list) || |
|
|
|
|
!ssl->config->alpn_client_proto_list.CopyFrom( |
|
|
|
@ -2026,18 +2041,27 @@ const char *SSL_get_cipher_list(const SSL *ssl, int n) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int SSL_CTX_set_cipher_list(SSL_CTX *ctx, const char *str) { |
|
|
|
|
return ssl_create_cipher_list(&ctx->cipher_list, str, false /* not strict */); |
|
|
|
|
const bool has_aes_hw = ctx->aes_hw_override ? ctx->aes_hw_override_value |
|
|
|
|
: EVP_has_aes_hardware(); |
|
|
|
|
return ssl_create_cipher_list(&ctx->cipher_list, has_aes_hw, str, |
|
|
|
|
false /* not strict */); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int SSL_CTX_set_strict_cipher_list(SSL_CTX *ctx, const char *str) { |
|
|
|
|
return ssl_create_cipher_list(&ctx->cipher_list, str, true /* strict */); |
|
|
|
|
const bool has_aes_hw = ctx->aes_hw_override ? ctx->aes_hw_override_value |
|
|
|
|
: EVP_has_aes_hardware(); |
|
|
|
|
return ssl_create_cipher_list(&ctx->cipher_list, has_aes_hw, str, |
|
|
|
|
true /* strict */); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int SSL_set_cipher_list(SSL *ssl, const char *str) { |
|
|
|
|
if (!ssl->config) { |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
return ssl_create_cipher_list(&ssl->config->cipher_list, str, |
|
|
|
|
const bool has_aes_hw = ssl->config->aes_hw_override |
|
|
|
|
? ssl->config->aes_hw_override_value |
|
|
|
|
: EVP_has_aes_hardware(); |
|
|
|
|
return ssl_create_cipher_list(&ssl->config->cipher_list, has_aes_hw, str, |
|
|
|
|
false /* not strict */); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -2045,7 +2069,10 @@ int SSL_set_strict_cipher_list(SSL *ssl, const char *str) { |
|
|
|
|
if (!ssl->config) { |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
return ssl_create_cipher_list(&ssl->config->cipher_list, str, |
|
|
|
|
const bool has_aes_hw = ssl->config->aes_hw_override |
|
|
|
|
? ssl->config->aes_hw_override_value |
|
|
|
|
: EVP_has_aes_hardware(); |
|
|
|
|
return ssl_create_cipher_list(&ssl->config->cipher_list, has_aes_hw, str, |
|
|
|
|
true /* strict */); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|