diff options
| author | jsing <> | 2014-05-16 14:24:36 +0000 |
|---|---|---|
| committer | jsing <> | 2014-05-16 14:24:36 +0000 |
| commit | cc06c934c6d19139a199657cf73964bae959ff88 (patch) | |
| tree | 4381a37501b47b394536ba12ad22e8d0b233b62a | |
| parent | e4b9151b70065f78efd09afb46ade88c1ff19f90 (diff) | |
| download | openbsd-cc06c934c6d19139a199657cf73964bae959ff88.tar.gz openbsd-cc06c934c6d19139a199657cf73964bae959ff88.tar.bz2 openbsd-cc06c934c6d19139a199657cf73964bae959ff88.zip | |
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@
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/crypto/Makefile | 4 | ||||
| -rw-r--r-- | src/lib/libcrypto/evp/c_all.c | 28 | ||||
| -rw-r--r-- | src/lib/libcrypto/evp/evp.h | 7 | ||||
| -rw-r--r-- | src/lib/libcrypto/evp/evp_acnf.c | 73 | ||||
| -rw-r--r-- | src/lib/libssl/src/crypto/evp/c_all.c | 28 | ||||
| -rw-r--r-- | src/lib/libssl/src/crypto/evp/evp.h | 7 | ||||
| -rw-r--r-- | src/lib/libssl/src/crypto/evp/evp_acnf.c | 73 |
7 files changed, 30 insertions, 190 deletions
diff --git a/src/lib/libcrypto/crypto/Makefile b/src/lib/libcrypto/crypto/Makefile index 78261e6ef6..258f998fbc 100644 --- a/src/lib/libcrypto/crypto/Makefile +++ b/src/lib/libcrypto/crypto/Makefile | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | # $OpenBSD: Makefile,v 1.35 2014/05/15 15:09:01 jsing Exp $ | 1 | # $OpenBSD: Makefile,v 1.36 2014/05/16 14:24:36 jsing Exp $ |
| 2 | 2 | ||
| 3 | LIB= crypto | 3 | LIB= crypto |
| 4 | 4 | ||
| @@ -140,7 +140,7 @@ SRCS+= eng_rsax.c eng_rdrand.c | |||
| 140 | SRCS+= err.c err_all.c err_prn.c | 140 | SRCS+= err.c err_all.c err_prn.c |
| 141 | 141 | ||
| 142 | # evp/ | 142 | # evp/ |
| 143 | SRCS+= encode.c digest.c evp_enc.c evp_key.c evp_acnf.c | 143 | SRCS+= encode.c digest.c evp_enc.c evp_key.c |
| 144 | SRCS+= e_des.c e_bf.c e_idea.c e_des3.c e_camellia.c | 144 | SRCS+= e_des.c e_bf.c e_idea.c e_des3.c e_camellia.c |
| 145 | SRCS+= e_rc4.c e_aes.c names.c | 145 | SRCS+= e_rc4.c e_aes.c names.c |
| 146 | SRCS+= e_xcbc_d.c e_rc2.c e_cast.c e_rc5.c | 146 | SRCS+= e_xcbc_d.c e_rc2.c e_cast.c e_rc5.c |
diff --git a/src/lib/libcrypto/evp/c_all.c b/src/lib/libcrypto/evp/c_all.c index 0596484742..251a8797df 100644 --- a/src/lib/libcrypto/evp/c_all.c +++ b/src/lib/libcrypto/evp/c_all.c | |||
| @@ -57,36 +57,30 @@ | |||
| 57 | */ | 57 | */ |
| 58 | 58 | ||
| 59 | #include <stdio.h> | 59 | #include <stdio.h> |
| 60 | #include "cryptlib.h" | 60 | |
| 61 | #include <openssl/conf.h> | ||
| 61 | #include <openssl/evp.h> | 62 | #include <openssl/evp.h> |
| 63 | |||
| 62 | #ifndef OPENSSL_NO_ENGINE | 64 | #ifndef OPENSSL_NO_ENGINE |
| 63 | #include <openssl/engine.h> | 65 | #include <openssl/engine.h> |
| 64 | #endif | 66 | #endif |
| 65 | 67 | ||
| 66 | #if 0 | 68 | #include "cryptlib.h" |
| 67 | #undef OpenSSL_add_all_algorithms | ||
| 68 | |||
| 69 | void | ||
| 70 | OpenSSL_add_all_algorithms(void) | ||
| 71 | { | ||
| 72 | OPENSSL_add_all_algorithms_noconf(); | ||
| 73 | } | ||
| 74 | #endif | ||
| 75 | 69 | ||
| 76 | void | 70 | void |
| 77 | OPENSSL_add_all_algorithms_noconf(void) | 71 | OPENSSL_add_all_algorithms_noconf(void) |
| 78 | { | 72 | { |
| 79 | /* | ||
| 80 | * For the moment OPENSSL_cpuid_setup does something | ||
| 81 | * only on IA-32, but we reserve the option for all | ||
| 82 | * platforms... | ||
| 83 | */ | ||
| 84 | OPENSSL_cpuid_setup(); | 73 | OPENSSL_cpuid_setup(); |
| 85 | OpenSSL_add_all_ciphers(); | 74 | OpenSSL_add_all_ciphers(); |
| 86 | OpenSSL_add_all_digests(); | 75 | OpenSSL_add_all_digests(); |
| 87 | #ifndef OPENSSL_NO_ENGINE | 76 | #ifndef OPENSSL_NO_ENGINE |
| 88 | # if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(HAVE_CRYPTODEV) | ||
| 89 | ENGINE_setup_bsd_cryptodev(); | 77 | ENGINE_setup_bsd_cryptodev(); |
| 90 | # endif | ||
| 91 | #endif | 78 | #endif |
| 92 | } | 79 | } |
| 80 | |||
| 81 | void | ||
| 82 | OPENSSL_add_all_algorithms_conf(void) | ||
| 83 | { | ||
| 84 | OPENSSL_add_all_algorithms_noconf(); | ||
| 85 | OPENSSL_config(NULL); | ||
| 86 | } | ||
diff --git a/src/lib/libcrypto/evp/evp.h b/src/lib/libcrypto/evp/evp.h index 437e36194f..3219a63d03 100644 --- a/src/lib/libcrypto/evp/evp.h +++ b/src/lib/libcrypto/evp/evp.h | |||
| @@ -830,15 +830,14 @@ void OPENSSL_add_all_algorithms_noconf(void); | |||
| 830 | void OPENSSL_add_all_algorithms_conf(void); | 830 | void OPENSSL_add_all_algorithms_conf(void); |
| 831 | 831 | ||
| 832 | #ifdef OPENSSL_LOAD_CONF | 832 | #ifdef OPENSSL_LOAD_CONF |
| 833 | #define OpenSSL_add_all_algorithms() \ | 833 | #define OpenSSL_add_all_algorithms() OPENSSL_add_all_algorithms_conf() |
| 834 | OPENSSL_add_all_algorithms_conf() | ||
| 835 | #else | 834 | #else |
| 836 | #define OpenSSL_add_all_algorithms() \ | 835 | #define OpenSSL_add_all_algorithms() OPENSSL_add_all_algorithms_noconf() |
| 837 | OPENSSL_add_all_algorithms_noconf() | ||
| 838 | #endif | 836 | #endif |
| 839 | 837 | ||
| 840 | void OpenSSL_add_all_ciphers(void); | 838 | void OpenSSL_add_all_ciphers(void); |
| 841 | void OpenSSL_add_all_digests(void); | 839 | void OpenSSL_add_all_digests(void); |
| 840 | |||
| 842 | #define SSLeay_add_all_algorithms() OpenSSL_add_all_algorithms() | 841 | #define SSLeay_add_all_algorithms() OpenSSL_add_all_algorithms() |
| 843 | #define SSLeay_add_all_ciphers() OpenSSL_add_all_ciphers() | 842 | #define SSLeay_add_all_ciphers() OpenSSL_add_all_ciphers() |
| 844 | #define SSLeay_add_all_digests() OpenSSL_add_all_digests() | 843 | #define SSLeay_add_all_digests() OpenSSL_add_all_digests() |
diff --git a/src/lib/libcrypto/evp/evp_acnf.c b/src/lib/libcrypto/evp/evp_acnf.c deleted file mode 100644 index afbbc395ba..0000000000 --- a/src/lib/libcrypto/evp/evp_acnf.c +++ /dev/null | |||
| @@ -1,73 +0,0 @@ | |||
| 1 | /* evp_acnf.c */ | ||
| 2 | /* Written by Stephen Henson (steve@openssl.org) for the OpenSSL | ||
| 3 | * project 2001. | ||
| 4 | */ | ||
| 5 | /* ==================================================================== | ||
| 6 | * Copyright (c) 2001 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 | * licensing@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 "cryptlib.h" | ||
| 60 | #include <openssl/evp.h> | ||
| 61 | #include <openssl/conf.h> | ||
| 62 | |||
| 63 | /* Load all algorithms and configure OpenSSL. | ||
| 64 | * This function is called automatically when | ||
| 65 | * OPENSSL_LOAD_CONF is set. | ||
| 66 | */ | ||
| 67 | |||
| 68 | void | ||
| 69 | OPENSSL_add_all_algorithms_conf(void) | ||
| 70 | { | ||
| 71 | OPENSSL_add_all_algorithms_noconf(); | ||
| 72 | OPENSSL_config(NULL); | ||
| 73 | } | ||
diff --git a/src/lib/libssl/src/crypto/evp/c_all.c b/src/lib/libssl/src/crypto/evp/c_all.c index 0596484742..251a8797df 100644 --- a/src/lib/libssl/src/crypto/evp/c_all.c +++ b/src/lib/libssl/src/crypto/evp/c_all.c | |||
| @@ -57,36 +57,30 @@ | |||
| 57 | */ | 57 | */ |
| 58 | 58 | ||
| 59 | #include <stdio.h> | 59 | #include <stdio.h> |
| 60 | #include "cryptlib.h" | 60 | |
| 61 | #include <openssl/conf.h> | ||
| 61 | #include <openssl/evp.h> | 62 | #include <openssl/evp.h> |
| 63 | |||
| 62 | #ifndef OPENSSL_NO_ENGINE | 64 | #ifndef OPENSSL_NO_ENGINE |
| 63 | #include <openssl/engine.h> | 65 | #include <openssl/engine.h> |
| 64 | #endif | 66 | #endif |
| 65 | 67 | ||
| 66 | #if 0 | 68 | #include "cryptlib.h" |
| 67 | #undef OpenSSL_add_all_algorithms | ||
| 68 | |||
| 69 | void | ||
| 70 | OpenSSL_add_all_algorithms(void) | ||
| 71 | { | ||
| 72 | OPENSSL_add_all_algorithms_noconf(); | ||
| 73 | } | ||
| 74 | #endif | ||
| 75 | 69 | ||
| 76 | void | 70 | void |
| 77 | OPENSSL_add_all_algorithms_noconf(void) | 71 | OPENSSL_add_all_algorithms_noconf(void) |
| 78 | { | 72 | { |
| 79 | /* | ||
| 80 | * For the moment OPENSSL_cpuid_setup does something | ||
| 81 | * only on IA-32, but we reserve the option for all | ||
| 82 | * platforms... | ||
| 83 | */ | ||
| 84 | OPENSSL_cpuid_setup(); | 73 | OPENSSL_cpuid_setup(); |
| 85 | OpenSSL_add_all_ciphers(); | 74 | OpenSSL_add_all_ciphers(); |
| 86 | OpenSSL_add_all_digests(); | 75 | OpenSSL_add_all_digests(); |
| 87 | #ifndef OPENSSL_NO_ENGINE | 76 | #ifndef OPENSSL_NO_ENGINE |
| 88 | # if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(HAVE_CRYPTODEV) | ||
| 89 | ENGINE_setup_bsd_cryptodev(); | 77 | ENGINE_setup_bsd_cryptodev(); |
| 90 | # endif | ||
| 91 | #endif | 78 | #endif |
| 92 | } | 79 | } |
| 80 | |||
| 81 | void | ||
| 82 | OPENSSL_add_all_algorithms_conf(void) | ||
| 83 | { | ||
| 84 | OPENSSL_add_all_algorithms_noconf(); | ||
| 85 | OPENSSL_config(NULL); | ||
| 86 | } | ||
diff --git a/src/lib/libssl/src/crypto/evp/evp.h b/src/lib/libssl/src/crypto/evp/evp.h index 437e36194f..3219a63d03 100644 --- a/src/lib/libssl/src/crypto/evp/evp.h +++ b/src/lib/libssl/src/crypto/evp/evp.h | |||
| @@ -830,15 +830,14 @@ void OPENSSL_add_all_algorithms_noconf(void); | |||
| 830 | void OPENSSL_add_all_algorithms_conf(void); | 830 | void OPENSSL_add_all_algorithms_conf(void); |
| 831 | 831 | ||
| 832 | #ifdef OPENSSL_LOAD_CONF | 832 | #ifdef OPENSSL_LOAD_CONF |
| 833 | #define OpenSSL_add_all_algorithms() \ | 833 | #define OpenSSL_add_all_algorithms() OPENSSL_add_all_algorithms_conf() |
| 834 | OPENSSL_add_all_algorithms_conf() | ||
| 835 | #else | 834 | #else |
| 836 | #define OpenSSL_add_all_algorithms() \ | 835 | #define OpenSSL_add_all_algorithms() OPENSSL_add_all_algorithms_noconf() |
| 837 | OPENSSL_add_all_algorithms_noconf() | ||
| 838 | #endif | 836 | #endif |
| 839 | 837 | ||
| 840 | void OpenSSL_add_all_ciphers(void); | 838 | void OpenSSL_add_all_ciphers(void); |
| 841 | void OpenSSL_add_all_digests(void); | 839 | void OpenSSL_add_all_digests(void); |
| 840 | |||
| 842 | #define SSLeay_add_all_algorithms() OpenSSL_add_all_algorithms() | 841 | #define SSLeay_add_all_algorithms() OpenSSL_add_all_algorithms() |
| 843 | #define SSLeay_add_all_ciphers() OpenSSL_add_all_ciphers() | 842 | #define SSLeay_add_all_ciphers() OpenSSL_add_all_ciphers() |
| 844 | #define SSLeay_add_all_digests() OpenSSL_add_all_digests() | 843 | #define SSLeay_add_all_digests() OpenSSL_add_all_digests() |
diff --git a/src/lib/libssl/src/crypto/evp/evp_acnf.c b/src/lib/libssl/src/crypto/evp/evp_acnf.c deleted file mode 100644 index afbbc395ba..0000000000 --- a/src/lib/libssl/src/crypto/evp/evp_acnf.c +++ /dev/null | |||
| @@ -1,73 +0,0 @@ | |||
| 1 | /* evp_acnf.c */ | ||
| 2 | /* Written by Stephen Henson (steve@openssl.org) for the OpenSSL | ||
| 3 | * project 2001. | ||
| 4 | */ | ||
| 5 | /* ==================================================================== | ||
| 6 | * Copyright (c) 2001 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 | * licensing@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 "cryptlib.h" | ||
| 60 | #include <openssl/evp.h> | ||
| 61 | #include <openssl/conf.h> | ||
| 62 | |||
| 63 | /* Load all algorithms and configure OpenSSL. | ||
| 64 | * This function is called automatically when | ||
| 65 | * OPENSSL_LOAD_CONF is set. | ||
| 66 | */ | ||
| 67 | |||
| 68 | void | ||
| 69 | OPENSSL_add_all_algorithms_conf(void) | ||
| 70 | { | ||
| 71 | OPENSSL_add_all_algorithms_noconf(); | ||
| 72 | OPENSSL_config(NULL); | ||
| 73 | } | ||
