SHA256
1
0
forked from pool/openssl-1_1
openssl-1_1/openssl-fips_mode.patch

21 lines
644 B
Diff
Raw Normal View History

2020-01-24 12:52:58 +01:00
Index: openssl-1.1.1d/apps/openssl.c
===================================================================
--- openssl-1.1.1d.orig/apps/openssl.c 2019-09-10 15:13:07.000000000 +0200
+++ openssl-1.1.1d/apps/openssl.c 2020-01-23 13:45:11.452634334 +0100
@@ -151,8 +151,15 @@ int main(int argc, char *argv[])
CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
if (getenv("OPENSSL_FIPS")) {
+#ifdef OPENSSL_FIPS
+ if (!FIPS_mode_set(1)) {
+ ERR_print_errors(bio_err);
+ return 1;
+ }
+#else
BIO_printf(bio_err, "FIPS mode not supported.\n");
return 1;
+#endif
}
if (!apps_startup()) {