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/Makefile181
-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_def.c13
-rw-r--r--src/lib/libcrypto/conf/conf_err.c78
-rw-r--r--src/lib/libcrypto/conf/test.c98
6 files changed, 609 insertions, 50 deletions
diff --git a/src/lib/libcrypto/conf/Makefile b/src/lib/libcrypto/conf/Makefile
new file mode 100644
index 0000000000..403d12b28c
--- /dev/null
+++ b/src/lib/libcrypto/conf/Makefile
@@ -0,0 +1,181 @@
1#
2# OpenSSL/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
13MAKEDEPPROG= makedepend
14MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
15MAKEFILE= Makefile
16AR= ar r
17
18CFLAGS= $(INCLUDES) $(CFLAG)
19
20GENERAL=Makefile
21TEST=
22APPS=
23
24LIB=$(TOP)/libcrypto.a
25LIBSRC= conf_err.c conf_lib.c conf_api.c conf_def.c conf_mod.c \
26 conf_mall.c conf_sap.c
27
28LIBOBJ= conf_err.o conf_lib.o conf_api.o conf_def.o conf_mod.o \
29 conf_mall.o conf_sap.o
30
31SRC= $(LIBSRC)
32
33EXHEADER= conf.h conf_api.h
34HEADER= conf_def.h $(EXHEADER)
35
36ALL= $(GENERAL) $(SRC) $(HEADER)
37
38top:
39 (cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all)
40
41all: lib
42
43lib: $(LIBOBJ)
44 $(AR) $(LIB) $(LIBOBJ)
45 $(RANLIB) $(LIB) || echo Never mind.
46 @touch lib
47
48files:
49 $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
50
51links:
52 @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
53 @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
54 @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
55
56install:
57 @headerlist="$(EXHEADER)"; for i in $$headerlist ; \
58 do \
59 (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
60 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
61 done;
62
63tags:
64 ctags $(SRC)
65
66tests:
67
68lint:
69 lint -DLINT $(INCLUDES) $(SRC)>fluff
70
71depend:
72 $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(LIBSRC)
73
74dclean:
75 $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
76 mv -f Makefile.new $(MAKEFILE)
77
78clean:
79 rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
80
81# DO NOT DELETE THIS LINE -- make depend depends on it.
82
83conf_api.o: ../../e_os.h ../../include/openssl/bio.h
84conf_api.o: ../../include/openssl/conf.h ../../include/openssl/conf_api.h
85conf_api.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
86conf_api.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
87conf_api.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
88conf_api.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
89conf_api.o: conf_api.c
90conf_def.o: ../../e_os.h ../../include/openssl/bio.h
91conf_def.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
92conf_def.o: ../../include/openssl/conf_api.h ../../include/openssl/crypto.h
93conf_def.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
94conf_def.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
95conf_def.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
96conf_def.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
97conf_def.o: ../cryptlib.h conf_def.c conf_def.h
98conf_err.o: ../../include/openssl/bio.h ../../include/openssl/conf.h
99conf_err.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
100conf_err.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
101conf_err.o: ../../include/openssl/opensslconf.h
102conf_err.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
103conf_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
104conf_err.o: conf_err.c
105conf_lib.o: ../../include/openssl/bio.h ../../include/openssl/conf.h
106conf_lib.o: ../../include/openssl/conf_api.h ../../include/openssl/crypto.h
107conf_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
108conf_lib.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
109conf_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
110conf_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
111conf_lib.o: conf_lib.c
112conf_mall.o: ../../e_os.h ../../include/openssl/aes.h
113conf_mall.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
114conf_mall.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
115conf_mall.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
116conf_mall.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
117conf_mall.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
118conf_mall.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
119conf_mall.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h
120conf_mall.o: ../../include/openssl/engine.h ../../include/openssl/err.h
121conf_mall.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
122conf_mall.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
123conf_mall.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
124conf_mall.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
125conf_mall.o: ../../include/openssl/objects.h
126conf_mall.o: ../../include/openssl/opensslconf.h
127conf_mall.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
128conf_mall.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
129conf_mall.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
130conf_mall.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
131conf_mall.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
132conf_mall.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
133conf_mall.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
134conf_mall.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
135conf_mall.o: ../../include/openssl/x509_vfy.h ../cryptlib.h conf_mall.c
136conf_mod.o: ../../e_os.h ../../include/openssl/aes.h
137conf_mod.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
138conf_mod.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
139conf_mod.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
140conf_mod.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
141conf_mod.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
142conf_mod.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
143conf_mod.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h
144conf_mod.o: ../../include/openssl/err.h ../../include/openssl/evp.h
145conf_mod.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
146conf_mod.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
147conf_mod.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
148conf_mod.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
149conf_mod.o: ../../include/openssl/opensslconf.h
150conf_mod.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
151conf_mod.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
152conf_mod.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
153conf_mod.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
154conf_mod.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
155conf_mod.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
156conf_mod.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
157conf_mod.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
158conf_mod.o: ../cryptlib.h conf_mod.c
159conf_sap.o: ../../e_os.h ../../include/openssl/aes.h
160conf_sap.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
161conf_sap.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
162conf_sap.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
163conf_sap.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
164conf_sap.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
165conf_sap.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
166conf_sap.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h
167conf_sap.o: ../../include/openssl/engine.h ../../include/openssl/err.h
168conf_sap.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
169conf_sap.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
170conf_sap.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
171conf_sap.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
172conf_sap.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
173conf_sap.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
174conf_sap.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
175conf_sap.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
176conf_sap.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
177conf_sap.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
178conf_sap.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
179conf_sap.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
180conf_sap.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
181conf_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_def.c b/src/lib/libcrypto/conf/conf_def.c
index 2464f8ed90..b5a876ae68 100644
--- a/src/lib/libcrypto/conf/conf_def.c
+++ b/src/lib/libcrypto/conf/conf_def.c
@@ -613,13 +613,13 @@ static int str_copy(CONF *conf, char *section, char **pto, char *from)
613 e++; 613 e++;
614 } 614 }
615 /* So at this point we have 615 /* So at this point we have
616 * np which is the start of the name string which is 616 * ns which is the start of the name string which is
617 * '\0' terminated. 617 * '\0' terminated.
618 * cp which is the start of the section string which is 618 * cs which is the start of the section string which is
619 * '\0' terminated. 619 * '\0' terminated.
620 * e is the 'next point after'. 620 * e is the 'next point after'.
621 * r and rr are the chars replaced by the '\0' 621 * r and s are the chars replaced by the '\0'
622 * rp and rrp is where 'r' and 'rr' came from. 622 * rp and sp is where 'r' and 's' came from.
623 */ 623 */
624 p=_CONF_get_string(conf,cp,np); 624 p=_CONF_get_string(conf,cp,np);
625 if (rrp != NULL) *rrp=rr; 625 if (rrp != NULL) *rrp=rr;
@@ -638,11 +638,6 @@ static int str_copy(CONF *conf, char *section, char **pto, char *from)
638 points at. /RL */ 638 points at. /RL */
639 len -= e-from; 639 len -= e-from;
640 from=e; 640 from=e;
641
642 /* In case there were no braces or parenthesis around
643 the variable reference, we have to put back the
644 character that was replaced with a '\0'. /RL */
645 *rp = r;
646 } 641 }
647 else 642 else
648 buf->data[to++]= *(from++); 643 buf->data[to++]= *(from++);
diff --git a/src/lib/libcrypto/conf/conf_err.c b/src/lib/libcrypto/conf/conf_err.c
index f5e2ca4bf0..ee07bfe9d9 100644
--- a/src/lib/libcrypto/conf/conf_err.c
+++ b/src/lib/libcrypto/conf/conf_err.c
@@ -1,6 +1,6 @@
1/* crypto/conf/conf_err.c */ 1/* crypto/conf/conf_err.c */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1999 The OpenSSL Project. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
@@ -64,51 +64,47 @@
64 64
65/* BEGIN ERROR CODES */ 65/* BEGIN ERROR CODES */
66#ifndef OPENSSL_NO_ERR 66#ifndef OPENSSL_NO_ERR
67
68#define ERR_FUNC(func) ERR_PACK(ERR_LIB_CONF,func,0)
69#define ERR_REASON(reason) ERR_PACK(ERR_LIB_CONF,0,reason)
70
71static ERR_STRING_DATA CONF_str_functs[]= 67static ERR_STRING_DATA CONF_str_functs[]=
72 { 68 {
73{ERR_FUNC(CONF_F_CONF_DUMP_FP), "CONF_dump_fp"}, 69{ERR_PACK(0,CONF_F_CONF_DUMP_FP,0), "CONF_dump_fp"},
74{ERR_FUNC(CONF_F_CONF_LOAD), "CONF_load"}, 70{ERR_PACK(0,CONF_F_CONF_LOAD,0), "CONF_load"},
75{ERR_FUNC(CONF_F_CONF_LOAD_BIO), "CONF_load_bio"}, 71{ERR_PACK(0,CONF_F_CONF_LOAD_BIO,0), "CONF_load_bio"},
76{ERR_FUNC(CONF_F_CONF_LOAD_FP), "CONF_load_fp"}, 72{ERR_PACK(0,CONF_F_CONF_LOAD_FP,0), "CONF_load_fp"},
77{ERR_FUNC(CONF_F_CONF_MODULES_LOAD), "CONF_modules_load"}, 73{ERR_PACK(0,CONF_F_CONF_MODULES_LOAD,0), "CONF_modules_load"},
78{ERR_FUNC(CONF_F_MODULE_INIT), "MODULE_INIT"}, 74{ERR_PACK(0,CONF_F_MODULE_INIT,0), "MODULE_INIT"},
79{ERR_FUNC(CONF_F_MODULE_LOAD_DSO), "MODULE_LOAD_DSO"}, 75{ERR_PACK(0,CONF_F_MODULE_LOAD_DSO,0), "MODULE_LOAD_DSO"},
80{ERR_FUNC(CONF_F_MODULE_RUN), "MODULE_RUN"}, 76{ERR_PACK(0,CONF_F_MODULE_RUN,0), "MODULE_RUN"},
81{ERR_FUNC(CONF_F_NCONF_DUMP_BIO), "NCONF_dump_bio"}, 77{ERR_PACK(0,CONF_F_NCONF_DUMP_BIO,0), "NCONF_dump_bio"},
82{ERR_FUNC(CONF_F_NCONF_DUMP_FP), "NCONF_dump_fp"}, 78{ERR_PACK(0,CONF_F_NCONF_DUMP_FP,0), "NCONF_dump_fp"},
83{ERR_FUNC(CONF_F_NCONF_GET_NUMBER), "NCONF_get_number"}, 79{ERR_PACK(0,CONF_F_NCONF_GET_NUMBER,0), "NCONF_get_number"},
84{ERR_FUNC(CONF_F_NCONF_GET_NUMBER_E), "NCONF_get_number_e"}, 80{ERR_PACK(0,CONF_F_NCONF_GET_NUMBER_E,0), "NCONF_get_number_e"},
85{ERR_FUNC(CONF_F_NCONF_GET_SECTION), "NCONF_get_section"}, 81{ERR_PACK(0,CONF_F_NCONF_GET_SECTION,0), "NCONF_get_section"},
86{ERR_FUNC(CONF_F_NCONF_GET_STRING), "NCONF_get_string"}, 82{ERR_PACK(0,CONF_F_NCONF_GET_STRING,0), "NCONF_get_string"},
87{ERR_FUNC(CONF_F_NCONF_LOAD), "NCONF_load"}, 83{ERR_PACK(0,CONF_F_NCONF_LOAD,0), "NCONF_load"},
88{ERR_FUNC(CONF_F_NCONF_LOAD_BIO), "NCONF_load_bio"}, 84{ERR_PACK(0,CONF_F_NCONF_LOAD_BIO,0), "NCONF_load_bio"},
89{ERR_FUNC(CONF_F_NCONF_LOAD_FP), "NCONF_load_fp"}, 85{ERR_PACK(0,CONF_F_NCONF_LOAD_FP,0), "NCONF_load_fp"},
90{ERR_FUNC(CONF_F_NCONF_NEW), "NCONF_new"}, 86{ERR_PACK(0,CONF_F_NCONF_NEW,0), "NCONF_new"},
91{ERR_FUNC(CONF_F_STR_COPY), "STR_COPY"}, 87{ERR_PACK(0,CONF_F_STR_COPY,0), "STR_COPY"},
92{0,NULL} 88{0,NULL}
93 }; 89 };
94 90
95static ERR_STRING_DATA CONF_str_reasons[]= 91static ERR_STRING_DATA CONF_str_reasons[]=
96 { 92 {
97{ERR_REASON(CONF_R_ERROR_LOADING_DSO) ,"error loading dso"}, 93{CONF_R_ERROR_LOADING_DSO ,"error loading dso"},
98{ERR_REASON(CONF_R_MISSING_CLOSE_SQUARE_BRACKET),"missing close square bracket"}, 94{CONF_R_MISSING_CLOSE_SQUARE_BRACKET ,"missing close square bracket"},
99{ERR_REASON(CONF_R_MISSING_EQUAL_SIGN) ,"missing equal sign"}, 95{CONF_R_MISSING_EQUAL_SIGN ,"missing equal sign"},
100{ERR_REASON(CONF_R_MISSING_FINISH_FUNCTION),"missing finish function"}, 96{CONF_R_MISSING_FINISH_FUNCTION ,"missing finish function"},
101{ERR_REASON(CONF_R_MISSING_INIT_FUNCTION),"missing init function"}, 97{CONF_R_MISSING_INIT_FUNCTION ,"missing init function"},
102{ERR_REASON(CONF_R_MODULE_INITIALIZATION_ERROR),"module initialization error"}, 98{CONF_R_MODULE_INITIALIZATION_ERROR ,"module initialization error"},
103{ERR_REASON(CONF_R_NO_CLOSE_BRACE) ,"no close brace"}, 99{CONF_R_NO_CLOSE_BRACE ,"no close brace"},
104{ERR_REASON(CONF_R_NO_CONF) ,"no conf"}, 100{CONF_R_NO_CONF ,"no conf"},
105{ERR_REASON(CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE),"no conf or environment variable"}, 101{CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE ,"no conf or environment variable"},
106{ERR_REASON(CONF_R_NO_SECTION) ,"no section"}, 102{CONF_R_NO_SECTION ,"no section"},
107{ERR_REASON(CONF_R_NO_SUCH_FILE) ,"no such file"}, 103{CONF_R_NO_SUCH_FILE ,"no such file"},
108{ERR_REASON(CONF_R_NO_VALUE) ,"no value"}, 104{CONF_R_NO_VALUE ,"no value"},
109{ERR_REASON(CONF_R_UNABLE_TO_CREATE_NEW_SECTION),"unable to create new section"}, 105{CONF_R_UNABLE_TO_CREATE_NEW_SECTION ,"unable to create new section"},
110{ERR_REASON(CONF_R_UNKNOWN_MODULE_NAME) ,"unknown module name"}, 106{CONF_R_UNKNOWN_MODULE_NAME ,"unknown module name"},
111{ERR_REASON(CONF_R_VARIABLE_HAS_NO_VALUE),"variable has no value"}, 107{CONF_R_VARIABLE_HAS_NO_VALUE ,"variable has no value"},
112{0,NULL} 108{0,NULL}
113 }; 109 };
114 110
@@ -122,8 +118,8 @@ void ERR_load_CONF_strings(void)
122 { 118 {
123 init=0; 119 init=0;
124#ifndef OPENSSL_NO_ERR 120#ifndef OPENSSL_NO_ERR
125 ERR_load_strings(0,CONF_str_functs); 121 ERR_load_strings(ERR_LIB_CONF,CONF_str_functs);
126 ERR_load_strings(0,CONF_str_reasons); 122 ERR_load_strings(ERR_LIB_CONF,CONF_str_reasons);
127#endif 123#endif
128 124
129 } 125 }
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 }