summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjsing <>2014-05-16 14:24:36 +0000
committerjsing <>2014-05-16 14:24:36 +0000
commitd6d4e206cd692584735252f0a21af1b42608bc28 (patch)
tree4381a37501b47b394536ba12ad22e8d0b233b62a /src
parent1eeef6fd82d0dec3015800123cb212520761c54d (diff)
downloadopenbsd-d6d4e206cd692584735252f0a21af1b42608bc28.tar.gz
openbsd-d6d4e206cd692584735252f0a21af1b42608bc28.tar.bz2
openbsd-d6d4e206cd692584735252f0a21af1b42608bc28.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 'src')
-rw-r--r--src/lib/libcrypto/crypto/Makefile4
-rw-r--r--src/lib/libcrypto/evp/c_all.c28
-rw-r--r--src/lib/libcrypto/evp/evp.h7
-rw-r--r--src/lib/libcrypto/evp/evp_acnf.c73
-rw-r--r--src/lib/libssl/src/crypto/evp/c_all.c28
-rw-r--r--src/lib/libssl/src/crypto/evp/evp.h7
-rw-r--r--src/lib/libssl/src/crypto/evp/evp_acnf.c73
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
3LIB= crypto 3LIB= crypto
4 4
@@ -140,7 +140,7 @@ SRCS+= eng_rsax.c eng_rdrand.c
140SRCS+= err.c err_all.c err_prn.c 140SRCS+= err.c err_all.c err_prn.c
141 141
142# evp/ 142# evp/
143SRCS+= encode.c digest.c evp_enc.c evp_key.c evp_acnf.c 143SRCS+= encode.c digest.c evp_enc.c evp_key.c
144SRCS+= e_des.c e_bf.c e_idea.c e_des3.c e_camellia.c 144SRCS+= e_des.c e_bf.c e_idea.c e_des3.c e_camellia.c
145SRCS+= e_rc4.c e_aes.c names.c 145SRCS+= e_rc4.c e_aes.c names.c
146SRCS+= e_xcbc_d.c e_rc2.c e_cast.c e_rc5.c 146SRCS+= 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
69void
70OpenSSL_add_all_algorithms(void)
71{
72 OPENSSL_add_all_algorithms_noconf();
73}
74#endif
75 69
76void 70void
77OPENSSL_add_all_algorithms_noconf(void) 71OPENSSL_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
81void
82OPENSSL_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);
830void OPENSSL_add_all_algorithms_conf(void); 830void 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
840void OpenSSL_add_all_ciphers(void); 838void OpenSSL_add_all_ciphers(void);
841void OpenSSL_add_all_digests(void); 839void 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
68void
69OPENSSL_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
69void
70OpenSSL_add_all_algorithms(void)
71{
72 OPENSSL_add_all_algorithms_noconf();
73}
74#endif
75 69
76void 70void
77OPENSSL_add_all_algorithms_noconf(void) 71OPENSSL_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
81void
82OPENSSL_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);
830void OPENSSL_add_all_algorithms_conf(void); 830void 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
840void OpenSSL_add_all_ciphers(void); 838void OpenSSL_add_all_ciphers(void);
841void OpenSSL_add_all_digests(void); 839void 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
68void
69OPENSSL_add_all_algorithms_conf(void)
70{
71 OPENSSL_add_all_algorithms_noconf();
72 OPENSSL_config(NULL);
73}