mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-02-16 09:03:05 -05:00
OpenSSL: Fix tls_init(NULL) with FIPS-enabled build
The conf argument to tls_init() may be NULL (as it is when using hostapd), so we must check that here before dereferencing the pointer.
This commit is contained in:
parent
e0b3b3cb77
commit
cf123d7f4c
@ -667,7 +667,7 @@ void * tls_init(const struct tls_config *conf)
|
||||
if (tls_openssl_ref_count == 0) {
|
||||
#ifdef CONFIG_FIPS
|
||||
#ifdef OPENSSL_FIPS
|
||||
if (conf->fips_mode) {
|
||||
if (conf && conf->fips_mode) {
|
||||
if (!FIPS_mode_set(1)) {
|
||||
wpa_printf(MSG_ERROR, "Failed to enable FIPS "
|
||||
"mode");
|
||||
@ -678,7 +678,7 @@ void * tls_init(const struct tls_config *conf)
|
||||
wpa_printf(MSG_INFO, "Running in FIPS mode");
|
||||
}
|
||||
#else /* OPENSSL_FIPS */
|
||||
if (conf->fips_mode) {
|
||||
if (conf && conf->fips_mode) {
|
||||
wpa_printf(MSG_ERROR, "FIPS mode requested, but not "
|
||||
"supported");
|
||||
return NULL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user