diff options
author | tb <> | 2024-11-05 11:14:04 +0000 |
---|---|---|
committer | tb <> | 2024-11-05 11:14:04 +0000 |
commit | 3491538df7214501383f20f9d081f5b0cccacf96 (patch) | |
tree | d9ef9ac4e49ef70a353b6bb8bea1c483dc7233bf | |
parent | 91fbcf54e7fba2bb7572c0f2a0eb2c11fc333f18 (diff) | |
download | openbsd-3491538df7214501383f20f9d081f5b0cccacf96.tar.gz openbsd-3491538df7214501383f20f9d081f5b0cccacf96.tar.bz2 openbsd-3491538df7214501383f20f9d081f5b0cccacf96.zip |
Relocate FIPS stubs to crpyto_legacy.c
discussed with jsing
-rw-r--r-- | src/lib/libcrypto/Makefile | 3 | ||||
-rw-r--r-- | src/lib/libcrypto/crypto_legacy.c | 20 | ||||
-rw-r--r-- | src/lib/libcrypto/o_fips.c | 77 |
3 files changed, 20 insertions, 80 deletions
diff --git a/src/lib/libcrypto/Makefile b/src/lib/libcrypto/Makefile index 51c31e3d9e..abfdb1b0e0 100644 --- a/src/lib/libcrypto/Makefile +++ b/src/lib/libcrypto/Makefile | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: Makefile,v 1.222 2024/11/05 11:11:29 tb Exp $ | 1 | # $OpenBSD: Makefile,v 1.223 2024/11/05 11:14:04 tb Exp $ |
2 | 2 | ||
3 | LIB= crypto | 3 | LIB= crypto |
4 | LIBREBUILD=y | 4 | LIBREBUILD=y |
@@ -62,7 +62,6 @@ 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+= malloc-wrapper.c | 64 | SRCS+= malloc-wrapper.c |
65 | SRCS+= o_fips.c | ||
66 | 65 | ||
67 | # aes/ | 66 | # aes/ |
68 | SRCS+= aes.c | 67 | SRCS+= aes.c |
diff --git a/src/lib/libcrypto/crypto_legacy.c b/src/lib/libcrypto/crypto_legacy.c index 21a998bb1c..94d51e92e2 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.4 2024/11/05 11:11:29 tb Exp $ */ | 1 | /* $OpenBSD: crypto_legacy.c,v 1.5 2024/11/05 11:14:04 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 | * |
@@ -123,6 +123,7 @@ | |||
123 | 123 | ||
124 | #include <openssl/opensslconf.h> | 124 | #include <openssl/opensslconf.h> |
125 | #include <openssl/crypto.h> | 125 | #include <openssl/crypto.h> |
126 | #include <openssl/err.h> | ||
126 | 127 | ||
127 | #include "crypto_internal.h" | 128 | #include "crypto_internal.h" |
128 | #include "crypto_local.h" | 129 | #include "crypto_local.h" |
@@ -385,6 +386,23 @@ CRYPTO_memcmp(const void *in_a, const void *in_b, size_t len) | |||
385 | } | 386 | } |
386 | LCRYPTO_ALIAS(CRYPTO_memcmp); | 387 | LCRYPTO_ALIAS(CRYPTO_memcmp); |
387 | 388 | ||
389 | int | ||
390 | FIPS_mode(void) | ||
391 | { | ||
392 | return 0; | ||
393 | } | ||
394 | LCRYPTO_ALIAS(FIPS_mode); | ||
395 | |||
396 | int | ||
397 | FIPS_mode_set(int r) | ||
398 | { | ||
399 | if (r == 0) | ||
400 | return 1; | ||
401 | CRYPTOerror(CRYPTO_R_FIPS_MODE_NOT_SUPPORTED); | ||
402 | return 0; | ||
403 | } | ||
404 | LCRYPTO_ALIAS(FIPS_mode_set); | ||
405 | |||
388 | const char * | 406 | const char * |
389 | SSLeay_version(int t) | 407 | SSLeay_version(int t) |
390 | { | 408 | { |
diff --git a/src/lib/libcrypto/o_fips.c b/src/lib/libcrypto/o_fips.c deleted file mode 100644 index 35309a95e6..0000000000 --- a/src/lib/libcrypto/o_fips.c +++ /dev/null | |||
@@ -1,77 +0,0 @@ | |||
1 | /* $OpenBSD: o_fips.c,v 1.9 2024/04/17 22:43:42 tb Exp $ */ | ||
2 | /* Written by Stephen Henson (steve@openssl.org) for the OpenSSL | ||
3 | * project 2011. | ||
4 | */ | ||
5 | /* ==================================================================== | ||
6 | * Copyright (c) 2011 The OpenSSL Project. All rights reserved. | ||
7 | * | ||
8 | * Redistribution and use in source and binary forms, with or without | ||
9 | * modification, are permitted provided that the following conditions | ||
10 | * are met: | ||
11 | * | ||
12 | * 1. Redistributions of source code must retain the above copyright | ||
13 | * notice, this list of conditions and the following disclaimer. | ||
14 | * | ||
15 | * 2. Redistributions in binary form must reproduce the above copyright | ||
16 | * notice, this list of conditions and the following disclaimer in | ||
17 | * the documentation and/or other materials provided with the | ||
18 | * distribution. | ||
19 | * | ||
20 | * 3. All advertising materials mentioning features or use of this | ||
21 | * software must display the following acknowledgment: | ||
22 | * "This product includes software developed by the OpenSSL Project | ||
23 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
24 | * | ||
25 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
26 | * endorse or promote products derived from this software without | ||
27 | * prior written permission. For written permission, please contact | ||
28 | * openssl-core@openssl.org. | ||
29 | * | ||
30 | * 5. Products derived from this software may not be called "OpenSSL" | ||
31 | * nor may "OpenSSL" appear in their names without prior written | ||
32 | * permission of the OpenSSL Project. | ||
33 | * | ||
34 | * 6. Redistributions of any form whatsoever must retain the following | ||
35 | * acknowledgment: | ||
36 | * "This product includes software developed by the OpenSSL Project | ||
37 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
38 | * | ||
39 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
40 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
41 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
42 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
43 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
44 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
45 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
46 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
47 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
48 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
49 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
50 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
51 | * ==================================================================== | ||
52 | * | ||
53 | * This product includes cryptographic software written by Eric Young | ||
54 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
55 | * Hudson (tjh@cryptsoft.com). | ||
56 | * | ||
57 | */ | ||
58 | |||
59 | #include <openssl/crypto.h> | ||
60 | #include <openssl/err.h> | ||
61 | |||
62 | int | ||
63 | FIPS_mode(void) | ||
64 | { | ||
65 | return 0; | ||
66 | } | ||
67 | LCRYPTO_ALIAS(FIPS_mode); | ||
68 | |||
69 | int | ||
70 | FIPS_mode_set(int r) | ||
71 | { | ||
72 | if (r == 0) | ||
73 | return 1; | ||
74 | CRYPTOerror(CRYPTO_R_FIPS_MODE_NOT_SUPPORTED); | ||
75 | return 0; | ||
76 | } | ||
77 | LCRYPTO_ALIAS(FIPS_mode_set); | ||