From 2a08974eb4e9883a916d1837101de9b9ae00417c Mon Sep 17 00:00:00 2001 From: Mikkel Krautz Date: Sat, 6 May 2017 23:47:46 +0200 Subject: Murmur: fix warning about unused mumble_BN_GENCB_new/mumble_BN_GENCB_free. These functions are only used when the QSslDiffieHellmanParameters class is available. This commit moves the functions into an #if defined(USE_QSSLDIFFIEHELLMANPARAMETERS) block. --- src/murmur/Cert.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/murmur/Cert.cpp') diff --git a/src/murmur/Cert.cpp b/src/murmur/Cert.cpp index d8ab8776b..68f93d2ec 100644 --- a/src/murmur/Cert.cpp +++ b/src/murmur/Cert.cpp @@ -10,6 +10,21 @@ #define SSL_STRING(x) QString::fromLatin1(x).toUtf8().data() +static int add_ext(X509 * crt, int nid, char *value) { + X509_EXTENSION *ex; + X509V3_CTX ctx; + X509V3_set_ctx_nodb(&ctx); + X509V3_set_ctx(&ctx, crt, crt, NULL, NULL, 0); + ex = X509V3_EXT_conf_nid(NULL, &ctx, nid, value); + if (!ex) + return 0; + + X509_add_ext(crt, ex, -1); + X509_EXTENSION_free(ex); + return 1; +} + +#if defined(USE_QSSLDIFFIEHELLMANPARAMETERS) static BN_GENCB *mumble_BN_GENCB_new() { #if OPENSSL_VERSION >= 0x10100000L return BN_GENCB_new(); @@ -26,21 +41,6 @@ static void mumble_BN_GENCB_free(BN_GENCB *cb) { #endif } -static int add_ext(X509 * crt, int nid, char *value) { - X509_EXTENSION *ex; - X509V3_CTX ctx; - X509V3_set_ctx_nodb(&ctx); - X509V3_set_ctx(&ctx, crt, crt, NULL, NULL, 0); - ex = X509V3_EXT_conf_nid(NULL, &ctx, nid, value); - if (!ex) - return 0; - - X509_add_ext(crt, ex, -1); - X509_EXTENSION_free(ex); - return 1; -} - -#if defined(USE_QSSLDIFFIEHELLMANPARAMETERS) // dh_progress is a status callback for DH_generate_parameters_ex. // We use it to run the event loop while generating DH params, in // order to keep the Murmur GUI on Windows responsive during the -- cgit v1.2.3