71 lines
2.7 KiB
Diff
71 lines
2.7 KiB
Diff
--- a/configure
|
|
+++ b/configure
|
|
@@ -7749,28 +7749,6 @@ fi
|
|
$as_echo "#define USE_SSL_DH 1" >>confdefs.h
|
|
|
|
# Generate DH parameters
|
|
- if test -f "$sslbin"; then
|
|
- echo ""
|
|
- echo "*** Generating DH Parameters for SSL/TLS ***"
|
|
- # OpenSSL 3 removes dhparam -C
|
|
- # check version and use our own parser if needed
|
|
- nagios_ssl_major_version=`$sslbin version | cut -d' ' -f2 | cut -d. -f1`
|
|
-
|
|
- test -d include || mkdir include
|
|
- if test "x$nagios_ssl_major_version" = "x3"; then
|
|
-
|
|
-cat >>confdefs.h <<_ACEOF
|
|
-#define OPENSSL_V3 1
|
|
-_ACEOF
|
|
-
|
|
- test -d src || mkdir src
|
|
- $CC ${srcdir}/src/print_c_code.c -o src/print_c_code
|
|
- $sslbin dhparam -text 2048 | ./src/print_c_code > include/dh.h
|
|
- else
|
|
- # awk to strip off meta data at bottom of dhparam output
|
|
- $sslbin dhparam -C 2048 | awk '/^-----/ {exit} {print}' > include/dh.h
|
|
- fi
|
|
- fi
|
|
fi
|
|
fi
|
|
fi
|
|
--- /dev/null
|
|
+++ b/include/dh.h
|
|
@@ -0,0 +1,36 @@
|
|
+DH *get_dh2048()
|
|
+{
|
|
+ static unsigned char dh2048_p[]={
|
|
+ 0x9F,0x5C,0x30,0xBB,0x81,0x03,0x0B,0x3D,0x51,0x58,0xA5,0x4F,0xA1,0xFD,0xFB,
|
|
+ 0x10,0xCC,0xE9,0xED,0x3C,0x5C,0xCD,0xE0,0xB4,0xD5,0xEE,0xEA,0x71,0x8D,0xA9,
|
|
+ 0x8D,0x6D,0x00,0xC4,0xB7,0x4A,0x52,0xBE,0xEE,0xDB,0x0B,0xA0,0xE0,0x04,0xCE,
|
|
+ 0x80,0x8B,0xA9,0x1B,0x83,0x0F,0x14,0x53,0x6A,0x7F,0x4B,0x1B,0x53,0xBB,0x5C,
|
|
+ 0xA0,0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[]={
|
|
+ 0x02,
|
|
+ };
|
|
+ DH *dh;
|
|
+
|
|
+ if ((dh=DH_new()) == NULL) return(NULL);
|
|
+ BIGNUM *p=BN_bin2bn(dh2048_p,sizeof(dh2048_p),NULL);
|
|
+ BIGNUM *g=BN_bin2bn(dh2048_g,sizeof(dh2048_g),NULL);
|
|
+ if ((p == NULL) || (g == NULL))
|
|
+ { DH_free(dh); return(NULL); }
|
|
+ int result = DH_set0_pqg(dh, p, NULL, g);
|
|
+ if (result == 0) { DH_free(dh); return(NULL); }
|
|
+ return(dh);
|
|
+}
|