From 0ba5355dcc5becbd625603af7fdb872596b6b289 Mon Sep 17 00:00:00 2001 From: jsing Date: Fri, 16 May 2014 14:24:36 +0000 Subject: [PATCH] When OPENSSL_LOAD_CONF was added it ended up with more #if 0 code, more #ifdefs and a new source file that contains a single function. Nuke the #if 0 code that is now a macro and move the single function in evp_acnf.c to c_all.c, which is where the other code lives. While here, tidy evp.h slightly, remove an unnecessary #ifdef __OpenBSD__ and nuke a comment that is now a lie. ok miod@ --- lib/libcrypto/crypto/Makefile | 4 +- lib/libcrypto/evp/c_all.c | 28 +++++------ lib/libcrypto/evp/evp.h | 7 ++- lib/libcrypto/evp/evp_acnf.c | 73 ---------------------------- lib/libssl/src/crypto/evp/c_all.c | 28 +++++------ lib/libssl/src/crypto/evp/evp.h | 7 ++- lib/libssl/src/crypto/evp/evp_acnf.c | 73 ---------------------------- 7 files changed, 30 insertions(+), 190 deletions(-) delete mode 100644 lib/libcrypto/evp/evp_acnf.c delete mode 100644 lib/libssl/src/crypto/evp/evp_acnf.c diff --git a/lib/libcrypto/crypto/Makefile b/lib/libcrypto/crypto/Makefile index 78261e6ef6c..258f998fbc3 100644 --- a/lib/libcrypto/crypto/Makefile +++ b/lib/libcrypto/crypto/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.35 2014/05/15 15:09:01 jsing Exp $ +# $OpenBSD: Makefile,v 1.36 2014/05/16 14:24:36 jsing Exp $ LIB= crypto @@ -140,7 +140,7 @@ SRCS+= eng_rsax.c eng_rdrand.c SRCS+= err.c err_all.c err_prn.c # evp/ -SRCS+= encode.c digest.c evp_enc.c evp_key.c evp_acnf.c +SRCS+= encode.c digest.c evp_enc.c evp_key.c SRCS+= e_des.c e_bf.c e_idea.c e_des3.c e_camellia.c SRCS+= e_rc4.c e_aes.c names.c SRCS+= e_xcbc_d.c e_rc2.c e_cast.c e_rc5.c diff --git a/lib/libcrypto/evp/c_all.c b/lib/libcrypto/evp/c_all.c index 0596484742e..251a8797df9 100644 --- a/lib/libcrypto/evp/c_all.c +++ b/lib/libcrypto/evp/c_all.c @@ -57,36 +57,30 @@ */ #include -#include "cryptlib.h" + +#include #include + #ifndef OPENSSL_NO_ENGINE #include #endif -#if 0 -#undef OpenSSL_add_all_algorithms - -void -OpenSSL_add_all_algorithms(void) -{ - OPENSSL_add_all_algorithms_noconf(); -} -#endif +#include "cryptlib.h" void OPENSSL_add_all_algorithms_noconf(void) { - /* - * For the moment OPENSSL_cpuid_setup does something - * only on IA-32, but we reserve the option for all - * platforms... - */ OPENSSL_cpuid_setup(); OpenSSL_add_all_ciphers(); OpenSSL_add_all_digests(); #ifndef OPENSSL_NO_ENGINE -# if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(HAVE_CRYPTODEV) ENGINE_setup_bsd_cryptodev(); -# endif #endif } + +void +OPENSSL_add_all_algorithms_conf(void) +{ + OPENSSL_add_all_algorithms_noconf(); + OPENSSL_config(NULL); +} diff --git a/lib/libcrypto/evp/evp.h b/lib/libcrypto/evp/evp.h index 437e36194ff..3219a63d031 100644 --- a/lib/libcrypto/evp/evp.h +++ b/lib/libcrypto/evp/evp.h @@ -830,15 +830,14 @@ void OPENSSL_add_all_algorithms_noconf(void); void OPENSSL_add_all_algorithms_conf(void); #ifdef OPENSSL_LOAD_CONF -#define OpenSSL_add_all_algorithms() \ - OPENSSL_add_all_algorithms_conf() +#define OpenSSL_add_all_algorithms() OPENSSL_add_all_algorithms_conf() #else -#define OpenSSL_add_all_algorithms() \ - OPENSSL_add_all_algorithms_noconf() +#define OpenSSL_add_all_algorithms() OPENSSL_add_all_algorithms_noconf() #endif void OpenSSL_add_all_ciphers(void); void OpenSSL_add_all_digests(void); + #define SSLeay_add_all_algorithms() OpenSSL_add_all_algorithms() #define SSLeay_add_all_ciphers() OpenSSL_add_all_ciphers() #define SSLeay_add_all_digests() OpenSSL_add_all_digests() diff --git a/lib/libcrypto/evp/evp_acnf.c b/lib/libcrypto/evp/evp_acnf.c deleted file mode 100644 index afbbc395ba0..00000000000 --- a/lib/libcrypto/evp/evp_acnf.c +++ /dev/null @@ -1,73 +0,0 @@ -/* evp_acnf.c */ -/* Written by Stephen Henson (steve@openssl.org) for the OpenSSL - * project 2001. - */ -/* ==================================================================== - * Copyright (c) 2001 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 - * licensing@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 "cryptlib.h" -#include -#include - -/* Load all algorithms and configure OpenSSL. - * This function is called automatically when - * OPENSSL_LOAD_CONF is set. - */ - -void -OPENSSL_add_all_algorithms_conf(void) -{ - OPENSSL_add_all_algorithms_noconf(); - OPENSSL_config(NULL); -} diff --git a/lib/libssl/src/crypto/evp/c_all.c b/lib/libssl/src/crypto/evp/c_all.c index 0596484742e..251a8797df9 100644 --- a/lib/libssl/src/crypto/evp/c_all.c +++ b/lib/libssl/src/crypto/evp/c_all.c @@ -57,36 +57,30 @@ */ #include -#include "cryptlib.h" + +#include #include + #ifndef OPENSSL_NO_ENGINE #include #endif -#if 0 -#undef OpenSSL_add_all_algorithms - -void -OpenSSL_add_all_algorithms(void) -{ - OPENSSL_add_all_algorithms_noconf(); -} -#endif +#include "cryptlib.h" void OPENSSL_add_all_algorithms_noconf(void) { - /* - * For the moment OPENSSL_cpuid_setup does something - * only on IA-32, but we reserve the option for all - * platforms... - */ OPENSSL_cpuid_setup(); OpenSSL_add_all_ciphers(); OpenSSL_add_all_digests(); #ifndef OPENSSL_NO_ENGINE -# if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(HAVE_CRYPTODEV) ENGINE_setup_bsd_cryptodev(); -# endif #endif } + +void +OPENSSL_add_all_algorithms_conf(void) +{ + OPENSSL_add_all_algorithms_noconf(); + OPENSSL_config(NULL); +} diff --git a/lib/libssl/src/crypto/evp/evp.h b/lib/libssl/src/crypto/evp/evp.h index 437e36194ff..3219a63d031 100644 --- a/lib/libssl/src/crypto/evp/evp.h +++ b/lib/libssl/src/crypto/evp/evp.h @@ -830,15 +830,14 @@ void OPENSSL_add_all_algorithms_noconf(void); void OPENSSL_add_all_algorithms_conf(void); #ifdef OPENSSL_LOAD_CONF -#define OpenSSL_add_all_algorithms() \ - OPENSSL_add_all_algorithms_conf() +#define OpenSSL_add_all_algorithms() OPENSSL_add_all_algorithms_conf() #else -#define OpenSSL_add_all_algorithms() \ - OPENSSL_add_all_algorithms_noconf() +#define OpenSSL_add_all_algorithms() OPENSSL_add_all_algorithms_noconf() #endif void OpenSSL_add_all_ciphers(void); void OpenSSL_add_all_digests(void); + #define SSLeay_add_all_algorithms() OpenSSL_add_all_algorithms() #define SSLeay_add_all_ciphers() OpenSSL_add_all_ciphers() #define SSLeay_add_all_digests() OpenSSL_add_all_digests() diff --git a/lib/libssl/src/crypto/evp/evp_acnf.c b/lib/libssl/src/crypto/evp/evp_acnf.c deleted file mode 100644 index afbbc395ba0..00000000000 --- a/lib/libssl/src/crypto/evp/evp_acnf.c +++ /dev/null @@ -1,73 +0,0 @@ -/* evp_acnf.c */ -/* Written by Stephen Henson (steve@openssl.org) for the OpenSSL - * project 2001. - */ -/* ==================================================================== - * Copyright (c) 2001 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 - * licensing@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 "cryptlib.h" -#include -#include - -/* Load all algorithms and configure OpenSSL. - * This function is called automatically when - * OPENSSL_LOAD_CONF is set. - */ - -void -OPENSSL_add_all_algorithms_conf(void) -{ - OPENSSL_add_all_algorithms_noconf(); - OPENSSL_config(NULL); -} -- 2.20.1