From 66d82ea5e45f027ad127dc737e391a0c32be00d7 Mon Sep 17 00:00:00 2001 From: eroen Date: Mon, 9 Jan 2017 01:17:29 +0100 Subject: [PATCH] Fix building against openssl 1.1.0 without compat modes This lets us use openssl 1.1.0 built with `--api=1.1 disable-deprecated`. - Don't call deprecated initialization functions - Use new DSA_generate_parameters_ex X-Gentoo-Bug: 605134 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=605134 --- DSA.xs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/DSA.xs b/DSA.xs index b24184f..70db0b8 100644 --- a/DSA.xs +++ b/DSA.xs @@ -13,6 +13,7 @@ extern "C" { #include #include #include +#include #ifdef __cplusplus } @@ -112,7 +113,9 @@ MODULE = Crypt::OpenSSL::DSA PACKAGE = Crypt::OpenSSL::DSA PROTOTYPES: DISABLE BOOT: +#if OPENSSL_VERSION_NUMBER < 0x10100000L ERR_load_crypto_strings(); +#endif DSA * new(CLASS) @@ -142,8 +145,13 @@ generate_parameters(CLASS, bits, seed = NULL) if (seed) { seedpv = SvPV(seed, seed_len); } +#if OPENSSL_VERSION_NUMBER < 0x10100000L dsa = DSA_generate_parameters(bits, seedpv, (int)seed_len, NULL, NULL, NULL, NULL); if (!dsa) { +#else + dsa = DSA_new(); + if (!DSA_generate_parameters_ex(dsa, bits, seedpv, (int)seed_len, NULL, NULL, NULL)) { +#endif err = ERR_get_error(); if (err == 0) { croak("DSA_generate_parameters() returned NULL"); -- 2.11.0