From 3491538df7214501383f20f9d081f5b0cccacf96 Mon Sep 17 00:00:00 2001 From: tb <> Date: Tue, 5 Nov 2024 11:14:04 +0000 Subject: Relocate FIPS stubs to crpyto_legacy.c discussed with jsing --- src/lib/libcrypto/Makefile | 3 +- src/lib/libcrypto/crypto_legacy.c | 20 +++++++++- src/lib/libcrypto/o_fips.c | 77 --------------------------------------- 3 files changed, 20 insertions(+), 80 deletions(-) delete mode 100644 src/lib/libcrypto/o_fips.c 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 @@ -# $OpenBSD: Makefile,v 1.222 2024/11/05 11:11:29 tb Exp $ +# $OpenBSD: Makefile,v 1.223 2024/11/05 11:14:04 tb Exp $ LIB= crypto LIBREBUILD=y @@ -62,7 +62,6 @@ SRCS+= crypto_init.c SRCS+= crypto_legacy.c SRCS+= crypto_lock.c SRCS+= malloc-wrapper.c -SRCS+= o_fips.c # aes/ 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 @@ -/* $OpenBSD: crypto_legacy.c,v 1.4 2024/11/05 11:11:29 tb Exp $ */ +/* $OpenBSD: crypto_legacy.c,v 1.5 2024/11/05 11:14:04 tb Exp $ */ /* ==================================================================== * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. * @@ -123,6 +123,7 @@ #include #include +#include #include "crypto_internal.h" #include "crypto_local.h" @@ -385,6 +386,23 @@ CRYPTO_memcmp(const void *in_a, const void *in_b, size_t len) } LCRYPTO_ALIAS(CRYPTO_memcmp); +int +FIPS_mode(void) +{ + return 0; +} +LCRYPTO_ALIAS(FIPS_mode); + +int +FIPS_mode_set(int r) +{ + if (r == 0) + return 1; + CRYPTOerror(CRYPTO_R_FIPS_MODE_NOT_SUPPORTED); + return 0; +} +LCRYPTO_ALIAS(FIPS_mode_set); + const char * SSLeay_version(int t) { 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 @@ -/* $OpenBSD: o_fips.c,v 1.9 2024/04/17 22:43:42 tb Exp $ */ -/* Written by Stephen Henson (steve@openssl.org) for the OpenSSL - * project 2011. - */ -/* ==================================================================== - * Copyright (c) 2011 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - -#include -#include - -int -FIPS_mode(void) -{ - return 0; -} -LCRYPTO_ALIAS(FIPS_mode); - -int -FIPS_mode_set(int r) -{ - if (r == 0) - return 1; - CRYPTOerror(CRYPTO_R_FIPS_MODE_NOT_SUPPORTED); - return 0; -} -LCRYPTO_ALIAS(FIPS_mode_set); -- cgit v1.2.3-55-g6feb