summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorjsing <>2014-07-11 11:42:28 +0000
committerjsing <>2014-07-11 11:42:28 +0000
commitf36d7ba067d0df92de3ecd6d19b8abb4449c7aba (patch)
tree9cfe65ff928ea5b896de67130246ec607d529a88 /src/lib
parent9a73308eb3704559445dd94ce1c0af13370b49be (diff)
downloadopenbsd-f36d7ba067d0df92de3ecd6d19b8abb4449c7aba.tar.gz
openbsd-f36d7ba067d0df92de3ecd6d19b8abb4449c7aba.tar.bz2
openbsd-f36d7ba067d0df92de3ecd6d19b8abb4449c7aba.zip
Clean up versioning and remove #ifdefs that we do not define.
ok beck@
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/cversion.c43
-rw-r--r--src/lib/libssl/src/crypto/cversion.c43
2 files changed, 18 insertions, 68 deletions
diff --git a/src/lib/libcrypto/cversion.c b/src/lib/libcrypto/cversion.c
index e9f40c24cf..7ffa80ec26 100644
--- a/src/lib/libcrypto/cversion.c
+++ b/src/lib/libcrypto/cversion.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cversion.c,v 1.14 2014/07/11 08:44:47 jsing Exp $ */ 1/* $OpenBSD: cversion.c,v 1.15 2014/07/11 11:42:28 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -59,47 +59,22 @@
59#include <openssl/crypto.h> 59#include <openssl/crypto.h>
60#include <openssl/opensslv.h> 60#include <openssl/opensslv.h>
61 61
62#include "cryptlib.h"
63
62const char * 64const char *
63SSLeay_version(int t) 65SSLeay_version(int t)
64{ 66{
65 if (t == SSLEAY_VERSION) 67 switch (t) {
68 case SSLEAY_VERSION:
66 return OPENSSL_VERSION_TEXT; 69 return OPENSSL_VERSION_TEXT;
67 if (t == SSLEAY_BUILT_ON) { 70 case SSLEAY_BUILT_ON:
68#ifdef DATE
69 static char buf[sizeof(DATE) + 11];
70
71 snprintf(buf, sizeof buf, "built on: %s", DATE);
72 return (buf);
73#else
74 return("built on: date not available"); 71 return("built on: date not available");
75#endif 72 case SSLEAY_CFLAGS:
76 }
77 if (t == SSLEAY_CFLAGS) {
78#ifdef CFLAGS
79 static char buf[sizeof(CFLAGS) + 11];
80
81 snprintf(buf, sizeof buf, "compiler: %s", CFLAGS);
82 return (buf);
83#else
84 return("compiler: information not available"); 73 return("compiler: information not available");
85#endif 74 case SSLEAY_PLATFORM:
86 }
87 if (t == SSLEAY_PLATFORM) {
88#ifdef PLATFORM
89 static char buf[sizeof(PLATFORM) + 11];
90
91 snprintf(buf, sizeof buf, "platform: %s", PLATFORM);
92 return (buf);
93#else
94 return("platform: information not available"); 75 return("platform: information not available");
95#endif 76 case SSLEAY_DIR:
96 }
97 if (t == SSLEAY_DIR) {
98#ifdef OPENSSLDIR
99 return "OPENSSLDIR: \"" OPENSSLDIR "\""; 77 return "OPENSSLDIR: \"" OPENSSLDIR "\"";
100#else
101 return "OPENSSLDIR: N/A";
102#endif
103 } 78 }
104 return("not available"); 79 return("not available");
105} 80}
diff --git a/src/lib/libssl/src/crypto/cversion.c b/src/lib/libssl/src/crypto/cversion.c
index e9f40c24cf..7ffa80ec26 100644
--- a/src/lib/libssl/src/crypto/cversion.c
+++ b/src/lib/libssl/src/crypto/cversion.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cversion.c,v 1.14 2014/07/11 08:44:47 jsing Exp $ */ 1/* $OpenBSD: cversion.c,v 1.15 2014/07/11 11:42:28 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -59,47 +59,22 @@
59#include <openssl/crypto.h> 59#include <openssl/crypto.h>
60#include <openssl/opensslv.h> 60#include <openssl/opensslv.h>
61 61
62#include "cryptlib.h"
63
62const char * 64const char *
63SSLeay_version(int t) 65SSLeay_version(int t)
64{ 66{
65 if (t == SSLEAY_VERSION) 67 switch (t) {
68 case SSLEAY_VERSION:
66 return OPENSSL_VERSION_TEXT; 69 return OPENSSL_VERSION_TEXT;
67 if (t == SSLEAY_BUILT_ON) { 70 case SSLEAY_BUILT_ON:
68#ifdef DATE
69 static char buf[sizeof(DATE) + 11];
70
71 snprintf(buf, sizeof buf, "built on: %s", DATE);
72 return (buf);
73#else
74 return("built on: date not available"); 71 return("built on: date not available");
75#endif 72 case SSLEAY_CFLAGS:
76 }
77 if (t == SSLEAY_CFLAGS) {
78#ifdef CFLAGS
79 static char buf[sizeof(CFLAGS) + 11];
80
81 snprintf(buf, sizeof buf, "compiler: %s", CFLAGS);
82 return (buf);
83#else
84 return("compiler: information not available"); 73 return("compiler: information not available");
85#endif 74 case SSLEAY_PLATFORM:
86 }
87 if (t == SSLEAY_PLATFORM) {
88#ifdef PLATFORM
89 static char buf[sizeof(PLATFORM) + 11];
90
91 snprintf(buf, sizeof buf, "platform: %s", PLATFORM);
92 return (buf);
93#else
94 return("platform: information not available"); 75 return("platform: information not available");
95#endif 76 case SSLEAY_DIR:
96 }
97 if (t == SSLEAY_DIR) {
98#ifdef OPENSSLDIR
99 return "OPENSSLDIR: \"" OPENSSLDIR "\""; 77 return "OPENSSLDIR: \"" OPENSSLDIR "\"";
100#else
101 return "OPENSSLDIR: N/A";
102#endif
103 } 78 }
104 return("not available"); 79 return("not available");
105} 80}