diff options
author | tb <> | 2024-11-05 11:02:58 +0000 |
---|---|---|
committer | tb <> | 2024-11-05 11:02:58 +0000 |
commit | 8b19337000a05871189304b9adfbddcca405e429 (patch) | |
tree | 7605aa31282ffe70bd2a43d6e5b7f7a04ff545d3 | |
parent | 25c3e098c507041bad95c22f472665733b7b1271 (diff) | |
download | openbsd-8b19337000a05871189304b9adfbddcca405e429.tar.gz openbsd-8b19337000a05871189304b9adfbddcca405e429.tar.bz2 openbsd-8b19337000a05871189304b9adfbddcca405e429.zip |
Fold cversion.c into crypto_legacy.c
discussed with jsing
-rw-r--r-- | src/lib/libcrypto/Makefile | 3 | ||||
-rw-r--r-- | src/lib/libcrypto/crypto_legacy.c | 57 | ||||
-rw-r--r-- | src/lib/libcrypto/cversion.c | 116 |
3 files changed, 57 insertions, 119 deletions
diff --git a/src/lib/libcrypto/Makefile b/src/lib/libcrypto/Makefile index 8630687370..ccc5e0b5c6 100644 --- a/src/lib/libcrypto/Makefile +++ b/src/lib/libcrypto/Makefile | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: Makefile,v 1.219 2024/11/05 10:59:42 tb Exp $ | 1 | # $OpenBSD: Makefile,v 1.220 2024/11/05 11:02:58 tb Exp $ |
2 | 2 | ||
3 | LIB= crypto | 3 | LIB= crypto |
4 | LIBREBUILD=y | 4 | LIBREBUILD=y |
@@ -61,7 +61,6 @@ SRCS+= crypto_ex_data.c | |||
61 | SRCS+= crypto_init.c | 61 | SRCS+= crypto_init.c |
62 | SRCS+= crypto_legacy.c | 62 | SRCS+= crypto_legacy.c |
63 | SRCS+= crypto_lock.c | 63 | SRCS+= crypto_lock.c |
64 | SRCS+= cversion.c | ||
65 | SRCS+= malloc-wrapper.c | 64 | SRCS+= malloc-wrapper.c |
66 | SRCS+= mem_clr.c | 65 | SRCS+= mem_clr.c |
67 | SRCS+= mem_dbg.c | 66 | SRCS+= mem_dbg.c |
diff --git a/src/lib/libcrypto/crypto_legacy.c b/src/lib/libcrypto/crypto_legacy.c index 5b3ed67304..65ca9b5f9a 100644 --- a/src/lib/libcrypto/crypto_legacy.c +++ b/src/lib/libcrypto/crypto_legacy.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: crypto_legacy.c,v 1.1 2024/11/05 10:59:42 tb Exp $ */ | 1 | /* $OpenBSD: crypto_legacy.c,v 1.2 2024/11/05 11:02:58 tb Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. |
4 | * | 4 | * |
@@ -125,6 +125,7 @@ | |||
125 | #include <openssl/crypto.h> | 125 | #include <openssl/crypto.h> |
126 | 126 | ||
127 | #include "crypto_internal.h" | 127 | #include "crypto_internal.h" |
128 | #include "crypto_local.h" | ||
128 | #include "x86_arch.h" | 129 | #include "x86_arch.h" |
129 | 130 | ||
130 | /* Machine independent capabilities. */ | 131 | /* Machine independent capabilities. */ |
@@ -369,3 +370,57 @@ CRYPTO_memcmp(const void *in_a, const void *in_b, size_t len) | |||
369 | return x; | 370 | return x; |
370 | } | 371 | } |
371 | LCRYPTO_ALIAS(CRYPTO_memcmp); | 372 | LCRYPTO_ALIAS(CRYPTO_memcmp); |
373 | |||
374 | const char * | ||
375 | SSLeay_version(int t) | ||
376 | { | ||
377 | switch (t) { | ||
378 | case SSLEAY_VERSION: | ||
379 | return OPENSSL_VERSION_TEXT; | ||
380 | case SSLEAY_BUILT_ON: | ||
381 | return "built on: date not available"; | ||
382 | case SSLEAY_CFLAGS: | ||
383 | return "compiler: information not available"; | ||
384 | case SSLEAY_PLATFORM: | ||
385 | return "platform: information not available"; | ||
386 | case SSLEAY_DIR: | ||
387 | return "OPENSSLDIR: \"" OPENSSLDIR "\""; | ||
388 | } | ||
389 | return "not available"; | ||
390 | } | ||
391 | LCRYPTO_ALIAS(SSLeay_version); | ||
392 | |||
393 | unsigned long | ||
394 | SSLeay(void) | ||
395 | { | ||
396 | return SSLEAY_VERSION_NUMBER; | ||
397 | } | ||
398 | LCRYPTO_ALIAS(SSLeay); | ||
399 | |||
400 | const char * | ||
401 | OpenSSL_version(int t) | ||
402 | { | ||
403 | switch (t) { | ||
404 | case OPENSSL_VERSION: | ||
405 | return OPENSSL_VERSION_TEXT; | ||
406 | case OPENSSL_BUILT_ON: | ||
407 | return "built on: date not available"; | ||
408 | case OPENSSL_CFLAGS: | ||
409 | return "compiler: information not available"; | ||
410 | case OPENSSL_PLATFORM: | ||
411 | return "platform: information not available"; | ||
412 | case OPENSSL_DIR: | ||
413 | return "OPENSSLDIR: \"" OPENSSLDIR "\""; | ||
414 | case OPENSSL_ENGINES_DIR: | ||
415 | return "ENGINESDIR: N/A"; | ||
416 | } | ||
417 | return "not available"; | ||
418 | } | ||
419 | LCRYPTO_ALIAS(OpenSSL_version); | ||
420 | |||
421 | unsigned long | ||
422 | OpenSSL_version_num(void) | ||
423 | { | ||
424 | return SSLeay(); | ||
425 | } | ||
426 | LCRYPTO_ALIAS(OpenSSL_version_num); | ||
diff --git a/src/lib/libcrypto/cversion.c b/src/lib/libcrypto/cversion.c deleted file mode 100644 index 2992bd2e05..0000000000 --- a/src/lib/libcrypto/cversion.c +++ /dev/null | |||
@@ -1,116 +0,0 @@ | |||
1 | /* $OpenBSD: cversion.c,v 1.21 2024/11/05 09:35:40 tb Exp $ */ | ||
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | ||
3 | * All rights reserved. | ||
4 | * | ||
5 | * This package is an SSL implementation written | ||
6 | * by Eric Young (eay@cryptsoft.com). | ||
7 | * The implementation was written so as to conform with Netscapes SSL. | ||
8 | * | ||
9 | * This library is free for commercial and non-commercial use as long as | ||
10 | * the following conditions are aheared to. The following conditions | ||
11 | * apply to all code found in this distribution, be it the RC4, RSA, | ||
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation | ||
13 | * included with this distribution is covered by the same copyright terms | ||
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). | ||
15 | * | ||
16 | * Copyright remains Eric Young's, and as such any Copyright notices in | ||
17 | * the code are not to be removed. | ||
18 | * If this package is used in a product, Eric Young should be given attribution | ||
19 | * as the author of the parts of the library used. | ||
20 | * This can be in the form of a textual message at program startup or | ||
21 | * in documentation (online or textual) provided with the package. | ||
22 | * | ||
23 | * Redistribution and use in source and binary forms, with or without | ||
24 | * modification, are permitted provided that the following conditions | ||
25 | * are met: | ||
26 | * 1. Redistributions of source code must retain the copyright | ||
27 | * notice, this list of conditions and the following disclaimer. | ||
28 | * 2. Redistributions in binary form must reproduce the above copyright | ||
29 | * notice, this list of conditions and the following disclaimer in the | ||
30 | * documentation and/or other materials provided with the distribution. | ||
31 | * 3. All advertising materials mentioning features or use of this software | ||
32 | * must display the following acknowledgement: | ||
33 | * "This product includes cryptographic software written by | ||
34 | * Eric Young (eay@cryptsoft.com)" | ||
35 | * The word 'cryptographic' can be left out if the rouines from the library | ||
36 | * being used are not cryptographic related :-). | ||
37 | * 4. If you include any Windows specific code (or a derivative thereof) from | ||
38 | * the apps directory (application code) you must include an acknowledgement: | ||
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" | ||
40 | * | ||
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND | ||
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
51 | * SUCH DAMAGE. | ||
52 | * | ||
53 | * The licence and distribution terms for any publically available version or | ||
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be | ||
55 | * copied and put under another distribution licence | ||
56 | * [including the GNU Public Licence.] | ||
57 | */ | ||
58 | |||
59 | #include <openssl/crypto.h> | ||
60 | #include <openssl/opensslv.h> | ||
61 | |||
62 | #include "crypto_local.h" | ||
63 | |||
64 | const char * | ||
65 | SSLeay_version(int t) | ||
66 | { | ||
67 | switch (t) { | ||
68 | case SSLEAY_VERSION: | ||
69 | return OPENSSL_VERSION_TEXT; | ||
70 | case SSLEAY_BUILT_ON: | ||
71 | return "built on: date not available"; | ||
72 | case SSLEAY_CFLAGS: | ||
73 | return "compiler: information not available"; | ||
74 | case SSLEAY_PLATFORM: | ||
75 | return "platform: information not available"; | ||
76 | case SSLEAY_DIR: | ||
77 | return "OPENSSLDIR: \"" OPENSSLDIR "\""; | ||
78 | } | ||
79 | return "not available"; | ||
80 | } | ||
81 | LCRYPTO_ALIAS(SSLeay_version); | ||
82 | |||
83 | unsigned long | ||
84 | SSLeay(void) | ||
85 | { | ||
86 | return SSLEAY_VERSION_NUMBER; | ||
87 | } | ||
88 | LCRYPTO_ALIAS(SSLeay); | ||
89 | |||
90 | const char * | ||
91 | OpenSSL_version(int t) | ||
92 | { | ||
93 | switch (t) { | ||
94 | case OPENSSL_VERSION: | ||
95 | return OPENSSL_VERSION_TEXT; | ||
96 | case OPENSSL_BUILT_ON: | ||
97 | return "built on: date not available"; | ||
98 | case OPENSSL_CFLAGS: | ||
99 | return "compiler: information not available"; | ||
100 | case OPENSSL_PLATFORM: | ||
101 | return "platform: information not available"; | ||
102 | case OPENSSL_DIR: | ||
103 | return "OPENSSLDIR: \"" OPENSSLDIR "\""; | ||
104 | case OPENSSL_ENGINES_DIR: | ||
105 | return "ENGINESDIR: N/A"; | ||
106 | } | ||
107 | return "not available"; | ||
108 | } | ||
109 | LCRYPTO_ALIAS(OpenSSL_version); | ||
110 | |||
111 | unsigned long | ||
112 | OpenSSL_version_num(void) | ||
113 | { | ||
114 | return SSLeay(); | ||
115 | } | ||
116 | LCRYPTO_ALIAS(OpenSSL_version_num); | ||