]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
libressl: fix version output
authorBernard Spil <Sp1l@users.noreply.github.com>
Mon, 19 Sep 2016 19:11:45 +0000 (21:11 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 19 Sep 2016 20:47:35 +0000 (22:47 +0200)
LibreSSL defines `OPENSSL_VERSION_NUMBER` as `0x20000000L` for all
versions returning `LibreSSL/2.0.0` for any LibreSSL version.

This change provides a local OpenSSL_version_num function replacement
returning LIBRESSL_VERSION_NUMBER instead.

Closes #1029

lib/vtls/openssl.c

index dd6f1c99c132ad91d98b66194f0e7928e1091d39..ddfc66da506e1ade632462179985200f23d389b1 100644 (file)
 #define X509_get0_notAfter(x) X509_get_notAfter(x)
 #define CONST_EXTS /* nope */
 #define CONST_ASN1_BIT_STRING /* nope */
+#ifdef LIBRESSL_VERSION_NUMBER
+static unsigned long OpenSSL_version_num(void)
+{
+  return LIBRESSL_VERSION_NUMBER;
+}
+#else
 #define OpenSSL_version_num() SSLeay()
 #endif
+#endif
 
 #if (OPENSSL_VERSION_NUMBER >= 0x1000200fL) && /* 1.0.2 or later */ \
   !defined(LIBRESSL_VERSION_NUMBER)