From b2718379d74bcd031ecb6b26fc41ee32199fce0d Mon Sep 17 00:00:00 2001 From: k4be Date: Fri, 10 Sep 2021 17:02:19 +0200 Subject: [PATCH] Workaround compiler warning with openssl version below 1.1.0-pre3, --- src/modules/extjwt.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/extjwt.c b/src/modules/extjwt.c index c8de1da69..aa38753e7 100644 --- a/src/modules/extjwt.c +++ b/src/modules/extjwt.c @@ -956,8 +956,13 @@ unsigned char* extjwt_sha_pem_extjwt_hash(int method, const void *key, int keyle continue; } +#if (OPENSSL_VERSION_NUMBER < 0x10100003L) /* https://github.com/openssl/openssl/commit/8ab31975bacb9c907261088937d3aa4102e3af84 */ + if (!(bufkey = BIO_new_mem_buf((void *)key, keylen))) + break; /* out of memory */ +#else if (!(bufkey = BIO_new_mem_buf(key, keylen))) break; /* out of memory */ +#endif if (!(pkey = PEM_read_bio_PrivateKey(bufkey, NULL, NULL, NULL))) break; /* invalid key? */ pkey_type = EVP_PKEY_id(pkey);