summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2018-02-17 06:56:12 +0000
committerjsing <jsing@openbsd.org>2018-02-17 06:56:12 +0000
commitb4b5f48aa5bbe02388570b6bfec3980c4eaef108 (patch)
tree08563ec0172886fdec8666786a650d11363e29f6
parentbump max line length to 16K for incoming mail. (diff)
downloadwireguard-openbsd-b4b5f48aa5bbe02388570b6bfec3980c4eaef108.tar.xz
wireguard-openbsd-b4b5f48aa5bbe02388570b6bfec3980c4eaef108.zip
Fix behaviour of OpenSSL_version().
The constant values do not map 1:1 to SSLeay_version(), so implement it separately. Issue noted by schwarze@
-rw-r--r--lib/libcrypto/cversion.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/libcrypto/cversion.c b/lib/libcrypto/cversion.c
index b8b1a22a8a8..2d4460d10d8 100644
--- a/lib/libcrypto/cversion.c
+++ b/lib/libcrypto/cversion.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cversion.c,v 1.16 2018/02/14 16:32:06 jsing Exp $ */
+/* $OpenBSD: cversion.c,v 1.17 2018/02/17 06:56:12 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -88,7 +88,21 @@ SSLeay(void)
const char *
OpenSSL_version(int t)
{
- return SSLeay_version(t);
+ switch (t) {
+ case OPENSSL_VERSION:
+ return OPENSSL_VERSION_TEXT;
+ case OPENSSL_BUILT_ON:
+ return("built on: date not available");
+ case OPENSSL_CFLAGS:
+ return("compiler: information not available");
+ case OPENSSL_PLATFORM:
+ return("platform: information not available");
+ case OPENSSL_DIR:
+ return "OPENSSLDIR: \"" OPENSSLDIR "\"";
+ case OPENSSL_ENGINES_DIR:
+ return "ENGINESDIR: N/A";
+ }
+ return("not available");
}
unsigned long