Skip to content

Commit

Permalink
Fix compile issue
Browse files Browse the repository at this point in the history
  • Loading branch information
wumiaont committed Apr 8, 2024
1 parent 29f0a2f commit 2a62842
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions debian/patches/001_enable_config_fips.patch
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ index ef872c50e..783e50b23 100644
static int fips_enabled = 0;

- if (!fips_enabled && !FIPS_mode_set(1)) {
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
+ if (!fips_enabled && !EVP_default_properties_enable_fips(NULL, 1)) {
+#else
+ if (!fips_enabled && !FIPS_mode_set(1)) {
+#endif /* OpenSSL version >= 3.0 */
wpa_printf(MSG_ERROR, "Failed to enable FIPS "
"mode");
ERR_load_crypto_strings();
Expand Down
5 changes: 4 additions & 1 deletion src/crypto/tls_openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -964,8 +964,11 @@ void * tls_init(const struct tls_config *conf)
#ifdef OPENSSL_FIPS
if (conf && conf->fips_mode) {
static int fips_enabled = 0;

#if OPENSSL_VERSION_NUMBER >= 0x30000000L
if (!fips_enabled && !EVP_default_properties_enable_fips(NULL, 1)) {
#else
if (!fips_enabled && !FIPS_mode_set(1)) {
#endif /* OpenSSL version >= 3.0 */
wpa_printf(MSG_ERROR, "Failed to enable FIPS "
"mode");
ERR_load_crypto_strings();
Expand Down

0 comments on commit 2a62842

Please sign in to comment.