summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/conf
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/conf')
-rw-r--r--src/lib/libcrypto/conf/Makefile152
-rw-r--r--src/lib/libcrypto/conf/Makefile.ssl183
-rw-r--r--src/lib/libcrypto/conf/cnf_save.c106
-rw-r--r--src/lib/libcrypto/conf/conf.h6
-rw-r--r--src/lib/libcrypto/conf/conf_api.c2
-rw-r--r--src/lib/libcrypto/conf/conf_def.c36
-rw-r--r--src/lib/libcrypto/conf/conf_err.c11
-rw-r--r--src/lib/libcrypto/conf/conf_lib.c4
-rw-r--r--src/lib/libcrypto/conf/conf_mod.c17
-rw-r--r--src/lib/libcrypto/conf/conf_sap.c4
-rw-r--r--src/lib/libcrypto/conf/test.c98
11 files changed, 577 insertions, 42 deletions
diff --git a/src/lib/libcrypto/conf/Makefile b/src/lib/libcrypto/conf/Makefile
new file mode 100644
index 0000000000..78bb324106
--- /dev/null
+++ b/src/lib/libcrypto/conf/Makefile
@@ -0,0 +1,152 @@
1#
2# OpenSSL/crypto/conf/Makefile
3#
4
5DIR= conf
6TOP= ../..
7CC= cc
8INCLUDES= -I.. -I$(TOP) -I../../include
9CFLAG=-g
10MAKEFILE= Makefile
11AR= ar r
12
13CFLAGS= $(INCLUDES) $(CFLAG)
14
15GENERAL=Makefile
16TEST=
17APPS=
18
19LIB=$(TOP)/libcrypto.a
20LIBSRC= conf_err.c conf_lib.c conf_api.c conf_def.c conf_mod.c \
21 conf_mall.c conf_sap.c
22
23LIBOBJ= conf_err.o conf_lib.o conf_api.o conf_def.o conf_mod.o \
24 conf_mall.o conf_sap.o
25
26SRC= $(LIBSRC)
27
28EXHEADER= conf.h conf_api.h
29HEADER= conf_def.h $(EXHEADER)
30
31ALL= $(GENERAL) $(SRC) $(HEADER)
32
33top:
34 (cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all)
35
36all: lib
37
38lib: $(LIBOBJ)
39 $(AR) $(LIB) $(LIBOBJ)
40 $(RANLIB) $(LIB) || echo Never mind.
41 @touch lib
42
43files:
44 $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
45
46links:
47 @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
48 @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
49 @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
50
51install:
52 @[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
53 @headerlist="$(EXHEADER)"; for i in $$headerlist ; \
54 do \
55 (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
56 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
57 done;
58
59tags:
60 ctags $(SRC)
61
62tests:
63
64lint:
65 lint -DLINT $(INCLUDES) $(SRC)>fluff
66
67depend:
68 @[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
69 $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(LIBSRC)
70
71dclean:
72 $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
73 mv -f Makefile.new $(MAKEFILE)
74
75clean:
76 rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
77
78# DO NOT DELETE THIS LINE -- make depend depends on it.
79
80conf_api.o: ../../e_os.h ../../include/openssl/bio.h
81conf_api.o: ../../include/openssl/conf.h ../../include/openssl/conf_api.h
82conf_api.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
83conf_api.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
84conf_api.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
85conf_api.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
86conf_api.o: ../../include/openssl/symhacks.h conf_api.c
87conf_def.o: ../../e_os.h ../../include/openssl/bio.h
88conf_def.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
89conf_def.o: ../../include/openssl/conf_api.h ../../include/openssl/crypto.h
90conf_def.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
91conf_def.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
92conf_def.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
93conf_def.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
94conf_def.o: ../../include/openssl/symhacks.h ../cryptlib.h conf_def.c
95conf_def.o: conf_def.h
96conf_err.o: ../../include/openssl/bio.h ../../include/openssl/conf.h
97conf_err.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
98conf_err.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
99conf_err.o: ../../include/openssl/opensslconf.h
100conf_err.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
101conf_err.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
102conf_err.o: ../../include/openssl/symhacks.h conf_err.c
103conf_lib.o: ../../include/openssl/bio.h ../../include/openssl/conf.h
104conf_lib.o: ../../include/openssl/conf_api.h ../../include/openssl/crypto.h
105conf_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
106conf_lib.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
107conf_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
108conf_lib.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
109conf_lib.o: ../../include/openssl/symhacks.h conf_lib.c
110conf_mall.o: ../../e_os.h ../../include/openssl/asn1.h
111conf_mall.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
112conf_mall.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
113conf_mall.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h
114conf_mall.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
115conf_mall.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
116conf_mall.o: ../../include/openssl/err.h ../../include/openssl/evp.h
117conf_mall.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
118conf_mall.o: ../../include/openssl/objects.h
119conf_mall.o: ../../include/openssl/opensslconf.h
120conf_mall.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
121conf_mall.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
122conf_mall.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
123conf_mall.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
124conf_mall.o: ../../include/openssl/x509_vfy.h ../cryptlib.h conf_mall.c
125conf_mod.o: ../../e_os.h ../../include/openssl/asn1.h
126conf_mod.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
127conf_mod.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
128conf_mod.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h
129conf_mod.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
130conf_mod.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
131conf_mod.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
132conf_mod.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
133conf_mod.o: ../../include/openssl/opensslconf.h
134conf_mod.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
135conf_mod.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
136conf_mod.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
137conf_mod.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
138conf_mod.o: ../../include/openssl/x509_vfy.h ../cryptlib.h conf_mod.c
139conf_sap.o: ../../e_os.h ../../include/openssl/asn1.h
140conf_sap.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
141conf_sap.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
142conf_sap.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h
143conf_sap.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
144conf_sap.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
145conf_sap.o: ../../include/openssl/err.h ../../include/openssl/evp.h
146conf_sap.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
147conf_sap.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
148conf_sap.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
149conf_sap.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
150conf_sap.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
151conf_sap.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
152conf_sap.o: ../../include/openssl/x509_vfy.h ../cryptlib.h conf_sap.c
diff --git a/src/lib/libcrypto/conf/Makefile.ssl b/src/lib/libcrypto/conf/Makefile.ssl
new file mode 100644
index 0000000000..c5873bc6e7
--- /dev/null
+++ b/src/lib/libcrypto/conf/Makefile.ssl
@@ -0,0 +1,183 @@
1#
2# SSLeay/crypto/conf/Makefile
3#
4
5DIR= conf
6TOP= ../..
7CC= cc
8INCLUDES= -I.. -I$(TOP) -I../../include
9CFLAG=-g
10INSTALL_PREFIX=
11OPENSSLDIR= /usr/local/ssl
12INSTALLTOP=/usr/local/ssl
13MAKE= make -f Makefile.ssl
14MAKEDEPPROG= makedepend
15MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
16MAKEFILE= Makefile.ssl
17AR= ar r
18
19CFLAGS= $(INCLUDES) $(CFLAG)
20
21GENERAL=Makefile
22TEST=
23APPS=
24
25LIB=$(TOP)/libcrypto.a
26LIBSRC= conf_err.c conf_lib.c conf_api.c conf_def.c conf_mod.c \
27 conf_mall.c conf_sap.c
28
29LIBOBJ= conf_err.o conf_lib.o conf_api.o conf_def.o conf_mod.o \
30 conf_mall.o conf_sap.o
31
32SRC= $(LIBSRC)
33
34EXHEADER= conf.h conf_api.h
35HEADER= conf_def.h $(EXHEADER)
36
37ALL= $(GENERAL) $(SRC) $(HEADER)
38
39top:
40 (cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all)
41
42all: lib
43
44lib: $(LIBOBJ)
45 $(AR) $(LIB) $(LIBOBJ)
46 $(RANLIB) $(LIB) || echo Never mind.
47 @touch lib
48
49files:
50 $(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
51
52links:
53 @sh $(TOP)/util/point.sh Makefile.ssl Makefile
54 @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
55 @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
56 @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
57
58install:
59 @for i in $(EXHEADER) ; \
60 do \
61 (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
62 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
63 done;
64
65tags:
66 ctags $(SRC)
67
68tests:
69
70lint:
71 lint -DLINT $(INCLUDES) $(SRC)>fluff
72
73depend:
74 $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(LIBSRC)
75
76dclean:
77 $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
78 mv -f Makefile.new $(MAKEFILE)
79
80clean:
81 rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
82
83# DO NOT DELETE THIS LINE -- make depend depends on it.
84
85conf_api.o: ../../e_os.h ../../include/openssl/bio.h
86conf_api.o: ../../include/openssl/conf.h ../../include/openssl/conf_api.h
87conf_api.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
88conf_api.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
89conf_api.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
90conf_api.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
91conf_api.o: conf_api.c
92conf_def.o: ../../e_os.h ../../include/openssl/bio.h
93conf_def.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
94conf_def.o: ../../include/openssl/conf_api.h ../../include/openssl/crypto.h
95conf_def.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
96conf_def.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
97conf_def.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
98conf_def.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
99conf_def.o: ../cryptlib.h conf_def.c conf_def.h
100conf_err.o: ../../include/openssl/bio.h ../../include/openssl/conf.h
101conf_err.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
102conf_err.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
103conf_err.o: ../../include/openssl/opensslconf.h
104conf_err.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
105conf_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
106conf_err.o: conf_err.c
107conf_lib.o: ../../include/openssl/bio.h ../../include/openssl/conf.h
108conf_lib.o: ../../include/openssl/conf_api.h ../../include/openssl/crypto.h
109conf_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
110conf_lib.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
111conf_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
112conf_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
113conf_lib.o: conf_lib.c
114conf_mall.o: ../../e_os.h ../../include/openssl/aes.h
115conf_mall.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
116conf_mall.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
117conf_mall.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
118conf_mall.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
119conf_mall.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
120conf_mall.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
121conf_mall.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h
122conf_mall.o: ../../include/openssl/engine.h ../../include/openssl/err.h
123conf_mall.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
124conf_mall.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
125conf_mall.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
126conf_mall.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
127conf_mall.o: ../../include/openssl/objects.h
128conf_mall.o: ../../include/openssl/opensslconf.h
129conf_mall.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
130conf_mall.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
131conf_mall.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
132conf_mall.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
133conf_mall.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
134conf_mall.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
135conf_mall.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
136conf_mall.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
137conf_mall.o: ../../include/openssl/x509_vfy.h ../cryptlib.h conf_mall.c
138conf_mod.o: ../../e_os.h ../../include/openssl/aes.h
139conf_mod.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
140conf_mod.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
141conf_mod.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
142conf_mod.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
143conf_mod.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
144conf_mod.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
145conf_mod.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h
146conf_mod.o: ../../include/openssl/err.h ../../include/openssl/evp.h
147conf_mod.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
148conf_mod.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
149conf_mod.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
150conf_mod.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
151conf_mod.o: ../../include/openssl/opensslconf.h
152conf_mod.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
153conf_mod.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
154conf_mod.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
155conf_mod.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
156conf_mod.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
157conf_mod.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
158conf_mod.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
159conf_mod.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
160conf_mod.o: ../cryptlib.h conf_mod.c
161conf_sap.o: ../../e_os.h ../../include/openssl/aes.h
162conf_sap.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
163conf_sap.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
164conf_sap.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
165conf_sap.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
166conf_sap.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
167conf_sap.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
168conf_sap.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h
169conf_sap.o: ../../include/openssl/engine.h ../../include/openssl/err.h
170conf_sap.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
171conf_sap.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
172conf_sap.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
173conf_sap.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
174conf_sap.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
175conf_sap.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
176conf_sap.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
177conf_sap.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
178conf_sap.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
179conf_sap.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
180conf_sap.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
181conf_sap.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
182conf_sap.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
183conf_sap.o: ../../include/openssl/x509_vfy.h ../cryptlib.h conf_sap.c
diff --git a/src/lib/libcrypto/conf/cnf_save.c b/src/lib/libcrypto/conf/cnf_save.c
new file mode 100644
index 0000000000..1439487526
--- /dev/null
+++ b/src/lib/libcrypto/conf/cnf_save.c
@@ -0,0 +1,106 @@
1/* crypto/conf/cnf_save.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#include <stdio.h>
60#include <openssl/conf.h>
61
62static void print_conf(CONF_VALUE *cv);
63static IMPLEMENT_LHASH_DOALL_FN(print_conf, CONF_VALUE *);
64
65main()
66 {
67 LHASH *conf;
68 long l;
69
70 conf=CONF_load(NULL,"../../apps/openssl.cnf",&l);
71 if (conf == NULL)
72 {
73 fprintf(stderr,"error loading config, line %ld\n",l);
74 exit(1);
75 }
76
77 lh_doall(conf,LHASH_DOALL_FN(print_conf));
78 }
79
80
81static void print_conf(CONF_VALUE *cv)
82 {
83 int i;
84 CONF_VALUE *v;
85 char *section;
86 char *name;
87 char *value;
88 STACK *s;
89
90 /* If it is a single entry, return */
91
92 if (cv->name != NULL) return;
93
94 printf("[ %s ]\n",cv->section);
95 s=(STACK *)cv->value;
96
97 for (i=0; i<sk_num(s); i++)
98 {
99 v=(CONF_VALUE *)sk_value(s,i);
100 section=(v->section == NULL)?"None":v->section;
101 name=(v->name == NULL)?"None":v->name;
102 value=(v->value == NULL)?"None":v->value;
103 printf("%s=%s\n",name,value);
104 }
105 printf("\n");
106 }
diff --git a/src/lib/libcrypto/conf/conf.h b/src/lib/libcrypto/conf/conf.h
index 8aa06bc5ec..f4671442ab 100644
--- a/src/lib/libcrypto/conf/conf.h
+++ b/src/lib/libcrypto/conf/conf.h
@@ -65,8 +65,6 @@
65#include <openssl/safestack.h> 65#include <openssl/safestack.h>
66#include <openssl/e_os2.h> 66#include <openssl/e_os2.h>
67 67
68#include <openssl/ossl_typ.h>
69
70#ifdef __cplusplus 68#ifdef __cplusplus
71extern "C" { 69extern "C" {
72#endif 70#endif
@@ -83,6 +81,7 @@ DECLARE_STACK_OF(CONF_MODULE)
83DECLARE_STACK_OF(CONF_IMODULE) 81DECLARE_STACK_OF(CONF_IMODULE)
84 82
85struct conf_st; 83struct conf_st;
84typedef struct conf_st CONF;
86struct conf_method_st; 85struct conf_method_st;
87typedef struct conf_method_st CONF_METHOD; 86typedef struct conf_method_st CONF_METHOD;
88 87
@@ -114,7 +113,6 @@ typedef void conf_finish_func(CONF_IMODULE *md);
114#define CONF_MFLAGS_SILENT 0x4 113#define CONF_MFLAGS_SILENT 0x4
115#define CONF_MFLAGS_NO_DSO 0x8 114#define CONF_MFLAGS_NO_DSO 0x8
116#define CONF_MFLAGS_IGNORE_MISSING_FILE 0x10 115#define CONF_MFLAGS_IGNORE_MISSING_FILE 0x10
117#define CONF_MFLAGS_DEFAULT_SECTION 0x20
118 116
119int CONF_set_default_method(CONF_METHOD *meth); 117int CONF_set_default_method(CONF_METHOD *meth);
120void CONF_set_nconf(CONF *conf,LHASH *hash); 118void CONF_set_nconf(CONF *conf,LHASH *hash);
@@ -214,8 +212,6 @@ void ERR_load_CONF_strings(void);
214#define CONF_F_CONF_LOAD_BIO 102 212#define CONF_F_CONF_LOAD_BIO 102
215#define CONF_F_CONF_LOAD_FP 103 213#define CONF_F_CONF_LOAD_FP 103
216#define CONF_F_CONF_MODULES_LOAD 116 214#define CONF_F_CONF_MODULES_LOAD 116
217#define CONF_F_DEF_LOAD 120
218#define CONF_F_DEF_LOAD_BIO 121
219#define CONF_F_MODULE_INIT 115 215#define CONF_F_MODULE_INIT 115
220#define CONF_F_MODULE_LOAD_DSO 117 216#define CONF_F_MODULE_LOAD_DSO 117
221#define CONF_F_MODULE_RUN 118 217#define CONF_F_MODULE_RUN 118
diff --git a/src/lib/libcrypto/conf/conf_api.c b/src/lib/libcrypto/conf/conf_api.c
index 909d72b4b8..0032baa711 100644
--- a/src/lib/libcrypto/conf/conf_api.c
+++ b/src/lib/libcrypto/conf/conf_api.c
@@ -121,7 +121,7 @@ int _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value)
121 v = (CONF_VALUE *)lh_insert(conf->data, value); 121 v = (CONF_VALUE *)lh_insert(conf->data, value);
122 if (v != NULL) 122 if (v != NULL)
123 { 123 {
124 (void)sk_CONF_VALUE_delete_ptr(ts,v); 124 sk_CONF_VALUE_delete_ptr(ts,v);
125 OPENSSL_free(v->name); 125 OPENSSL_free(v->name);
126 OPENSSL_free(v->value); 126 OPENSSL_free(v->value);
127 OPENSSL_free(v); 127 OPENSSL_free(v);
diff --git a/src/lib/libcrypto/conf/conf_def.c b/src/lib/libcrypto/conf/conf_def.c
index d8bce8732a..2464f8ed90 100644
--- a/src/lib/libcrypto/conf/conf_def.c
+++ b/src/lib/libcrypto/conf/conf_def.c
@@ -60,7 +60,6 @@
60 60
61#include <stdio.h> 61#include <stdio.h>
62#include <string.h> 62#include <string.h>
63#include "cryptlib.h"
64#include <openssl/stack.h> 63#include <openssl/stack.h>
65#include <openssl/lhash.h> 64#include <openssl/lhash.h>
66#include <openssl/conf.h> 65#include <openssl/conf.h>
@@ -68,6 +67,7 @@
68#include "conf_def.h" 67#include "conf_def.h"
69#include <openssl/buffer.h> 68#include <openssl/buffer.h>
70#include <openssl/err.h> 69#include <openssl/err.h>
70#include "cryptlib.h"
71 71
72static char *eat_ws(CONF *conf, char *p); 72static char *eat_ws(CONF *conf, char *p);
73static char *eat_alpha_numeric(CONF *conf, char *p); 73static char *eat_alpha_numeric(CONF *conf, char *p);
@@ -88,7 +88,7 @@ static int def_dump(const CONF *conf, BIO *bp);
88static int def_is_number(const CONF *conf, char c); 88static int def_is_number(const CONF *conf, char c);
89static int def_to_int(const CONF *conf, char c); 89static int def_to_int(const CONF *conf, char c);
90 90
91const char CONF_def_version[]="CONF_def" OPENSSL_VERSION_PTEXT; 91const char *CONF_def_version="CONF_def" OPENSSL_VERSION_PTEXT;
92 92
93static CONF_METHOD default_method = { 93static CONF_METHOD default_method = {
94 "OpenSSL default", 94 "OpenSSL default",
@@ -194,9 +194,9 @@ static int def_load(CONF *conf, const char *name, long *line)
194 if (in == NULL) 194 if (in == NULL)
195 { 195 {
196 if (ERR_GET_REASON(ERR_peek_last_error()) == BIO_R_NO_SUCH_FILE) 196 if (ERR_GET_REASON(ERR_peek_last_error()) == BIO_R_NO_SUCH_FILE)
197 CONFerr(CONF_F_DEF_LOAD,CONF_R_NO_SUCH_FILE); 197 CONFerr(CONF_F_CONF_LOAD,CONF_R_NO_SUCH_FILE);
198 else 198 else
199 CONFerr(CONF_F_DEF_LOAD,ERR_R_SYS_LIB); 199 CONFerr(CONF_F_CONF_LOAD,ERR_R_SYS_LIB);
200 return 0; 200 return 0;
201 } 201 }
202 202
@@ -225,28 +225,28 @@ static int def_load_bio(CONF *conf, BIO *in, long *line)
225 225
226 if ((buff=BUF_MEM_new()) == NULL) 226 if ((buff=BUF_MEM_new()) == NULL)
227 { 227 {
228 CONFerr(CONF_F_DEF_LOAD_BIO,ERR_R_BUF_LIB); 228 CONFerr(CONF_F_CONF_LOAD_BIO,ERR_R_BUF_LIB);
229 goto err; 229 goto err;
230 } 230 }
231 231
232 section=(char *)OPENSSL_malloc(10); 232 section=(char *)OPENSSL_malloc(10);
233 if (section == NULL) 233 if (section == NULL)
234 { 234 {
235 CONFerr(CONF_F_DEF_LOAD_BIO,ERR_R_MALLOC_FAILURE); 235 CONFerr(CONF_F_CONF_LOAD_BIO,ERR_R_MALLOC_FAILURE);
236 goto err; 236 goto err;
237 } 237 }
238 BUF_strlcpy(section,"default",10); 238 BUF_strlcpy(section,"default",10);
239 239
240 if (_CONF_new_data(conf) == 0) 240 if (_CONF_new_data(conf) == 0)
241 { 241 {
242 CONFerr(CONF_F_DEF_LOAD_BIO,ERR_R_MALLOC_FAILURE); 242 CONFerr(CONF_F_CONF_LOAD_BIO,ERR_R_MALLOC_FAILURE);
243 goto err; 243 goto err;
244 } 244 }
245 245
246 sv=_CONF_new_section(conf,section); 246 sv=_CONF_new_section(conf,section);
247 if (sv == NULL) 247 if (sv == NULL)
248 { 248 {
249 CONFerr(CONF_F_DEF_LOAD_BIO, 249 CONFerr(CONF_F_CONF_LOAD_BIO,
250 CONF_R_UNABLE_TO_CREATE_NEW_SECTION); 250 CONF_R_UNABLE_TO_CREATE_NEW_SECTION);
251 goto err; 251 goto err;
252 } 252 }
@@ -258,7 +258,7 @@ static int def_load_bio(CONF *conf, BIO *in, long *line)
258 { 258 {
259 if (!BUF_MEM_grow(buff,bufnum+CONFBUFSIZE)) 259 if (!BUF_MEM_grow(buff,bufnum+CONFBUFSIZE))
260 { 260 {
261 CONFerr(CONF_F_DEF_LOAD_BIO,ERR_R_BUF_LIB); 261 CONFerr(CONF_F_CONF_LOAD_BIO,ERR_R_BUF_LIB);
262 goto err; 262 goto err;
263 } 263 }
264 p= &(buff->data[bufnum]); 264 p= &(buff->data[bufnum]);
@@ -329,7 +329,7 @@ again:
329 ss=p; 329 ss=p;
330 goto again; 330 goto again;
331 } 331 }
332 CONFerr(CONF_F_DEF_LOAD_BIO, 332 CONFerr(CONF_F_CONF_LOAD_BIO,
333 CONF_R_MISSING_CLOSE_SQUARE_BRACKET); 333 CONF_R_MISSING_CLOSE_SQUARE_BRACKET);
334 goto err; 334 goto err;
335 } 335 }
@@ -339,7 +339,7 @@ again:
339 sv=_CONF_new_section(conf,section); 339 sv=_CONF_new_section(conf,section);
340 if (sv == NULL) 340 if (sv == NULL)
341 { 341 {
342 CONFerr(CONF_F_DEF_LOAD_BIO, 342 CONFerr(CONF_F_CONF_LOAD_BIO,
343 CONF_R_UNABLE_TO_CREATE_NEW_SECTION); 343 CONF_R_UNABLE_TO_CREATE_NEW_SECTION);
344 goto err; 344 goto err;
345 } 345 }
@@ -362,7 +362,7 @@ again:
362 p=eat_ws(conf, end); 362 p=eat_ws(conf, end);
363 if (*p != '=') 363 if (*p != '=')
364 { 364 {
365 CONFerr(CONF_F_DEF_LOAD_BIO, 365 CONFerr(CONF_F_CONF_LOAD_BIO,
366 CONF_R_MISSING_EQUAL_SIGN); 366 CONF_R_MISSING_EQUAL_SIGN);
367 goto err; 367 goto err;
368 } 368 }
@@ -379,7 +379,7 @@ again:
379 379
380 if (!(v=(CONF_VALUE *)OPENSSL_malloc(sizeof(CONF_VALUE)))) 380 if (!(v=(CONF_VALUE *)OPENSSL_malloc(sizeof(CONF_VALUE))))
381 { 381 {
382 CONFerr(CONF_F_DEF_LOAD_BIO, 382 CONFerr(CONF_F_CONF_LOAD_BIO,
383 ERR_R_MALLOC_FAILURE); 383 ERR_R_MALLOC_FAILURE);
384 goto err; 384 goto err;
385 } 385 }
@@ -388,7 +388,7 @@ again:
388 v->value=NULL; 388 v->value=NULL;
389 if (v->name == NULL) 389 if (v->name == NULL)
390 { 390 {
391 CONFerr(CONF_F_DEF_LOAD_BIO, 391 CONFerr(CONF_F_CONF_LOAD_BIO,
392 ERR_R_MALLOC_FAILURE); 392 ERR_R_MALLOC_FAILURE);
393 goto err; 393 goto err;
394 } 394 }
@@ -402,7 +402,7 @@ again:
402 tv=_CONF_new_section(conf,psection); 402 tv=_CONF_new_section(conf,psection);
403 if (tv == NULL) 403 if (tv == NULL)
404 { 404 {
405 CONFerr(CONF_F_DEF_LOAD_BIO, 405 CONFerr(CONF_F_CONF_LOAD_BIO,
406 CONF_R_UNABLE_TO_CREATE_NEW_SECTION); 406 CONF_R_UNABLE_TO_CREATE_NEW_SECTION);
407 goto err; 407 goto err;
408 } 408 }
@@ -416,7 +416,7 @@ again:
416#if 1 416#if 1
417 if (_CONF_add_string(conf, tv, v) == 0) 417 if (_CONF_add_string(conf, tv, v) == 0)
418 { 418 {
419 CONFerr(CONF_F_DEF_LOAD_BIO, 419 CONFerr(CONF_F_CONF_LOAD_BIO,
420 ERR_R_MALLOC_FAILURE); 420 ERR_R_MALLOC_FAILURE);
421 goto err; 421 goto err;
422 } 422 }
@@ -424,7 +424,7 @@ again:
424 v->section=tv->section; 424 v->section=tv->section;
425 if (!sk_CONF_VALUE_push(ts,v)) 425 if (!sk_CONF_VALUE_push(ts,v))
426 { 426 {
427 CONFerr(CONF_F_DEF_LOAD_BIO, 427 CONFerr(CONF_F_CONF_LOAD_BIO,
428 ERR_R_MALLOC_FAILURE); 428 ERR_R_MALLOC_FAILURE);
429 goto err; 429 goto err;
430 } 430 }
@@ -629,7 +629,7 @@ static int str_copy(CONF *conf, char *section, char **pto, char *from)
629 CONFerr(CONF_F_STR_COPY,CONF_R_VARIABLE_HAS_NO_VALUE); 629 CONFerr(CONF_F_STR_COPY,CONF_R_VARIABLE_HAS_NO_VALUE);
630 goto err; 630 goto err;
631 } 631 }
632 BUF_MEM_grow_clean(buf,(strlen(p)+buf->length-(e-from))); 632 BUF_MEM_grow_clean(buf,(strlen(p)+len-(e-from)));
633 while (*p) 633 while (*p)
634 buf->data[to++]= *(p++); 634 buf->data[to++]= *(p++);
635 635
diff --git a/src/lib/libcrypto/conf/conf_err.c b/src/lib/libcrypto/conf/conf_err.c
index a16a5e0bd4..f5e2ca4bf0 100644
--- a/src/lib/libcrypto/conf/conf_err.c
+++ b/src/lib/libcrypto/conf/conf_err.c
@@ -75,8 +75,6 @@ static ERR_STRING_DATA CONF_str_functs[]=
75{ERR_FUNC(CONF_F_CONF_LOAD_BIO), "CONF_load_bio"}, 75{ERR_FUNC(CONF_F_CONF_LOAD_BIO), "CONF_load_bio"},
76{ERR_FUNC(CONF_F_CONF_LOAD_FP), "CONF_load_fp"}, 76{ERR_FUNC(CONF_F_CONF_LOAD_FP), "CONF_load_fp"},
77{ERR_FUNC(CONF_F_CONF_MODULES_LOAD), "CONF_modules_load"}, 77{ERR_FUNC(CONF_F_CONF_MODULES_LOAD), "CONF_modules_load"},
78{ERR_FUNC(CONF_F_DEF_LOAD), "DEF_LOAD"},
79{ERR_FUNC(CONF_F_DEF_LOAD_BIO), "DEF_LOAD_BIO"},
80{ERR_FUNC(CONF_F_MODULE_INIT), "MODULE_INIT"}, 78{ERR_FUNC(CONF_F_MODULE_INIT), "MODULE_INIT"},
81{ERR_FUNC(CONF_F_MODULE_LOAD_DSO), "MODULE_LOAD_DSO"}, 79{ERR_FUNC(CONF_F_MODULE_LOAD_DSO), "MODULE_LOAD_DSO"},
82{ERR_FUNC(CONF_F_MODULE_RUN), "MODULE_RUN"}, 80{ERR_FUNC(CONF_F_MODULE_RUN), "MODULE_RUN"},
@@ -118,12 +116,15 @@ static ERR_STRING_DATA CONF_str_reasons[]=
118 116
119void ERR_load_CONF_strings(void) 117void ERR_load_CONF_strings(void)
120 { 118 {
121#ifndef OPENSSL_NO_ERR 119 static int init=1;
122 120
123 if (ERR_func_error_string(CONF_str_functs[0].error) == NULL) 121 if (init)
124 { 122 {
123 init=0;
124#ifndef OPENSSL_NO_ERR
125 ERR_load_strings(0,CONF_str_functs); 125 ERR_load_strings(0,CONF_str_functs);
126 ERR_load_strings(0,CONF_str_reasons); 126 ERR_load_strings(0,CONF_str_reasons);
127 }
128#endif 127#endif
128
129 }
129 } 130 }
diff --git a/src/lib/libcrypto/conf/conf_lib.c b/src/lib/libcrypto/conf/conf_lib.c
index 2a3399d269..6a3cf109dd 100644
--- a/src/lib/libcrypto/conf/conf_lib.c
+++ b/src/lib/libcrypto/conf/conf_lib.c
@@ -63,7 +63,7 @@
63#include <openssl/conf_api.h> 63#include <openssl/conf_api.h>
64#include <openssl/lhash.h> 64#include <openssl/lhash.h>
65 65
66const char CONF_version[]="CONF" OPENSSL_VERSION_PTEXT; 66const char *CONF_version="CONF" OPENSSL_VERSION_PTEXT;
67 67
68static CONF_METHOD *default_CONF_method=NULL; 68static CONF_METHOD *default_CONF_method=NULL;
69 69
@@ -184,7 +184,7 @@ long CONF_get_number(LHASH *conf,const char *group,const char *name)
184 if (status == 0) 184 if (status == 0)
185 { 185 {
186 /* This function does not believe in errors... */ 186 /* This function does not believe in errors... */
187 ERR_clear_error(); 187 ERR_get_error();
188 } 188 }
189 return result; 189 return result;
190 } 190 }
diff --git a/src/lib/libcrypto/conf/conf_mod.c b/src/lib/libcrypto/conf/conf_mod.c
index 628e8333a6..812e60dc70 100644
--- a/src/lib/libcrypto/conf/conf_mod.c
+++ b/src/lib/libcrypto/conf/conf_mod.c
@@ -126,18 +126,17 @@ int CONF_modules_load(const CONF *cnf, const char *appname,
126 { 126 {
127 STACK_OF(CONF_VALUE) *values; 127 STACK_OF(CONF_VALUE) *values;
128 CONF_VALUE *vl; 128 CONF_VALUE *vl;
129 char *vsection = NULL; 129 char *vsection;
130 130
131 int ret, i; 131 int ret, i;
132 132
133 if (!cnf) 133 if (!cnf)
134 return 1; 134 return 1;
135 135
136 if (appname) 136 if (appname == NULL)
137 vsection = NCONF_get_string(cnf, NULL, appname); 137 appname = "openssl_conf";
138 138
139 if (!appname || (!vsection && (flags & CONF_MFLAGS_DEFAULT_SECTION))) 139 vsection = NCONF_get_string(cnf, NULL, appname);
140 vsection = NCONF_get_string(cnf, NULL, "openssl_conf");
141 140
142 if (!vsection) 141 if (!vsection)
143 { 142 {
@@ -232,7 +231,7 @@ static int module_run(const CONF *cnf, char *name, char *value,
232 if (!(flags & CONF_MFLAGS_SILENT)) 231 if (!(flags & CONF_MFLAGS_SILENT))
233 { 232 {
234 char rcode[DECIMAL_SIZE(ret)+1]; 233 char rcode[DECIMAL_SIZE(ret)+1];
235 CONFerr(CONF_F_MODULE_RUN, CONF_R_MODULE_INITIALIZATION_ERROR); 234 CONFerr(CONF_F_CONF_MODULES_LOAD, CONF_R_MODULE_INITIALIZATION_ERROR);
236 BIO_snprintf(rcode, sizeof rcode, "%-8d", ret); 235 BIO_snprintf(rcode, sizeof rcode, "%-8d", ret);
237 ERR_add_error_data(6, "module=", name, ", value=", value, ", retcode=", rcode); 236 ERR_add_error_data(6, "module=", name, ", value=", value, ", retcode=", rcode);
238 } 237 }
@@ -255,7 +254,7 @@ static CONF_MODULE *module_load_dso(const CONF *cnf, char *name, char *value,
255 path = NCONF_get_string(cnf, value, "path"); 254 path = NCONF_get_string(cnf, value, "path");
256 if (!path) 255 if (!path)
257 { 256 {
258 ERR_clear_error(); 257 ERR_get_error();
259 path = name; 258 path = name;
260 } 259 }
261 dso = DSO_load(NULL, path, NULL, 0); 260 dso = DSO_load(NULL, path, NULL, 0);
@@ -432,7 +431,7 @@ void CONF_modules_unload(int all)
432 if (((md->links > 0) || !md->dso) && !all) 431 if (((md->links > 0) || !md->dso) && !all)
433 continue; 432 continue;
434 /* Since we're working in reverse this is OK */ 433 /* Since we're working in reverse this is OK */
435 (void)sk_CONF_MODULE_delete(supported_modules, i); 434 sk_CONF_MODULE_delete(supported_modules, i);
436 module_free(md); 435 module_free(md);
437 } 436 }
438 if (sk_CONF_MODULE_num(supported_modules) == 0) 437 if (sk_CONF_MODULE_num(supported_modules) == 0)
@@ -588,7 +587,7 @@ int CONF_parse_list(const char *list_, int sep, int nospc,
588 { 587 {
589 if (nospc) 588 if (nospc)
590 { 589 {
591 while(*lstart && isspace((unsigned char)*lstart)) 590 while(isspace((unsigned char)*lstart))
592 lstart++; 591 lstart++;
593 } 592 }
594 p = strchr(lstart, sep); 593 p = strchr(lstart, sep);
diff --git a/src/lib/libcrypto/conf/conf_sap.c b/src/lib/libcrypto/conf/conf_sap.c
index 9c53bac1a8..e15c2e5546 100644
--- a/src/lib/libcrypto/conf/conf_sap.c
+++ b/src/lib/libcrypto/conf/conf_sap.c
@@ -88,8 +88,8 @@ void OPENSSL_config(const char *config_name)
88 88
89 89
90 ERR_clear_error(); 90 ERR_clear_error();
91 if (CONF_modules_load_file(NULL, config_name, 91 if (CONF_modules_load_file(NULL, NULL,
92 CONF_MFLAGS_DEFAULT_SECTION|CONF_MFLAGS_IGNORE_MISSING_FILE) <= 0) 92 CONF_MFLAGS_IGNORE_MISSING_FILE) <= 0)
93 { 93 {
94 BIO *bio_err; 94 BIO *bio_err;
95 ERR_load_crypto_strings(); 95 ERR_load_crypto_strings();
diff --git a/src/lib/libcrypto/conf/test.c b/src/lib/libcrypto/conf/test.c
new file mode 100644
index 0000000000..7fab85053e
--- /dev/null
+++ b/src/lib/libcrypto/conf/test.c
@@ -0,0 +1,98 @@
1/* crypto/conf/test.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#include <stdio.h>
60#include <stdlib.h>
61#include <openssl/conf.h>
62#include <openssl/err.h>
63
64main()
65 {
66 LHASH *conf;
67 long eline;
68 char *s,*s2;
69
70#ifdef USE_WIN32
71 CONF_set_default_method(CONF_WIN32);
72#endif
73 conf=CONF_load(NULL,"ssleay.cnf",&eline);
74 if (conf == NULL)
75 {
76 ERR_load_crypto_strings();
77 printf("unable to load configuration, line %ld\n",eline);
78 ERR_print_errors_fp(stderr);
79 exit(1);
80 }
81 lh_stats(conf,stdout);
82 lh_node_stats(conf,stdout);
83 lh_node_usage_stats(conf,stdout);
84
85 s=CONF_get_string(conf,NULL,"init2");
86 printf("init2=%s\n",(s == NULL)?"NULL":s);
87
88 s=CONF_get_string(conf,NULL,"cipher1");
89 printf("cipher1=%s\n",(s == NULL)?"NULL":s);
90
91 s=CONF_get_string(conf,"s_client","cipher1");
92 printf("s_client:cipher1=%s\n",(s == NULL)?"NULL":s);
93
94 printf("---------------------------- DUMP ------------------------\n");
95 CONF_dump_fp(conf, stdout);
96
97 exit(0);
98 }