[PATCH] Don't provide implementation of DES/RC4 if CONFIG_FIPS

Norman Hamer NHamer at absolute.com
Fri Oct 14 11:37:34 PDT 2022


Don't provide implementation of DES/RC4 if CONFIG_FIPS

Signed-off-by: Norman Hamer <nhamer at absolute.com>
---
 src/crypto/crypto_openssl.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/crypto/crypto_openssl.c b/src/crypto/crypto_openssl.c
index 700638761..fc85c2c90 100644
--- a/src/crypto/crypto_openssl.c
+++ b/src/crypto/crypto_openssl.c
@@ -321,6 +321,7 @@ int md4_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac)
 #endif /* CONFIG_FIPS */
 
 
+#ifndef CONFIG_FIPS
 int des_encrypt(const u8 *clear, const u8 *key, u8 *cypher)
 {
 	u8 pkey[8], next, tmp;
@@ -352,8 +353,10 @@ int des_encrypt(const u8 *clear, const u8 *key, u8 *cypher)
 		EVP_CIPHER_CTX_free(ctx);
 	return ret;
 }
+#endif /* CONFIG_FIPS */
 
 
+#ifndef CONFIG_FIPS
 #ifndef CONFIG_NO_RC4
 int rc4_skip(const u8 *key, size_t keylen, size_t skip,
 	     u8 *data, size_t data_len)
@@ -395,7 +398,7 @@ out:
 #endif /* OPENSSL_NO_RC4 */
 }
 #endif /* CONFIG_NO_RC4 */
-
+#endif /* CONFIG_FIPS */
 
 #ifndef CONFIG_FIPS
 int md5_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac)
-- 
2.28.0.windows.1




More information about the Hostap mailing list