diff options
Diffstat (limited to 'src/lib/libssl/test')
61 files changed, 6150 insertions, 0 deletions
diff --git a/src/lib/libssl/test/CAss.cnf b/src/lib/libssl/test/CAss.cnf new file mode 100644 index 0000000000..21da59a73a --- /dev/null +++ b/src/lib/libssl/test/CAss.cnf | |||
@@ -0,0 +1,33 @@ | |||
1 | # | ||
2 | # SSLeay example configuration file. | ||
3 | # This is mostly being used for generation of certificate requests. | ||
4 | # | ||
5 | |||
6 | RANDFILE = ./.rnd | ||
7 | |||
8 | #################################################################### | ||
9 | [ req ] | ||
10 | default_bits = 512 | ||
11 | default_keyfile = keySS.pem | ||
12 | distinguished_name = req_distinguished_name | ||
13 | encrypt_rsa_key = no | ||
14 | default_md = sha1 | ||
15 | |||
16 | [ req_distinguished_name ] | ||
17 | countryName = Country Name (2 letter code) | ||
18 | countryName_default = AU | ||
19 | countryName_value = AU | ||
20 | |||
21 | organizationName = Organization Name (eg, company) | ||
22 | organizationName_value = Dodgy Brothers | ||
23 | |||
24 | commonName = Common Name (eg, YOUR name) | ||
25 | commonName_value = Dodgy CA | ||
26 | |||
27 | [ v3_ca ] | ||
28 | subjectKeyIdentifier=hash | ||
29 | authorityKeyIdentifier=keyid:always,issuer:always | ||
30 | basicConstraints = CA:true,pathlen:1 | ||
31 | keyUsage = cRLSign, keyCertSign | ||
32 | issuerAltName=issuer:copy | ||
33 | |||
diff --git a/src/lib/libssl/test/CAssdh.cnf b/src/lib/libssl/test/CAssdh.cnf new file mode 100644 index 0000000000..4e0a908679 --- /dev/null +++ b/src/lib/libssl/test/CAssdh.cnf | |||
@@ -0,0 +1,24 @@ | |||
1 | # | ||
2 | # SSLeay example configuration file. | ||
3 | # This is mostly being used for generation of certificate requests. | ||
4 | # | ||
5 | # hacked by iang to do DH certs - CA | ||
6 | |||
7 | RANDFILE = ./.rnd | ||
8 | |||
9 | #################################################################### | ||
10 | [ req ] | ||
11 | distinguished_name = req_distinguished_name | ||
12 | encrypt_rsa_key = no | ||
13 | |||
14 | [ req_distinguished_name ] | ||
15 | countryName = Country Name (2 letter code) | ||
16 | countryName_default = CU | ||
17 | countryName_value = CU | ||
18 | |||
19 | organizationName = Organization Name (eg, company) | ||
20 | organizationName_value = La Junta de la Revolucion | ||
21 | |||
22 | commonName = Common Name (eg, YOUR name) | ||
23 | commonName_value = Junta | ||
24 | |||
diff --git a/src/lib/libssl/test/CAssdsa.cnf b/src/lib/libssl/test/CAssdsa.cnf new file mode 100644 index 0000000000..a6b4d1810c --- /dev/null +++ b/src/lib/libssl/test/CAssdsa.cnf | |||
@@ -0,0 +1,23 @@ | |||
1 | # | ||
2 | # SSLeay example configuration file. | ||
3 | # This is mostly being used for generation of certificate requests. | ||
4 | # | ||
5 | # hacked by iang to do DSA certs - CA | ||
6 | |||
7 | RANDFILE = ./.rnd | ||
8 | |||
9 | #################################################################### | ||
10 | [ req ] | ||
11 | distinguished_name = req_distinguished_name | ||
12 | encrypt_rsa_key = no | ||
13 | |||
14 | [ req_distinguished_name ] | ||
15 | countryName = Country Name (2 letter code) | ||
16 | countryName_default = ES | ||
17 | countryName_value = ES | ||
18 | |||
19 | organizationName = Organization Name (eg, company) | ||
20 | organizationName_value = Hermanos Locos | ||
21 | |||
22 | commonName = Common Name (eg, YOUR name) | ||
23 | commonName_value = Hermanos Locos CA | ||
diff --git a/src/lib/libssl/test/CAssrsa.cnf b/src/lib/libssl/test/CAssrsa.cnf new file mode 100644 index 0000000000..eb24a6dfc0 --- /dev/null +++ b/src/lib/libssl/test/CAssrsa.cnf | |||
@@ -0,0 +1,24 @@ | |||
1 | # | ||
2 | # SSLeay example configuration file. | ||
3 | # This is mostly being used for generation of certificate requests. | ||
4 | # | ||
5 | # create RSA certs - CA | ||
6 | |||
7 | RANDFILE = ./.rnd | ||
8 | |||
9 | #################################################################### | ||
10 | [ req ] | ||
11 | distinguished_name = req_distinguished_name | ||
12 | encrypt_key = no | ||
13 | |||
14 | [ req_distinguished_name ] | ||
15 | countryName = Country Name (2 letter code) | ||
16 | countryName_default = ES | ||
17 | countryName_value = ES | ||
18 | |||
19 | organizationName = Organization Name (eg, company) | ||
20 | organizationName_value = Hermanos Locos | ||
21 | |||
22 | commonName = Common Name (eg, YOUR name) | ||
23 | commonName_value = Hermanos Locos CA | ||
24 | |||
diff --git a/src/lib/libssl/test/Makefile b/src/lib/libssl/test/Makefile new file mode 100644 index 0000000000..6aeedf7fa3 --- /dev/null +++ b/src/lib/libssl/test/Makefile | |||
@@ -0,0 +1,788 @@ | |||
1 | # | ||
2 | # test/Makefile | ||
3 | # | ||
4 | |||
5 | DIR= test | ||
6 | TOP= .. | ||
7 | CC= cc | ||
8 | INCLUDES= -I$(TOP) -I../include $(KRB5_INCLUDES) | ||
9 | CFLAG= -g | ||
10 | INSTALL_PREFIX= | ||
11 | OPENSSLDIR= /usr/local/ssl | ||
12 | INSTALLTOP= /usr/local/ssl | ||
13 | MAKEFILE= Makefile | ||
14 | MAKEDEPPROG= makedepend | ||
15 | MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG) | ||
16 | PERL= perl | ||
17 | # KRB5 stuff | ||
18 | KRB5_INCLUDES= | ||
19 | LIBKRB5= | ||
20 | |||
21 | PEX_LIBS= | ||
22 | EX_LIBS= #-lnsl -lsocket | ||
23 | |||
24 | CFLAGS= $(INCLUDES) $(CFLAG) | ||
25 | |||
26 | GENERAL=Makefile maketests.com \ | ||
27 | tests.com testenc.com tx509.com trsa.com tcrl.com tsid.com treq.com \ | ||
28 | tpkcs7.com tpkcs7d.com tverify.com testgen.com testss.com testssl.com \ | ||
29 | testca.com VMSca-response.1 VMSca-response.2 | ||
30 | |||
31 | DLIBCRYPTO= ../libcrypto.a | ||
32 | DLIBSSL= ../libssl.a | ||
33 | LIBCRYPTO= -L.. -lcrypto | ||
34 | LIBSSL= -L.. -lssl | ||
35 | |||
36 | BNTEST= bntest | ||
37 | ECTEST= ectest | ||
38 | EXPTEST= exptest | ||
39 | IDEATEST= ideatest | ||
40 | SHATEST= shatest | ||
41 | SHA1TEST= sha1test | ||
42 | FIPS_SHA1TEST= fips_sha1test | ||
43 | MDC2TEST= mdc2test | ||
44 | RMDTEST= rmdtest | ||
45 | MD2TEST= md2test | ||
46 | MD4TEST= md4test | ||
47 | MD5TEST= md5test | ||
48 | HMACTEST= hmactest | ||
49 | RC2TEST= rc2test | ||
50 | RC4TEST= rc4test | ||
51 | RC5TEST= rc5test | ||
52 | BFTEST= bftest | ||
53 | CASTTEST= casttest | ||
54 | DESTEST= destest | ||
55 | FIPS_DESTEST= fips_desmovs | ||
56 | RANDTEST= randtest | ||
57 | FIPS_RANDTEST= fips_randtest | ||
58 | DHTEST= dhtest | ||
59 | DSATEST= dsatest | ||
60 | FIPS_DSATEST= fips_dsatest | ||
61 | METHTEST= methtest | ||
62 | SSLTEST= ssltest | ||
63 | RSATEST= rsa_test | ||
64 | ENGINETEST= enginetest | ||
65 | EVPTEST= evp_test | ||
66 | FIPS_AESTEST= fips_aesavs | ||
67 | |||
68 | TESTS= alltests | ||
69 | |||
70 | EXE= $(BNTEST)$(EXE_EXT) $(ECTEST)$(EXE_EXT) $(IDEATEST)$(EXE_EXT) $(MD2TEST)$(EXE_EXT) $(MD4TEST)$(EXE_EXT) $(MD5TEST)$(EXE_EXT) $(HMACTEST)$(EXE_EXT) \ | ||
71 | $(RC2TEST)$(EXE_EXT) $(RC4TEST)$(EXE_EXT) $(RC5TEST)$(EXE_EXT) \ | ||
72 | $(DESTEST)$(EXE_EXT) $(FIPS_DESTEST)$(EXE_EXT) $(SHATEST)$(EXE_EXT) $(SHA1TEST)$(EXE_EXT) $(FIPS_SHA1TEST)$(EXE_EXT) $(MDC2TEST)$(EXE_EXT) $(RMDTEST)$(EXE_EXT) \ | ||
73 | $(RANDTEST)$(EXE_EXT) $(FIPS_RANDTEST)$(EXE_EXT) $(DHTEST)$(EXE_EXT) $(ENGINETEST)$(EXE_EXT) \ | ||
74 | $(BFTEST)$(EXE_EXT) $(CASTTEST)$(EXE_EXT) $(SSLTEST)$(EXE_EXT) $(EXPTEST)$(EXE_EXT) $(DSATEST)$(EXE_EXT) $(FIPS_DSATEST)$(EXE_EXT) $(RSATEST)$(EXE_EXT) \ | ||
75 | $(EVPTEST)$(EXE_EXT) $(FIPS_AESTEST)$(EXE_EXT) | ||
76 | |||
77 | # $(METHTEST)$(EXE_EXT) | ||
78 | |||
79 | OBJ= $(BNTEST).o $(ECTEST).o $(IDEATEST).o $(MD2TEST).o $(MD4TEST).o $(MD5TEST).o \ | ||
80 | $(HMACTEST).o \ | ||
81 | $(RC2TEST).o $(RC4TEST).o $(RC5TEST).o \ | ||
82 | $(DESTEST).o $(FIPS_DESTEST).o $(SHATEST).o $(SHA1TEST).o $(FIPS_SHA1TEST).o $(MDC2TEST).o $(RMDTEST).o \ | ||
83 | $(RANDTEST).o $(FIPS_RANDTEST).o $(DHTEST).o $(ENGINETEST).o $(CASTTEST).o \ | ||
84 | $(BFTEST).o $(SSLTEST).o $(DSATEST).o $(FIPS_DSATEST).o $(EXPTEST).o $(RSATEST).o \ | ||
85 | $(EVPTEST).o $(FIPS_AESTEST).o | ||
86 | SRC= $(BNTEST).c $(ECTEST).c $(IDEATEST).c $(MD2TEST).c $(MD4TEST).c $(MD5TEST).c \ | ||
87 | $(HMACTEST).c \ | ||
88 | $(RC2TEST).c $(RC4TEST).c $(RC5TEST).c \ | ||
89 | $(DESTEST).c $(FIPS_DESTEST).c $(SHATEST).c $(SHA1TEST).c $(FIPS_SHA1TEST).c $(MDC2TEST).c $(RMDTEST).c \ | ||
90 | $(RANDTEST).c $(FIPS_RANDTEST).c $(DHTEST).c $(ENGINETEST).c $(CASTTEST).c \ | ||
91 | $(BFTEST).c $(SSLTEST).c $(DSATEST).c $(FIPS_DSATEST).c $(EXPTEST).c $(RSATEST).c \ | ||
92 | $(EVPTEST).c $(FIPS_AESTEST).c | ||
93 | |||
94 | EXHEADER= | ||
95 | HEADER= $(EXHEADER) | ||
96 | |||
97 | ALL= $(GENERAL) $(SRC) $(HEADER) | ||
98 | |||
99 | top: | ||
100 | (cd ..; $(MAKE) DIRS=$(DIR) TESTS=$(TESTS) all) | ||
101 | |||
102 | all: exe | ||
103 | |||
104 | exe: $(EXE) dummytest$(EXE_EXT) | ||
105 | |||
106 | files: | ||
107 | $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO | ||
108 | |||
109 | links: | ||
110 | |||
111 | generate: $(SRC) | ||
112 | $(SRC): | ||
113 | @sh $(TOP)/util/point.sh dummytest.c $@ | ||
114 | |||
115 | errors: | ||
116 | |||
117 | install: | ||
118 | |||
119 | tags: | ||
120 | ctags $(SRC) | ||
121 | |||
122 | tests: exe apps $(TESTS) | ||
123 | |||
124 | apps: | ||
125 | @(cd ..; $(MAKE) DIRS=apps all) | ||
126 | |||
127 | alltests: \ | ||
128 | test_des test_idea test_sha test_md4 test_md5 test_hmac \ | ||
129 | test_md2 test_mdc2 \ | ||
130 | test_rmd test_rc2 test_rc4 test_rc5 test_bf test_cast test_aes \ | ||
131 | test_rand test_bn test_ec test_enc test_x509 test_rsa test_crl test_sid \ | ||
132 | test_gen test_req test_pkcs7 test_verify test_dh test_dsa \ | ||
133 | test_ss test_ca test_engine test_evp test_ssl | ||
134 | # temporarily removed | ||
135 | # fips_test_aes | ||
136 | |||
137 | fips_test_aes: | ||
138 | if egrep 'define OPENSSL_FIPS' $(TOP)/include/openssl/opensslconf.h > /dev/null; then \ | ||
139 | mkdir -p fips_aes_data/rsp; \ | ||
140 | ../util/shlib_wrap.sh ./$(FIPS_AESTEST) -d fips_aes_data/list; \ | ||
141 | fi | ||
142 | |||
143 | test_evp: | ||
144 | ../util/shlib_wrap.sh ./$(EVPTEST) evptests.txt | ||
145 | |||
146 | test_des: | ||
147 | ../util/shlib_wrap.sh ./$(DESTEST) | ||
148 | |||
149 | test_idea: | ||
150 | ../util/shlib_wrap.sh ./$(IDEATEST) | ||
151 | |||
152 | test_sha: | ||
153 | ../util/shlib_wrap.sh ./$(SHATEST) | ||
154 | ../util/shlib_wrap.sh ./$(SHA1TEST) | ||
155 | if egrep 'define OPENSSL_FIPS' $(TOP)/include/openssl/opensslconf.h > /dev/null; then \ | ||
156 | ../util/shlib_wrap.sh ./$(FIPS_SHA1TEST) sha1vectors.txt | sed s/Strings/Hashes/ | cmp sha1hashes.txt - ; \ | ||
157 | fi | ||
158 | |||
159 | test_mdc2: | ||
160 | ../util/shlib_wrap.sh ./$(MDC2TEST) | ||
161 | |||
162 | test_md5: | ||
163 | ../util/shlib_wrap.sh ./$(MD5TEST) | ||
164 | |||
165 | test_md4: | ||
166 | ../util/shlib_wrap.sh ./$(MD4TEST) | ||
167 | |||
168 | test_hmac: | ||
169 | ../util/shlib_wrap.sh ./$(HMACTEST) | ||
170 | |||
171 | test_md2: | ||
172 | ../util/shlib_wrap.sh ./$(MD2TEST) | ||
173 | |||
174 | test_rmd: | ||
175 | ../util/shlib_wrap.sh ./$(RMDTEST) | ||
176 | |||
177 | test_bf: | ||
178 | ../util/shlib_wrap.sh ./$(BFTEST) | ||
179 | |||
180 | test_cast: | ||
181 | ../util/shlib_wrap.sh ./$(CASTTEST) | ||
182 | |||
183 | test_rc2: | ||
184 | ../util/shlib_wrap.sh ./$(RC2TEST) | ||
185 | |||
186 | test_rc4: | ||
187 | ../util/shlib_wrap.sh ./$(RC4TEST) | ||
188 | |||
189 | test_rc5: | ||
190 | ../util/shlib_wrap.sh ./$(RC5TEST) | ||
191 | |||
192 | test_rand: | ||
193 | ../util/shlib_wrap.sh ./$(RANDTEST) | ||
194 | if egrep 'define OPENSSL_FIPS' $(TOP)/include/openssl/opensslconf.h > /dev/null; then \ | ||
195 | ../util/shlib_wrap.sh ./$(FIPS_RANDTEST); \ | ||
196 | fi | ||
197 | |||
198 | test_enc: | ||
199 | @sh ./testenc | ||
200 | |||
201 | test_x509: | ||
202 | echo test normal x509v1 certificate | ||
203 | sh ./tx509 2>/dev/null | ||
204 | echo test first x509v3 certificate | ||
205 | sh ./tx509 v3-cert1.pem 2>/dev/null | ||
206 | echo test second x509v3 certificate | ||
207 | sh ./tx509 v3-cert2.pem 2>/dev/null | ||
208 | |||
209 | test_rsa: | ||
210 | @sh ./trsa 2>/dev/null | ||
211 | ../util/shlib_wrap.sh ./$(RSATEST) | ||
212 | |||
213 | test_crl: | ||
214 | @sh ./tcrl 2>/dev/null | ||
215 | |||
216 | test_sid: | ||
217 | @sh ./tsid 2>/dev/null | ||
218 | |||
219 | test_req: | ||
220 | @sh ./treq 2>/dev/null | ||
221 | @sh ./treq testreq2.pem 2>/dev/null | ||
222 | |||
223 | test_pkcs7: | ||
224 | @sh ./tpkcs7 2>/dev/null | ||
225 | @sh ./tpkcs7d 2>/dev/null | ||
226 | |||
227 | test_bn: | ||
228 | @echo starting big number library test, could take a while... | ||
229 | @../util/shlib_wrap.sh ./$(BNTEST) >tmp.bntest | ||
230 | @echo quit >>tmp.bntest | ||
231 | @echo "running bc" | ||
232 | @<tmp.bntest sh -c "`sh ./bctest ignore`" | $(PERL) -e '$$i=0; while (<STDIN>) {if (/^test (.*)/) {print STDERR "\nverify $$1";} elsif (!/^0$$/) {die "\nFailed! bc: $$_";} else {print STDERR "."; $$i++;}} print STDERR "\n$$i tests passed\n"' | ||
233 | @echo 'test a^b%c implementations' | ||
234 | ../util/shlib_wrap.sh ./$(EXPTEST) | ||
235 | |||
236 | test_ec: | ||
237 | @echo 'test elliptic curves' | ||
238 | ../util/shlib_wrap.sh ./$(ECTEST) | ||
239 | |||
240 | test_verify: | ||
241 | @echo "The following command should have some OK's and some failures" | ||
242 | @echo "There are definitly a few expired certificates" | ||
243 | -../util/shlib_wrap.sh ../apps/openssl verify -CApath ../certs ../certs/*.pem | ||
244 | |||
245 | test_dh: | ||
246 | @echo "Generate a set of DH parameters" | ||
247 | ../util/shlib_wrap.sh ./$(DHTEST) | ||
248 | |||
249 | test_dsa: | ||
250 | @echo "Generate a set of DSA parameters" | ||
251 | ../util/shlib_wrap.sh ./$(DSATEST) | ||
252 | ../util/shlib_wrap.sh ./$(DSATEST) -app2_1 | ||
253 | if egrep 'define OPENSSL_FIPS' $(TOP)/include/openssl/opensslconf.h > /dev/null; then \ | ||
254 | ../util/shlib_wrap.sh ./$(FIPS_DSATEST); \ | ||
255 | ../util/shlib_wrap.sh ./$(FIPS_DSATEST) -app2_1; \ | ||
256 | fi | ||
257 | |||
258 | test_gen: | ||
259 | @echo "Generate and verify a certificate request" | ||
260 | @sh ./testgen | ||
261 | |||
262 | test_ss keyU.ss certU.ss certCA.ss certP1.ss keyP1.ss certP2.ss keyP2.ss \ | ||
263 | intP1.ss intP2.ss: testss | ||
264 | @echo "Generate and certify a test certificate" | ||
265 | @sh ./testss | ||
266 | @cat certCA.ss certU.ss > intP1.ss | ||
267 | @cat certCA.ss certU.ss certP1.ss > intP2.ss | ||
268 | |||
269 | test_engine: | ||
270 | @echo "Manipulate the ENGINE structures" | ||
271 | ../util/shlib_wrap.sh ./$(ENGINETEST) | ||
272 | |||
273 | test_ssl: keyU.ss certU.ss certCA.ss certP1.ss keyP1.ss certP2.ss keyP2.ss \ | ||
274 | intP1.ss intP2.ss | ||
275 | @echo "test SSL protocol" | ||
276 | @if egrep 'define OPENSSL_FIPS' $(TOP)/include/openssl/opensslconf.h > /dev/null; then \ | ||
277 | sh ./testfipsssl keyU.ss certU.ss certCA.ss; \ | ||
278 | fi | ||
279 | @sh ./testssl keyU.ss certU.ss certCA.ss | ||
280 | @sh ./testsslproxy keyP1.ss certP1.ss intP1.ss | ||
281 | @sh ./testsslproxy keyP2.ss certP2.ss intP2.ss | ||
282 | |||
283 | test_ca: | ||
284 | @if ../util/shlib_wrap.sh ../apps/openssl no-rsa; then \ | ||
285 | echo "skipping CA.sh test -- requires RSA"; \ | ||
286 | else \ | ||
287 | echo "Generate and certify a test certificate via the 'ca' program"; \ | ||
288 | sh ./testca; \ | ||
289 | fi | ||
290 | |||
291 | test_aes: #$(AESTEST) | ||
292 | # @echo "test Rijndael" | ||
293 | # ../util/shlib_wrap.sh ./$(AESTEST) | ||
294 | |||
295 | lint: | ||
296 | lint -DLINT $(INCLUDES) $(SRC)>fluff | ||
297 | |||
298 | depend: | ||
299 | $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(SRC) | ||
300 | |||
301 | dclean: | ||
302 | $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new | ||
303 | mv -f Makefile.new $(MAKEFILE) | ||
304 | |||
305 | clean: | ||
306 | rm -f .rnd tmp.bntest tmp.bctest *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff $(EXE) *.ss *.srl log | ||
307 | |||
308 | $(DLIBSSL): | ||
309 | (cd ..; $(MAKE) DIRS=ssl all) | ||
310 | |||
311 | $(DLIBCRYPTO): | ||
312 | (cd ..; $(MAKE) DIRS=crypto all) | ||
313 | |||
314 | BUILD_CMD=if [ "$(SHLIB_TARGET)" = "hpux-shared" -o "$(SHLIB_TARGET)" = "darwin-shared" ] ; then \ | ||
315 | set -x; $${CC:-$(CC)} -o $$target$(EXE_EXT) $(CFLAGS) $$target.o $(PEX_LIBS) $(DLIBSSL) $(LIBKRB5) $(DLIBCRYPTO) $(EX_LIBS) ; \ | ||
316 | elif [ -z "$(SHARED_LIBS)" ]; then \ | ||
317 | set -x; $${CC:-$(CC)} -o $$target$(EXE_EXT) $(CFLAGS) $$target.o $(PEX_LIBS) $(LIBSSL) $(LIBKRB5) $(LIBCRYPTO) $(EX_LIBS) ; \ | ||
318 | else \ | ||
319 | set -x; LD_LIBRARY_PATH=..:$$LD_LIBRARY_PATH \ | ||
320 | $(CC) -o $$target$(EXE_EXT) $(CFLAGS) $$target.o $(PEX_LIBS) $(LIBSSL) $(LIBKRB5) $(LIBCRYPTO) $(EX_LIBS) ; \ | ||
321 | fi; | ||
322 | |||
323 | $(FIPS_AESTEST)$(EXE_EXT): $(FIPS_AESTEST).o $(DLIBCRYPTO) | ||
324 | @target=$(FIPS_AESTEST); $(BUILD_CMD) | ||
325 | if egrep 'define OPENSSL_FIPS' $(TOP)/include/openssl/opensslconf.h > /dev/null; then \ | ||
326 | TOP=$(TOP) $(TOP)/fips/openssl_fips_fingerprint $(TOP)/libcrypto.a $(FIPS_AESTEST); \ | ||
327 | fi | ||
328 | |||
329 | $(RSATEST)$(EXE_EXT): $(RSATEST).o $(DLIBCRYPTO) | ||
330 | @target=$(RSATEST); $(BUILD_CMD) | ||
331 | |||
332 | $(BNTEST)$(EXE_EXT): $(BNTEST).o $(DLIBCRYPTO) | ||
333 | @target=$(BNTEST); $(BUILD_CMD) | ||
334 | |||
335 | $(ECTEST)$(EXE_EXT): $(ECTEST).o $(DLIBCRYPTO) | ||
336 | @target=$(ECTEST); $(BUILD_CMD) | ||
337 | |||
338 | $(EXPTEST)$(EXE_EXT): $(EXPTEST).o $(DLIBCRYPTO) | ||
339 | @target=$(EXPTEST); $(BUILD_CMD) | ||
340 | |||
341 | $(IDEATEST)$(EXE_EXT): $(IDEATEST).o $(DLIBCRYPTO) | ||
342 | @target=$(IDEATEST); $(BUILD_CMD) | ||
343 | |||
344 | $(MD2TEST)$(EXE_EXT): $(MD2TEST).o $(DLIBCRYPTO) | ||
345 | @target=$(MD2TEST); $(BUILD_CMD) | ||
346 | |||
347 | $(SHATEST)$(EXE_EXT): $(SHATEST).o $(DLIBCRYPTO) | ||
348 | @target=$(SHATEST); $(BUILD_CMD) | ||
349 | |||
350 | $(SHA1TEST)$(EXE_EXT): $(SHA1TEST).o $(DLIBCRYPTO) | ||
351 | @target=$(SHA1TEST); $(BUILD_CMD) | ||
352 | |||
353 | $(FIPS_SHA1TEST)$(EXE_EXT): $(FIPS_SHA1TEST).o $(DLIBCRYPTO) | ||
354 | @target=$(FIPS_SHA1TEST); $(BUILD_CMD) | ||
355 | if egrep 'define OPENSSL_FIPS' $(TOP)/include/openssl/opensslconf.h > /dev/null; then \ | ||
356 | TOP=$(TOP) $(TOP)/fips/openssl_fips_fingerprint $(TOP)/libcrypto.a $(FIPS_SHA1TEST); \ | ||
357 | fi | ||
358 | |||
359 | $(RMDTEST)$(EXE_EXT): $(RMDTEST).o $(DLIBCRYPTO) | ||
360 | @target=$(RMDTEST); $(BUILD_CMD) | ||
361 | |||
362 | $(MDC2TEST)$(EXE_EXT): $(MDC2TEST).o $(DLIBCRYPTO) | ||
363 | @target=$(MDC2TEST); $(BUILD_CMD) | ||
364 | |||
365 | $(MD4TEST)$(EXE_EXT): $(MD4TEST).o $(DLIBCRYPTO) | ||
366 | @target=$(MD4TEST); $(BUILD_CMD) | ||
367 | |||
368 | $(MD5TEST)$(EXE_EXT): $(MD5TEST).o $(DLIBCRYPTO) | ||
369 | @target=$(MD5TEST); $(BUILD_CMD) | ||
370 | |||
371 | $(HMACTEST)$(EXE_EXT): $(HMACTEST).o $(DLIBCRYPTO) | ||
372 | @target=$(HMACTEST); $(BUILD_CMD) | ||
373 | |||
374 | $(RC2TEST)$(EXE_EXT): $(RC2TEST).o $(DLIBCRYPTO) | ||
375 | @target=$(RC2TEST); $(BUILD_CMD) | ||
376 | |||
377 | $(BFTEST)$(EXE_EXT): $(BFTEST).o $(DLIBCRYPTO) | ||
378 | @target=$(BFTEST); $(BUILD_CMD) | ||
379 | |||
380 | $(CASTTEST)$(EXE_EXT): $(CASTTEST).o $(DLIBCRYPTO) | ||
381 | @target=$(CASTTEST); $(BUILD_CMD) | ||
382 | |||
383 | $(RC4TEST)$(EXE_EXT): $(RC4TEST).o $(DLIBCRYPTO) | ||
384 | @target=$(RC4TEST); $(BUILD_CMD) | ||
385 | |||
386 | $(RC5TEST)$(EXE_EXT): $(RC5TEST).o $(DLIBCRYPTO) | ||
387 | @target=$(RC5TEST); $(BUILD_CMD) | ||
388 | |||
389 | $(DESTEST)$(EXE_EXT): $(DESTEST).o $(DLIBCRYPTO) | ||
390 | @target=$(DESTEST); $(BUILD_CMD) | ||
391 | |||
392 | $(FIPS_DESTEST)$(EXE_EXT): $(FIPS_DESTEST).o $(DLIBCRYPTO) | ||
393 | @target=$(FIPS_DESTEST); $(BUILD_CMD) | ||
394 | if egrep 'define OPENSSL_FIPS' $(TOP)/include/openssl/opensslconf.h > /dev/null; then \ | ||
395 | TOP=$(TOP) $(TOP)/fips/openssl_fips_fingerprint $(TOP)/libcrypto.a $(FIPS_DESTEST); \ | ||
396 | fi | ||
397 | |||
398 | $(RANDTEST)$(EXE_EXT): $(RANDTEST).o $(DLIBCRYPTO) | ||
399 | @target=$(RANDTEST); $(BUILD_CMD) | ||
400 | |||
401 | $(FIPS_RANDTEST)$(EXE_EXT): $(FIPS_RANDTEST).o $(DLIBCRYPTO) | ||
402 | @target=$(FIPS_RANDTEST); $(BUILD_CMD) | ||
403 | if egrep 'define OPENSSL_FIPS' $(TOP)/include/openssl/opensslconf.h > /dev/null; then \ | ||
404 | TOP=$(TOP) $(TOP)/fips/openssl_fips_fingerprint $(TOP)/libcrypto.a $(FIPS_RANDTEST); \ | ||
405 | fi | ||
406 | |||
407 | $(DHTEST)$(EXE_EXT): $(DHTEST).o $(DLIBCRYPTO) | ||
408 | @target=$(DHTEST); $(BUILD_CMD) | ||
409 | |||
410 | $(DSATEST)$(EXE_EXT): $(DSATEST).o $(DLIBCRYPTO) | ||
411 | @target=$(DSATEST); $(BUILD_CMD) | ||
412 | |||
413 | $(FIPS_DSATEST)$(EXE_EXT): $(FIPS_DSATEST).o $(DLIBCRYPTO) | ||
414 | @target=$(FIPS_DSATEST); $(BUILD_CMD) | ||
415 | if egrep 'define OPENSSL_FIPS' $(TOP)/include/openssl/opensslconf.h > /dev/null; then \ | ||
416 | TOP=$(TOP) $(TOP)/fips/openssl_fips_fingerprint $(TOP)/libcrypto.a $(FIPS_DSATEST); \ | ||
417 | fi | ||
418 | |||
419 | $(METHTEST)$(EXE_EXT): $(METHTEST).o $(DLIBCRYPTO) | ||
420 | @target=$(METHTEST); $(BUILD_CMD) | ||
421 | |||
422 | $(SSLTEST)$(EXE_EXT): $(SSLTEST).o $(DLIBSSL) $(DLIBCRYPTO) | ||
423 | @target=$(SSLTEST); $(BUILD_CMD) | ||
424 | if egrep 'define OPENSSL_FIPS' $(TOP)/include/openssl/opensslconf.h > /dev/null; then \ | ||
425 | TOP=$(TOP) $(TOP)/fips/openssl_fips_fingerprint $(TOP)/libcrypto.a $(SSLTEST); \ | ||
426 | fi | ||
427 | |||
428 | $(ENGINETEST)$(EXE_EXT): $(ENGINETEST).o $(DLIBCRYPTO) | ||
429 | @target=$(ENGINETEST); $(BUILD_CMD) | ||
430 | |||
431 | $(EVPTEST)$(EXE_EXT): $(EVPTEST).o $(DLIBCRYPTO) | ||
432 | @target=$(EVPTEST); $(BUILD_CMD) | ||
433 | |||
434 | #$(AESTEST).o: $(AESTEST).c | ||
435 | # $(CC) -c $(CFLAGS) -DINTERMEDIATE_VALUE_KAT -DTRACE_KAT_MCT $(AESTEST).c | ||
436 | |||
437 | #$(AESTEST)$(EXE_EXT): $(AESTEST).o $(DLIBCRYPTO) | ||
438 | # @target=$(AESTEST); $(BUILD_CMD) | ||
439 | |||
440 | dummytest$(EXE_EXT): dummytest.o $(DLIBCRYPTO) | ||
441 | @target=dummytest; $(BUILD_CMD) | ||
442 | |||
443 | # DO NOT DELETE THIS LINE -- make depend depends on it. | ||
444 | |||
445 | bftest.o: ../e_os.h ../include/openssl/blowfish.h ../include/openssl/e_os2.h | ||
446 | bftest.o: ../include/openssl/opensslconf.h bftest.c | ||
447 | bntest.o: ../e_os.h ../include/openssl/aes.h ../include/openssl/asn1.h | ||
448 | bntest.o: ../include/openssl/bio.h ../include/openssl/blowfish.h | ||
449 | bntest.o: ../include/openssl/bn.h ../include/openssl/buffer.h | ||
450 | bntest.o: ../include/openssl/cast.h ../include/openssl/crypto.h | ||
451 | bntest.o: ../include/openssl/des.h ../include/openssl/des_old.h | ||
452 | bntest.o: ../include/openssl/dh.h ../include/openssl/dsa.h | ||
453 | bntest.o: ../include/openssl/e_os2.h ../include/openssl/err.h | ||
454 | bntest.o: ../include/openssl/evp.h ../include/openssl/idea.h | ||
455 | bntest.o: ../include/openssl/lhash.h ../include/openssl/md2.h | ||
456 | bntest.o: ../include/openssl/md4.h ../include/openssl/md5.h | ||
457 | bntest.o: ../include/openssl/mdc2.h ../include/openssl/obj_mac.h | ||
458 | bntest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h | ||
459 | bntest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | ||
460 | bntest.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h | ||
461 | bntest.o: ../include/openssl/rc2.h ../include/openssl/rc4.h | ||
462 | bntest.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h | ||
463 | bntest.o: ../include/openssl/rsa.h ../include/openssl/safestack.h | ||
464 | bntest.o: ../include/openssl/sha.h ../include/openssl/stack.h | ||
465 | bntest.o: ../include/openssl/symhacks.h ../include/openssl/ui.h | ||
466 | bntest.o: ../include/openssl/ui_compat.h ../include/openssl/x509.h | ||
467 | bntest.o: ../include/openssl/x509_vfy.h bntest.c | ||
468 | casttest.o: ../e_os.h ../include/openssl/cast.h ../include/openssl/e_os2.h | ||
469 | casttest.o: ../include/openssl/opensslconf.h casttest.c | ||
470 | destest.o: ../include/openssl/crypto.h ../include/openssl/des.h | ||
471 | destest.o: ../include/openssl/des_old.h ../include/openssl/e_os2.h | ||
472 | destest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
473 | destest.o: ../include/openssl/safestack.h ../include/openssl/stack.h | ||
474 | destest.o: ../include/openssl/symhacks.h ../include/openssl/ui.h | ||
475 | destest.o: ../include/openssl/ui_compat.h destest.c | ||
476 | dhtest.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/bn.h | ||
477 | dhtest.o: ../include/openssl/crypto.h ../include/openssl/dh.h | ||
478 | dhtest.o: ../include/openssl/e_os2.h ../include/openssl/err.h | ||
479 | dhtest.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h | ||
480 | dhtest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | ||
481 | dhtest.o: ../include/openssl/rand.h ../include/openssl/safestack.h | ||
482 | dhtest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h dhtest.c | ||
483 | dsatest.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/bn.h | ||
484 | dsatest.o: ../include/openssl/crypto.h ../include/openssl/dh.h | ||
485 | dsatest.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h | ||
486 | dsatest.o: ../include/openssl/err.h ../include/openssl/lhash.h | ||
487 | dsatest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
488 | dsatest.o: ../include/openssl/ossl_typ.h ../include/openssl/rand.h | ||
489 | dsatest.o: ../include/openssl/safestack.h ../include/openssl/stack.h | ||
490 | dsatest.o: ../include/openssl/symhacks.h dsatest.c | ||
491 | ectest.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | ||
492 | ectest.o: ../include/openssl/bn.h ../include/openssl/crypto.h | ||
493 | ectest.o: ../include/openssl/dh.h ../include/openssl/dsa.h | ||
494 | ectest.o: ../include/openssl/e_os2.h ../include/openssl/ec.h | ||
495 | ectest.o: ../include/openssl/engine.h ../include/openssl/err.h | ||
496 | ectest.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h | ||
497 | ectest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | ||
498 | ectest.o: ../include/openssl/rand.h ../include/openssl/rsa.h | ||
499 | ectest.o: ../include/openssl/safestack.h ../include/openssl/stack.h | ||
500 | ectest.o: ../include/openssl/symhacks.h ../include/openssl/ui.h ectest.c | ||
501 | enginetest.o: ../include/openssl/asn1.h ../include/openssl/bio.h | ||
502 | enginetest.o: ../include/openssl/bn.h ../include/openssl/buffer.h | ||
503 | enginetest.o: ../include/openssl/crypto.h ../include/openssl/dh.h | ||
504 | enginetest.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h | ||
505 | enginetest.o: ../include/openssl/engine.h ../include/openssl/err.h | ||
506 | enginetest.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h | ||
507 | enginetest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | ||
508 | enginetest.o: ../include/openssl/rand.h ../include/openssl/rsa.h | ||
509 | enginetest.o: ../include/openssl/safestack.h ../include/openssl/stack.h | ||
510 | enginetest.o: ../include/openssl/symhacks.h ../include/openssl/ui.h | ||
511 | enginetest.o: enginetest.c | ||
512 | evp_test.o: ../e_os.h ../include/openssl/aes.h ../include/openssl/asn1.h | ||
513 | evp_test.o: ../include/openssl/bio.h ../include/openssl/blowfish.h | ||
514 | evp_test.o: ../include/openssl/bn.h ../include/openssl/cast.h | ||
515 | evp_test.o: ../include/openssl/conf.h ../include/openssl/crypto.h | ||
516 | evp_test.o: ../include/openssl/des.h ../include/openssl/des_old.h | ||
517 | evp_test.o: ../include/openssl/dh.h ../include/openssl/dsa.h | ||
518 | evp_test.o: ../include/openssl/e_os2.h ../include/openssl/engine.h | ||
519 | evp_test.o: ../include/openssl/err.h ../include/openssl/evp.h | ||
520 | evp_test.o: ../include/openssl/idea.h ../include/openssl/lhash.h | ||
521 | evp_test.o: ../include/openssl/md2.h ../include/openssl/md4.h | ||
522 | evp_test.o: ../include/openssl/md5.h ../include/openssl/mdc2.h | ||
523 | evp_test.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h | ||
524 | evp_test.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
525 | evp_test.o: ../include/openssl/ossl_typ.h ../include/openssl/rand.h | ||
526 | evp_test.o: ../include/openssl/rc2.h ../include/openssl/rc4.h | ||
527 | evp_test.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h | ||
528 | evp_test.o: ../include/openssl/rsa.h ../include/openssl/safestack.h | ||
529 | evp_test.o: ../include/openssl/sha.h ../include/openssl/stack.h | ||
530 | evp_test.o: ../include/openssl/symhacks.h ../include/openssl/ui.h | ||
531 | evp_test.o: ../include/openssl/ui_compat.h evp_test.c | ||
532 | exptest.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/bn.h | ||
533 | exptest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h | ||
534 | exptest.o: ../include/openssl/err.h ../include/openssl/lhash.h | ||
535 | exptest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
536 | exptest.o: ../include/openssl/ossl_typ.h ../include/openssl/rand.h | ||
537 | exptest.o: ../include/openssl/safestack.h ../include/openssl/stack.h | ||
538 | exptest.o: ../include/openssl/symhacks.h exptest.c | ||
539 | fips_aesavs.o: ../e_os.h ../include/openssl/aes.h ../include/openssl/asn1.h | ||
540 | fips_aesavs.o: ../include/openssl/bio.h ../include/openssl/blowfish.h | ||
541 | fips_aesavs.o: ../include/openssl/bn.h ../include/openssl/cast.h | ||
542 | fips_aesavs.o: ../include/openssl/crypto.h ../include/openssl/des.h | ||
543 | fips_aesavs.o: ../include/openssl/des_old.h ../include/openssl/dh.h | ||
544 | fips_aesavs.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h | ||
545 | fips_aesavs.o: ../include/openssl/err.h ../include/openssl/evp.h | ||
546 | fips_aesavs.o: ../include/openssl/fips.h ../include/openssl/idea.h | ||
547 | fips_aesavs.o: ../include/openssl/lhash.h ../include/openssl/md2.h | ||
548 | fips_aesavs.o: ../include/openssl/md4.h ../include/openssl/md5.h | ||
549 | fips_aesavs.o: ../include/openssl/mdc2.h ../include/openssl/obj_mac.h | ||
550 | fips_aesavs.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h | ||
551 | fips_aesavs.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | ||
552 | fips_aesavs.o: ../include/openssl/rc2.h ../include/openssl/rc4.h | ||
553 | fips_aesavs.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h | ||
554 | fips_aesavs.o: ../include/openssl/rsa.h ../include/openssl/safestack.h | ||
555 | fips_aesavs.o: ../include/openssl/sha.h ../include/openssl/stack.h | ||
556 | fips_aesavs.o: ../include/openssl/symhacks.h ../include/openssl/ui.h | ||
557 | fips_aesavs.o: ../include/openssl/ui_compat.h fips_aesavs.c | ||
558 | fips_desmovs.o: ../e_os.h ../include/openssl/aes.h ../include/openssl/asn1.h | ||
559 | fips_desmovs.o: ../include/openssl/bio.h ../include/openssl/blowfish.h | ||
560 | fips_desmovs.o: ../include/openssl/bn.h ../include/openssl/cast.h | ||
561 | fips_desmovs.o: ../include/openssl/crypto.h ../include/openssl/des.h | ||
562 | fips_desmovs.o: ../include/openssl/des_old.h ../include/openssl/dh.h | ||
563 | fips_desmovs.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h | ||
564 | fips_desmovs.o: ../include/openssl/err.h ../include/openssl/evp.h | ||
565 | fips_desmovs.o: ../include/openssl/fips.h ../include/openssl/idea.h | ||
566 | fips_desmovs.o: ../include/openssl/lhash.h ../include/openssl/md2.h | ||
567 | fips_desmovs.o: ../include/openssl/md4.h ../include/openssl/md5.h | ||
568 | fips_desmovs.o: ../include/openssl/mdc2.h ../include/openssl/obj_mac.h | ||
569 | fips_desmovs.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h | ||
570 | fips_desmovs.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | ||
571 | fips_desmovs.o: ../include/openssl/rc2.h ../include/openssl/rc4.h | ||
572 | fips_desmovs.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h | ||
573 | fips_desmovs.o: ../include/openssl/rsa.h ../include/openssl/safestack.h | ||
574 | fips_desmovs.o: ../include/openssl/sha.h ../include/openssl/stack.h | ||
575 | fips_desmovs.o: ../include/openssl/symhacks.h ../include/openssl/ui.h | ||
576 | fips_desmovs.o: ../include/openssl/ui_compat.h fips_desmovs.c | ||
577 | fips_dsatest.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | ||
578 | fips_dsatest.o: ../include/openssl/bn.h ../include/openssl/crypto.h | ||
579 | fips_dsatest.o: ../include/openssl/des.h ../include/openssl/des_old.h | ||
580 | fips_dsatest.o: ../include/openssl/dh.h ../include/openssl/dsa.h | ||
581 | fips_dsatest.o: ../include/openssl/e_os2.h ../include/openssl/engine.h | ||
582 | fips_dsatest.o: ../include/openssl/err.h ../include/openssl/fips.h | ||
583 | fips_dsatest.o: ../include/openssl/fips_rand.h ../include/openssl/lhash.h | ||
584 | fips_dsatest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
585 | fips_dsatest.o: ../include/openssl/ossl_typ.h ../include/openssl/rand.h | ||
586 | fips_dsatest.o: ../include/openssl/rsa.h ../include/openssl/safestack.h | ||
587 | fips_dsatest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | ||
588 | fips_dsatest.o: ../include/openssl/ui.h ../include/openssl/ui_compat.h | ||
589 | fips_dsatest.o: fips_dsatest.c | ||
590 | fips_randtest.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/crypto.h | ||
591 | fips_randtest.o: ../include/openssl/des.h ../include/openssl/des_old.h | ||
592 | fips_randtest.o: ../include/openssl/e_os2.h ../include/openssl/err.h | ||
593 | fips_randtest.o: ../include/openssl/fips_rand.h ../include/openssl/lhash.h | ||
594 | fips_randtest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
595 | fips_randtest.o: ../include/openssl/ossl_typ.h ../include/openssl/rand.h | ||
596 | fips_randtest.o: ../include/openssl/safestack.h ../include/openssl/stack.h | ||
597 | fips_randtest.o: ../include/openssl/symhacks.h ../include/openssl/ui.h | ||
598 | fips_randtest.o: ../include/openssl/ui_compat.h fips_randtest.c | ||
599 | fips_sha1test.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/crypto.h | ||
600 | fips_sha1test.o: ../include/openssl/e_os2.h ../include/openssl/err.h | ||
601 | fips_sha1test.o: ../include/openssl/fips.h ../include/openssl/lhash.h | ||
602 | fips_sha1test.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
603 | fips_sha1test.o: ../include/openssl/safestack.h ../include/openssl/sha.h | ||
604 | fips_sha1test.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | ||
605 | fips_sha1test.o: fips_sha1test.c | ||
606 | hmactest.o: ../e_os.h ../include/openssl/aes.h ../include/openssl/asn1.h | ||
607 | hmactest.o: ../include/openssl/bio.h ../include/openssl/blowfish.h | ||
608 | hmactest.o: ../include/openssl/bn.h ../include/openssl/cast.h | ||
609 | hmactest.o: ../include/openssl/crypto.h ../include/openssl/des.h | ||
610 | hmactest.o: ../include/openssl/des_old.h ../include/openssl/dh.h | ||
611 | hmactest.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h | ||
612 | hmactest.o: ../include/openssl/evp.h ../include/openssl/hmac.h | ||
613 | hmactest.o: ../include/openssl/idea.h ../include/openssl/md2.h | ||
614 | hmactest.o: ../include/openssl/md4.h ../include/openssl/md5.h | ||
615 | hmactest.o: ../include/openssl/mdc2.h ../include/openssl/obj_mac.h | ||
616 | hmactest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h | ||
617 | hmactest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | ||
618 | hmactest.o: ../include/openssl/rc2.h ../include/openssl/rc4.h | ||
619 | hmactest.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h | ||
620 | hmactest.o: ../include/openssl/rsa.h ../include/openssl/safestack.h | ||
621 | hmactest.o: ../include/openssl/sha.h ../include/openssl/stack.h | ||
622 | hmactest.o: ../include/openssl/symhacks.h ../include/openssl/ui.h | ||
623 | hmactest.o: ../include/openssl/ui_compat.h hmactest.c | ||
624 | ideatest.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/idea.h | ||
625 | ideatest.o: ../include/openssl/opensslconf.h ideatest.c | ||
626 | md2test.o: ../e_os.h ../include/openssl/aes.h ../include/openssl/asn1.h | ||
627 | md2test.o: ../include/openssl/bio.h ../include/openssl/blowfish.h | ||
628 | md2test.o: ../include/openssl/bn.h ../include/openssl/cast.h | ||
629 | md2test.o: ../include/openssl/crypto.h ../include/openssl/des.h | ||
630 | md2test.o: ../include/openssl/des_old.h ../include/openssl/dh.h | ||
631 | md2test.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h | ||
632 | md2test.o: ../include/openssl/evp.h ../include/openssl/idea.h | ||
633 | md2test.o: ../include/openssl/md2.h ../include/openssl/md4.h | ||
634 | md2test.o: ../include/openssl/md5.h ../include/openssl/mdc2.h | ||
635 | md2test.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h | ||
636 | md2test.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
637 | md2test.o: ../include/openssl/ossl_typ.h ../include/openssl/rc2.h | ||
638 | md2test.o: ../include/openssl/rc4.h ../include/openssl/rc5.h | ||
639 | md2test.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h | ||
640 | md2test.o: ../include/openssl/safestack.h ../include/openssl/sha.h | ||
641 | md2test.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | ||
642 | md2test.o: ../include/openssl/ui.h ../include/openssl/ui_compat.h md2test.c | ||
643 | md4test.o: ../e_os.h ../include/openssl/aes.h ../include/openssl/asn1.h | ||
644 | md4test.o: ../include/openssl/bio.h ../include/openssl/blowfish.h | ||
645 | md4test.o: ../include/openssl/bn.h ../include/openssl/cast.h | ||
646 | md4test.o: ../include/openssl/crypto.h ../include/openssl/des.h | ||
647 | md4test.o: ../include/openssl/des_old.h ../include/openssl/dh.h | ||
648 | md4test.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h | ||
649 | md4test.o: ../include/openssl/evp.h ../include/openssl/idea.h | ||
650 | md4test.o: ../include/openssl/md2.h ../include/openssl/md4.h | ||
651 | md4test.o: ../include/openssl/md5.h ../include/openssl/mdc2.h | ||
652 | md4test.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h | ||
653 | md4test.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
654 | md4test.o: ../include/openssl/ossl_typ.h ../include/openssl/rc2.h | ||
655 | md4test.o: ../include/openssl/rc4.h ../include/openssl/rc5.h | ||
656 | md4test.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h | ||
657 | md4test.o: ../include/openssl/safestack.h ../include/openssl/sha.h | ||
658 | md4test.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | ||
659 | md4test.o: ../include/openssl/ui.h ../include/openssl/ui_compat.h md4test.c | ||
660 | md5test.o: ../e_os.h ../include/openssl/aes.h ../include/openssl/asn1.h | ||
661 | md5test.o: ../include/openssl/bio.h ../include/openssl/blowfish.h | ||
662 | md5test.o: ../include/openssl/bn.h ../include/openssl/cast.h | ||
663 | md5test.o: ../include/openssl/crypto.h ../include/openssl/des.h | ||
664 | md5test.o: ../include/openssl/des_old.h ../include/openssl/dh.h | ||
665 | md5test.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h | ||
666 | md5test.o: ../include/openssl/evp.h ../include/openssl/idea.h | ||
667 | md5test.o: ../include/openssl/md2.h ../include/openssl/md4.h | ||
668 | md5test.o: ../include/openssl/md5.h ../include/openssl/mdc2.h | ||
669 | md5test.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h | ||
670 | md5test.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
671 | md5test.o: ../include/openssl/ossl_typ.h ../include/openssl/rc2.h | ||
672 | md5test.o: ../include/openssl/rc4.h ../include/openssl/rc5.h | ||
673 | md5test.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h | ||
674 | md5test.o: ../include/openssl/safestack.h ../include/openssl/sha.h | ||
675 | md5test.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | ||
676 | md5test.o: ../include/openssl/ui.h ../include/openssl/ui_compat.h md5test.c | ||
677 | mdc2test.o: ../e_os.h ../include/openssl/aes.h ../include/openssl/asn1.h | ||
678 | mdc2test.o: ../include/openssl/bio.h ../include/openssl/blowfish.h | ||
679 | mdc2test.o: ../include/openssl/bn.h ../include/openssl/cast.h | ||
680 | mdc2test.o: ../include/openssl/crypto.h ../include/openssl/des.h | ||
681 | mdc2test.o: ../include/openssl/des_old.h ../include/openssl/dh.h | ||
682 | mdc2test.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h | ||
683 | mdc2test.o: ../include/openssl/evp.h ../include/openssl/idea.h | ||
684 | mdc2test.o: ../include/openssl/md2.h ../include/openssl/md4.h | ||
685 | mdc2test.o: ../include/openssl/md5.h ../include/openssl/mdc2.h | ||
686 | mdc2test.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h | ||
687 | mdc2test.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
688 | mdc2test.o: ../include/openssl/ossl_typ.h ../include/openssl/rc2.h | ||
689 | mdc2test.o: ../include/openssl/rc4.h ../include/openssl/rc5.h | ||
690 | mdc2test.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h | ||
691 | mdc2test.o: ../include/openssl/safestack.h ../include/openssl/sha.h | ||
692 | mdc2test.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | ||
693 | mdc2test.o: ../include/openssl/ui.h ../include/openssl/ui_compat.h mdc2test.c | ||
694 | randtest.o: ../e_os.h ../include/openssl/e_os2.h | ||
695 | randtest.o: ../include/openssl/opensslconf.h ../include/openssl/ossl_typ.h | ||
696 | randtest.o: ../include/openssl/rand.h randtest.c | ||
697 | rc2test.o: ../e_os.h ../include/openssl/e_os2.h | ||
698 | rc2test.o: ../include/openssl/opensslconf.h ../include/openssl/rc2.h rc2test.c | ||
699 | rc4test.o: ../e_os.h ../include/openssl/e_os2.h | ||
700 | rc4test.o: ../include/openssl/opensslconf.h ../include/openssl/rc4.h rc4test.c | ||
701 | rc5test.o: ../e_os.h ../include/openssl/e_os2.h | ||
702 | rc5test.o: ../include/openssl/opensslconf.h ../include/openssl/rc5.h rc5test.c | ||
703 | rmdtest.o: ../e_os.h ../include/openssl/aes.h ../include/openssl/asn1.h | ||
704 | rmdtest.o: ../include/openssl/bio.h ../include/openssl/blowfish.h | ||
705 | rmdtest.o: ../include/openssl/bn.h ../include/openssl/cast.h | ||
706 | rmdtest.o: ../include/openssl/crypto.h ../include/openssl/des.h | ||
707 | rmdtest.o: ../include/openssl/des_old.h ../include/openssl/dh.h | ||
708 | rmdtest.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h | ||
709 | rmdtest.o: ../include/openssl/evp.h ../include/openssl/idea.h | ||
710 | rmdtest.o: ../include/openssl/md2.h ../include/openssl/md4.h | ||
711 | rmdtest.o: ../include/openssl/md5.h ../include/openssl/mdc2.h | ||
712 | rmdtest.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h | ||
713 | rmdtest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
714 | rmdtest.o: ../include/openssl/ossl_typ.h ../include/openssl/rc2.h | ||
715 | rmdtest.o: ../include/openssl/rc4.h ../include/openssl/rc5.h | ||
716 | rmdtest.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h | ||
717 | rmdtest.o: ../include/openssl/safestack.h ../include/openssl/sha.h | ||
718 | rmdtest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | ||
719 | rmdtest.o: ../include/openssl/ui.h ../include/openssl/ui_compat.h rmdtest.c | ||
720 | rsa_test.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | ||
721 | rsa_test.o: ../include/openssl/bn.h ../include/openssl/crypto.h | ||
722 | rsa_test.o: ../include/openssl/e_os2.h ../include/openssl/err.h | ||
723 | rsa_test.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h | ||
724 | rsa_test.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | ||
725 | rsa_test.o: ../include/openssl/rand.h ../include/openssl/rsa.h | ||
726 | rsa_test.o: ../include/openssl/safestack.h ../include/openssl/stack.h | ||
727 | rsa_test.o: ../include/openssl/symhacks.h rsa_test.c | ||
728 | sha1test.o: ../e_os.h ../include/openssl/aes.h ../include/openssl/asn1.h | ||
729 | sha1test.o: ../include/openssl/bio.h ../include/openssl/blowfish.h | ||
730 | sha1test.o: ../include/openssl/bn.h ../include/openssl/cast.h | ||
731 | sha1test.o: ../include/openssl/crypto.h ../include/openssl/des.h | ||
732 | sha1test.o: ../include/openssl/des_old.h ../include/openssl/dh.h | ||
733 | sha1test.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h | ||
734 | sha1test.o: ../include/openssl/evp.h ../include/openssl/idea.h | ||
735 | sha1test.o: ../include/openssl/md2.h ../include/openssl/md4.h | ||
736 | sha1test.o: ../include/openssl/md5.h ../include/openssl/mdc2.h | ||
737 | sha1test.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h | ||
738 | sha1test.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
739 | sha1test.o: ../include/openssl/ossl_typ.h ../include/openssl/rc2.h | ||
740 | sha1test.o: ../include/openssl/rc4.h ../include/openssl/rc5.h | ||
741 | sha1test.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h | ||
742 | sha1test.o: ../include/openssl/safestack.h ../include/openssl/sha.h | ||
743 | sha1test.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | ||
744 | sha1test.o: ../include/openssl/ui.h ../include/openssl/ui_compat.h sha1test.c | ||
745 | shatest.o: ../e_os.h ../include/openssl/aes.h ../include/openssl/asn1.h | ||
746 | shatest.o: ../include/openssl/bio.h ../include/openssl/blowfish.h | ||
747 | shatest.o: ../include/openssl/bn.h ../include/openssl/cast.h | ||
748 | shatest.o: ../include/openssl/crypto.h ../include/openssl/des.h | ||
749 | shatest.o: ../include/openssl/des_old.h ../include/openssl/dh.h | ||
750 | shatest.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h | ||
751 | shatest.o: ../include/openssl/evp.h ../include/openssl/idea.h | ||
752 | shatest.o: ../include/openssl/md2.h ../include/openssl/md4.h | ||
753 | shatest.o: ../include/openssl/md5.h ../include/openssl/mdc2.h | ||
754 | shatest.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h | ||
755 | shatest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
756 | shatest.o: ../include/openssl/ossl_typ.h ../include/openssl/rc2.h | ||
757 | shatest.o: ../include/openssl/rc4.h ../include/openssl/rc5.h | ||
758 | shatest.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h | ||
759 | shatest.o: ../include/openssl/safestack.h ../include/openssl/sha.h | ||
760 | shatest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | ||
761 | shatest.o: ../include/openssl/ui.h ../include/openssl/ui_compat.h shatest.c | ||
762 | ssltest.o: ../e_os.h ../include/openssl/aes.h ../include/openssl/asn1.h | ||
763 | ssltest.o: ../include/openssl/bio.h ../include/openssl/blowfish.h | ||
764 | ssltest.o: ../include/openssl/bn.h ../include/openssl/buffer.h | ||
765 | ssltest.o: ../include/openssl/cast.h ../include/openssl/comp.h | ||
766 | ssltest.o: ../include/openssl/conf.h ../include/openssl/crypto.h | ||
767 | ssltest.o: ../include/openssl/des.h ../include/openssl/des_old.h | ||
768 | ssltest.o: ../include/openssl/dh.h ../include/openssl/dsa.h | ||
769 | ssltest.o: ../include/openssl/e_os2.h ../include/openssl/engine.h | ||
770 | ssltest.o: ../include/openssl/err.h ../include/openssl/evp.h | ||
771 | ssltest.o: ../include/openssl/fips.h ../include/openssl/idea.h | ||
772 | ssltest.o: ../include/openssl/kssl.h ../include/openssl/lhash.h | ||
773 | ssltest.o: ../include/openssl/md2.h ../include/openssl/md4.h | ||
774 | ssltest.o: ../include/openssl/md5.h ../include/openssl/mdc2.h | ||
775 | ssltest.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h | ||
776 | ssltest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
777 | ssltest.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | ||
778 | ssltest.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | ||
779 | ssltest.o: ../include/openssl/rand.h ../include/openssl/rc2.h | ||
780 | ssltest.o: ../include/openssl/rc4.h ../include/openssl/rc5.h | ||
781 | ssltest.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h | ||
782 | ssltest.o: ../include/openssl/safestack.h ../include/openssl/sha.h | ||
783 | ssltest.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h | ||
784 | ssltest.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h | ||
785 | ssltest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | ||
786 | ssltest.o: ../include/openssl/tls1.h ../include/openssl/ui.h | ||
787 | ssltest.o: ../include/openssl/ui_compat.h ../include/openssl/x509.h | ||
788 | ssltest.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h ssltest.c | ||
diff --git a/src/lib/libssl/test/P1ss.cnf b/src/lib/libssl/test/P1ss.cnf new file mode 100644 index 0000000000..876a0d35f8 --- /dev/null +++ b/src/lib/libssl/test/P1ss.cnf | |||
@@ -0,0 +1,37 @@ | |||
1 | # | ||
2 | # SSLeay example configuration file. | ||
3 | # This is mostly being used for generation of certificate requests. | ||
4 | # | ||
5 | |||
6 | RANDFILE = ./.rnd | ||
7 | |||
8 | #################################################################### | ||
9 | [ req ] | ||
10 | default_bits = 512 | ||
11 | default_keyfile = keySS.pem | ||
12 | distinguished_name = req_distinguished_name | ||
13 | encrypt_rsa_key = no | ||
14 | default_md = md2 | ||
15 | |||
16 | [ req_distinguished_name ] | ||
17 | countryName = Country Name (2 letter code) | ||
18 | countryName_default = AU | ||
19 | countryName_value = AU | ||
20 | |||
21 | organizationName = Organization Name (eg, company) | ||
22 | organizationName_value = Dodgy Brothers | ||
23 | |||
24 | 0.commonName = Common Name (eg, YOUR name) | ||
25 | 0.commonName_value = Brother 1 | ||
26 | |||
27 | 1.commonName = Common Name (eg, YOUR name) | ||
28 | 1.commonName_value = Brother 2 | ||
29 | |||
30 | 2.commonName = Common Name (eg, YOUR name) | ||
31 | 2.commonName_value = Proxy 1 | ||
32 | |||
33 | [ v3_proxy ] | ||
34 | basicConstraints=CA:FALSE | ||
35 | subjectKeyIdentifier=hash | ||
36 | authorityKeyIdentifier=keyid,issuer:always | ||
37 | proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:1,policy:text:AB | ||
diff --git a/src/lib/libssl/test/P2ss.cnf b/src/lib/libssl/test/P2ss.cnf new file mode 100644 index 0000000000..373a87e7c2 --- /dev/null +++ b/src/lib/libssl/test/P2ss.cnf | |||
@@ -0,0 +1,45 @@ | |||
1 | # | ||
2 | # SSLeay example configuration file. | ||
3 | # This is mostly being used for generation of certificate requests. | ||
4 | # | ||
5 | |||
6 | RANDFILE = ./.rnd | ||
7 | |||
8 | #################################################################### | ||
9 | [ req ] | ||
10 | default_bits = 512 | ||
11 | default_keyfile = keySS.pem | ||
12 | distinguished_name = req_distinguished_name | ||
13 | encrypt_rsa_key = no | ||
14 | default_md = md2 | ||
15 | |||
16 | [ req_distinguished_name ] | ||
17 | countryName = Country Name (2 letter code) | ||
18 | countryName_default = AU | ||
19 | countryName_value = AU | ||
20 | |||
21 | organizationName = Organization Name (eg, company) | ||
22 | organizationName_value = Dodgy Brothers | ||
23 | |||
24 | 0.commonName = Common Name (eg, YOUR name) | ||
25 | 0.commonName_value = Brother 1 | ||
26 | |||
27 | 1.commonName = Common Name (eg, YOUR name) | ||
28 | 1.commonName_value = Brother 2 | ||
29 | |||
30 | 2.commonName = Common Name (eg, YOUR name) | ||
31 | 2.commonName_value = Proxy 1 | ||
32 | |||
33 | 3.commonName = Common Name (eg, YOUR name) | ||
34 | 3.commonName_value = Proxy 2 | ||
35 | |||
36 | [ v3_proxy ] | ||
37 | basicConstraints=CA:FALSE | ||
38 | subjectKeyIdentifier=hash | ||
39 | authorityKeyIdentifier=keyid,issuer:always | ||
40 | proxyCertInfo=critical,@proxy_ext | ||
41 | |||
42 | [ proxy_ext ] | ||
43 | language=id-ppl-anyLanguage | ||
44 | pathlen=0 | ||
45 | policy=text:BC | ||
diff --git a/src/lib/libssl/test/Sssdsa.cnf b/src/lib/libssl/test/Sssdsa.cnf new file mode 100644 index 0000000000..8e170a28ef --- /dev/null +++ b/src/lib/libssl/test/Sssdsa.cnf | |||
@@ -0,0 +1,27 @@ | |||
1 | # | ||
2 | # SSLeay example configuration file. | ||
3 | # This is mostly being used for generation of certificate requests. | ||
4 | # | ||
5 | # hacked by iang to do DSA certs - Server | ||
6 | |||
7 | RANDFILE = ./.rnd | ||
8 | |||
9 | #################################################################### | ||
10 | [ req ] | ||
11 | distinguished_name = req_distinguished_name | ||
12 | encrypt_rsa_key = no | ||
13 | |||
14 | [ req_distinguished_name ] | ||
15 | countryName = Country Name (2 letter code) | ||
16 | countryName_default = ES | ||
17 | countryName_value = ES | ||
18 | |||
19 | organizationName = Organization Name (eg, company) | ||
20 | organizationName_value = Tortilleras S.A. | ||
21 | |||
22 | 0.commonName = Common Name (eg, YOUR name) | ||
23 | 0.commonName_value = Torti | ||
24 | |||
25 | 1.commonName = Common Name (eg, YOUR name) | ||
26 | 1.commonName_value = Gordita | ||
27 | |||
diff --git a/src/lib/libssl/test/Sssrsa.cnf b/src/lib/libssl/test/Sssrsa.cnf new file mode 100644 index 0000000000..8c79a03fca --- /dev/null +++ b/src/lib/libssl/test/Sssrsa.cnf | |||
@@ -0,0 +1,26 @@ | |||
1 | # | ||
2 | # SSLeay example configuration file. | ||
3 | # This is mostly being used for generation of certificate requests. | ||
4 | # | ||
5 | # create RSA certs - Server | ||
6 | |||
7 | RANDFILE = ./.rnd | ||
8 | |||
9 | #################################################################### | ||
10 | [ req ] | ||
11 | distinguished_name = req_distinguished_name | ||
12 | encrypt_key = no | ||
13 | |||
14 | [ req_distinguished_name ] | ||
15 | countryName = Country Name (2 letter code) | ||
16 | countryName_default = ES | ||
17 | countryName_value = ES | ||
18 | |||
19 | organizationName = Organization Name (eg, company) | ||
20 | organizationName_value = Tortilleras S.A. | ||
21 | |||
22 | 0.commonName = Common Name (eg, YOUR name) | ||
23 | 0.commonName_value = Torti | ||
24 | |||
25 | 1.commonName = Common Name (eg, YOUR name) | ||
26 | 1.commonName_value = Gordita | ||
diff --git a/src/lib/libssl/test/Uss.cnf b/src/lib/libssl/test/Uss.cnf new file mode 100644 index 0000000000..0c0ebb5f67 --- /dev/null +++ b/src/lib/libssl/test/Uss.cnf | |||
@@ -0,0 +1,36 @@ | |||
1 | # | ||
2 | # SSLeay example configuration file. | ||
3 | # This is mostly being used for generation of certificate requests. | ||
4 | # | ||
5 | |||
6 | RANDFILE = ./.rnd | ||
7 | |||
8 | #################################################################### | ||
9 | [ req ] | ||
10 | default_bits = 512 | ||
11 | default_keyfile = keySS.pem | ||
12 | distinguished_name = req_distinguished_name | ||
13 | encrypt_rsa_key = no | ||
14 | default_md = md2 | ||
15 | |||
16 | [ req_distinguished_name ] | ||
17 | countryName = Country Name (2 letter code) | ||
18 | countryName_default = AU | ||
19 | countryName_value = AU | ||
20 | |||
21 | organizationName = Organization Name (eg, company) | ||
22 | organizationName_value = Dodgy Brothers | ||
23 | |||
24 | 0.commonName = Common Name (eg, YOUR name) | ||
25 | 0.commonName_value = Brother 1 | ||
26 | |||
27 | 1.commonName = Common Name (eg, YOUR name) | ||
28 | 1.commonName_value = Brother 2 | ||
29 | |||
30 | [ v3_ee ] | ||
31 | subjectKeyIdentifier=hash | ||
32 | authorityKeyIdentifier=keyid,issuer:always | ||
33 | basicConstraints = CA:false | ||
34 | keyUsage = nonRepudiation, digitalSignature, keyEncipherment | ||
35 | issuerAltName=issuer:copy | ||
36 | |||
diff --git a/src/lib/libssl/test/VMSca-response.1 b/src/lib/libssl/test/VMSca-response.1 new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/src/lib/libssl/test/VMSca-response.1 | |||
@@ -0,0 +1 @@ | |||
diff --git a/src/lib/libssl/test/VMSca-response.2 b/src/lib/libssl/test/VMSca-response.2 new file mode 100644 index 0000000000..9b48ee4cf9 --- /dev/null +++ b/src/lib/libssl/test/VMSca-response.2 | |||
@@ -0,0 +1,2 @@ | |||
1 | y | ||
2 | y | ||
diff --git a/src/lib/libssl/test/bctest b/src/lib/libssl/test/bctest new file mode 100644 index 0000000000..e81fc0733a --- /dev/null +++ b/src/lib/libssl/test/bctest | |||
@@ -0,0 +1,111 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # This script is used by test/Makefile to check whether a sane 'bc' | ||
4 | # is installed. | ||
5 | # ('make test_bn' should not try to run 'bc' if it does not exist or if | ||
6 | # it is a broken 'bc' version that is known to cause trouble.) | ||
7 | # | ||
8 | # If 'bc' works, we also test if it knows the 'print' command. | ||
9 | # | ||
10 | # In any case, output an appropriate command line for running (or not | ||
11 | # running) bc. | ||
12 | |||
13 | |||
14 | IFS=: | ||
15 | try_without_dir=true | ||
16 | # First we try "bc", then "$dir/bc" for each item in $PATH. | ||
17 | for dir in dummy:$PATH; do | ||
18 | if [ "$try_without_dir" = true ]; then | ||
19 | # first iteration | ||
20 | bc=bc | ||
21 | try_without_dir=false | ||
22 | else | ||
23 | # second and later iterations | ||
24 | bc="$dir/bc" | ||
25 | if [ ! -f "$bc" ]; then # '-x' is not available on Ultrix | ||
26 | bc='' | ||
27 | fi | ||
28 | fi | ||
29 | |||
30 | if [ ! "$bc" = '' ]; then | ||
31 | failure=none | ||
32 | |||
33 | |||
34 | # Test for SunOS 5.[78] bc bug | ||
35 | "$bc" >tmp.bctest <<\EOF | ||
36 | obase=16 | ||
37 | ibase=16 | ||
38 | a=AD88C418F31B3FC712D0425001D522B3AE9134FF3A98C13C1FCC1682211195406C1A6C66C6A\ | ||
39 | CEEC1A0EC16950233F77F1C2F2363D56DD71A36C57E0B2511FC4BA8F22D261FE2E9356D99AF57\ | ||
40 | 10F3817C0E05BF79C423C3F66FDF321BE8D3F18F625D91B670931C1EF25F28E489BDA1C5422D1\ | ||
41 | C3F6F7A1AD21585746ECC4F10A14A778AF56F08898E965E9909E965E0CB6F85B514150C644759\ | ||
42 | 3BE731877B16EA07B552088FF2EA728AC5E0FF3A23EB939304519AB8B60F2C33D6BA0945B66F0\ | ||
43 | 4FC3CADF855448B24A9D7640BCF473E | ||
44 | b=DCE91E7D120B983EA9A104B5A96D634DD644C37657B1C7860B45E6838999B3DCE5A555583C6\ | ||
45 | 9209E41F413422954175A06E67FFEF6746DD652F0F48AEFECC3D8CAC13523BDAAD3F5AF4212BD\ | ||
46 | 8B3CD64126E1A82E190228020C05B91C8B141F1110086FC2A4C6ED631EBA129D04BB9A19FC53D\ | ||
47 | 3ED0E2017D60A68775B75481449 | ||
48 | (a/b)*b + (a%b) - a | ||
49 | EOF | ||
50 | if [ 0 != "`cat tmp.bctest`" ]; then | ||
51 | failure=SunOStest | ||
52 | fi | ||
53 | |||
54 | |||
55 | if [ "$failure" = none ]; then | ||
56 | # Test for SCO bc bug. | ||
57 | "$bc" >tmp.bctest <<\EOF | ||
58 | obase=16 | ||
59 | ibase=16 | ||
60 | -FFDD63BA1A4648F0D804F8A1C66C53F0D2110590E8A3907EC73B4AEC6F15AC177F176F2274D2\ | ||
61 | 9DC8022EA0D7DD3ABE9746D2D46DD3EA5B5F6F69DF12877E0AC5E7F5ADFACEE54573F5D256A06\ | ||
62 | 11B5D2BC24947724E22AE4EC3FB0C39D9B4694A01AFE5E43B4D99FB9812A0E4A5773D8B254117\ | ||
63 | 1239157EC6E3D8D50199 * -FFDD63BA1A4648F0D804F8A1C66C53F0D2110590E8A3907EC73B4\ | ||
64 | AEC6F15AC177F176F2274D29DC8022EA0D7DD3ABE9746D2D46DD3EA5B5F6F69DF12877E0AC5E7\ | ||
65 | F5ADFACEE54573F5D256A0611B5D2BC24947724E22AE4EC3FB0C39D9B4694A01AFE5E43B4D99F\ | ||
66 | B9812A0E4A5773D8B2541171239157EC6E3D8D50199 - FFBACC221682DA464B6D7F123482522\ | ||
67 | 02EDAEDCA38C3B69E9B7BBCD6165A9CD8716C4903417F23C09A85B851961F92C217258CEEB866\ | ||
68 | 85EFCC5DD131853A02C07A873B8E2AF2E40C6D5ED598CD0E8F35AD49F3C3A17FDB7653E4E2DC4\ | ||
69 | A8D23CC34686EE4AD01F7407A7CD74429AC6D36DBF0CB6A3E302D0E5BDFCD048A3B90C1BE5AA8\ | ||
70 | E16C3D5884F9136B43FF7BB443764153D4AEC176C681B078F4CC53D6EB6AB76285537DDEE7C18\ | ||
71 | 8C72441B52EDBDDBC77E02D34E513F2AABF92F44109CAFE8242BD0ECBAC5604A94B02EA44D43C\ | ||
72 | 04E9476E6FBC48043916BFA1485C6093603600273C9C33F13114D78064AE42F3DC466C7DA543D\ | ||
73 | 89C8D71 | ||
74 | AD534AFBED2FA39EE9F40E20FCF9E2C861024DB98DDCBA1CD118C49CA55EEBC20D6BA51B2271C\ | ||
75 | 928B693D6A73F67FEB1B4571448588B46194617D25D910C6A9A130CC963155CF34079CB218A44\ | ||
76 | 8A1F57E276D92A33386DDCA3D241DB78C8974ABD71DD05B0FA555709C9910D745185E6FE108E3\ | ||
77 | 37F1907D0C56F8BFBF52B9704 % -E557905B56B13441574CAFCE2BD257A750B1A8B2C88D0E36\ | ||
78 | E18EF7C38DAC80D3948E17ED63AFF3B3467866E3B89D09A81B3D16B52F6A3C7134D3C6F5123E9\ | ||
79 | F617E3145BBFBE9AFD0D6E437EA4FF6F04BC67C4F1458B4F0F47B64 - 1C2BBBB19B74E86FD32\ | ||
80 | 9E8DB6A8C3B1B9986D57ED5419C2E855F7D5469E35E76334BB42F4C43E3F3A31B9697C171DAC4\ | ||
81 | D97935A7E1A14AD209D6CF811F55C6DB83AA9E6DFECFCD6669DED7171EE22A40C6181615CAF3F\ | ||
82 | 5296964 | ||
83 | EOF | ||
84 | if [ "0 | ||
85 | 0" != "`cat tmp.bctest`" ]; then | ||
86 | failure=SCOtest | ||
87 | fi | ||
88 | fi | ||
89 | |||
90 | |||
91 | if [ "$failure" = none ]; then | ||
92 | # bc works; now check if it knows the 'print' command. | ||
93 | if [ "OK" = "`echo 'print \"OK\"' | $bc 2>/dev/null`" ] | ||
94 | then | ||
95 | echo "$bc" | ||
96 | else | ||
97 | echo "sed 's/print.*//' | $bc" | ||
98 | fi | ||
99 | exit 0 | ||
100 | fi | ||
101 | |||
102 | echo "$bc does not work properly ('$failure' failed). Looking for another bc ..." >&2 | ||
103 | fi | ||
104 | done | ||
105 | |||
106 | echo "No working bc found. Consider installing GNU bc." >&2 | ||
107 | if [ "$1" = ignore ]; then | ||
108 | echo "cat >/dev/null" | ||
109 | exit 0 | ||
110 | fi | ||
111 | exit 1 | ||
diff --git a/src/lib/libssl/test/dummytest.c b/src/lib/libssl/test/dummytest.c new file mode 100644 index 0000000000..5b4467e042 --- /dev/null +++ b/src/lib/libssl/test/dummytest.c | |||
@@ -0,0 +1,48 @@ | |||
1 | #include <stdio.h> | ||
2 | #include <stdlib.h> | ||
3 | #include <string.h> | ||
4 | #include <ctype.h> | ||
5 | #include <openssl/e_os2.h> | ||
6 | #include <openssl/buffer.h> | ||
7 | #include <openssl/crypto.h> | ||
8 | |||
9 | int main(int argc, char *argv[]) | ||
10 | { | ||
11 | char *p, *q = 0, *program; | ||
12 | |||
13 | p = strrchr(argv[0], '/'); | ||
14 | if (!p) p = strrchr(argv[0], '\\'); | ||
15 | #ifdef OPENSSL_SYS_VMS | ||
16 | if (!p) p = strrchr(argv[0], ']'); | ||
17 | if (p) q = strrchr(p, '>'); | ||
18 | if (q) p = q; | ||
19 | if (!p) p = strrchr(argv[0], ':'); | ||
20 | q = 0; | ||
21 | #endif | ||
22 | if (p) p++; | ||
23 | if (!p) p = argv[0]; | ||
24 | if (p) q = strchr(p, '.'); | ||
25 | if (p && !q) q = p + strlen(p); | ||
26 | |||
27 | if (!p) | ||
28 | program = BUF_strdup("(unknown)"); | ||
29 | else | ||
30 | { | ||
31 | program = OPENSSL_malloc((q - p) + 1); | ||
32 | strncpy(program, p, q - p); | ||
33 | program[q - p] = '\0'; | ||
34 | } | ||
35 | |||
36 | for(p = program; *p; p++) | ||
37 | if (islower((unsigned char)(*p))) | ||
38 | *p = toupper((unsigned char)(*p)); | ||
39 | |||
40 | q = strstr(program, "TEST"); | ||
41 | if (q > p && q[-1] == '_') q--; | ||
42 | *q = '\0'; | ||
43 | |||
44 | printf("No %s support\n", program); | ||
45 | |||
46 | OPENSSL_free(program); | ||
47 | return(0); | ||
48 | } | ||
diff --git a/src/lib/libssl/test/enginetest.c b/src/lib/libssl/test/enginetest.c new file mode 100644 index 0000000000..87fa8c57b7 --- /dev/null +++ b/src/lib/libssl/test/enginetest.c | |||
@@ -0,0 +1,274 @@ | |||
1 | /* crypto/engine/enginetest.c */ | ||
2 | /* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL | ||
3 | * project 2000. | ||
4 | */ | ||
5 | /* ==================================================================== | ||
6 | * Copyright (c) 1999-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 <openssl/e_os2.h> | ||
60 | #include <stdio.h> | ||
61 | #include <string.h> | ||
62 | #include <openssl/buffer.h> | ||
63 | #include <openssl/crypto.h> | ||
64 | #include <openssl/engine.h> | ||
65 | #include <openssl/err.h> | ||
66 | |||
67 | static void display_engine_list() | ||
68 | { | ||
69 | ENGINE *h; | ||
70 | int loop; | ||
71 | |||
72 | h = ENGINE_get_first(); | ||
73 | loop = 0; | ||
74 | printf("listing available engine types\n"); | ||
75 | while(h) | ||
76 | { | ||
77 | printf("engine %i, id = \"%s\", name = \"%s\"\n", | ||
78 | loop++, ENGINE_get_id(h), ENGINE_get_name(h)); | ||
79 | h = ENGINE_get_next(h); | ||
80 | } | ||
81 | printf("end of list\n"); | ||
82 | /* ENGINE_get_first() increases the struct_ref counter, so we | ||
83 | must call ENGINE_free() to decrease it again */ | ||
84 | ENGINE_free(h); | ||
85 | } | ||
86 | |||
87 | int main(int argc, char *argv[]) | ||
88 | { | ||
89 | ENGINE *block[512]; | ||
90 | char buf[256]; | ||
91 | const char *id, *name; | ||
92 | ENGINE *ptr; | ||
93 | int loop; | ||
94 | int to_return = 1; | ||
95 | ENGINE *new_h1 = NULL; | ||
96 | ENGINE *new_h2 = NULL; | ||
97 | ENGINE *new_h3 = NULL; | ||
98 | ENGINE *new_h4 = NULL; | ||
99 | |||
100 | /* enable memory leak checking unless explicitly disabled */ | ||
101 | if (!((getenv("OPENSSL_DEBUG_MEMORY") != NULL) && (0 == strcmp(getenv("OPENSSL_DEBUG_MEMORY"), "off")))) | ||
102 | { | ||
103 | CRYPTO_malloc_debug_init(); | ||
104 | CRYPTO_set_mem_debug_options(V_CRYPTO_MDEBUG_ALL); | ||
105 | } | ||
106 | else | ||
107 | { | ||
108 | /* OPENSSL_DEBUG_MEMORY=off */ | ||
109 | CRYPTO_set_mem_debug_functions(0, 0, 0, 0, 0); | ||
110 | } | ||
111 | CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON); | ||
112 | ERR_load_crypto_strings(); | ||
113 | |||
114 | memset(block, 0, 512 * sizeof(ENGINE *)); | ||
115 | if(((new_h1 = ENGINE_new()) == NULL) || | ||
116 | !ENGINE_set_id(new_h1, "test_id0") || | ||
117 | !ENGINE_set_name(new_h1, "First test item") || | ||
118 | ((new_h2 = ENGINE_new()) == NULL) || | ||
119 | !ENGINE_set_id(new_h2, "test_id1") || | ||
120 | !ENGINE_set_name(new_h2, "Second test item") || | ||
121 | ((new_h3 = ENGINE_new()) == NULL) || | ||
122 | !ENGINE_set_id(new_h3, "test_id2") || | ||
123 | !ENGINE_set_name(new_h3, "Third test item") || | ||
124 | ((new_h4 = ENGINE_new()) == NULL) || | ||
125 | !ENGINE_set_id(new_h4, "test_id3") || | ||
126 | !ENGINE_set_name(new_h4, "Fourth test item")) | ||
127 | { | ||
128 | printf("Couldn't set up test ENGINE structures\n"); | ||
129 | goto end; | ||
130 | } | ||
131 | printf("\nenginetest beginning\n\n"); | ||
132 | display_engine_list(); | ||
133 | if(!ENGINE_add(new_h1)) | ||
134 | { | ||
135 | printf("Add failed!\n"); | ||
136 | goto end; | ||
137 | } | ||
138 | display_engine_list(); | ||
139 | ptr = ENGINE_get_first(); | ||
140 | if(!ENGINE_remove(ptr)) | ||
141 | { | ||
142 | printf("Remove failed!\n"); | ||
143 | goto end; | ||
144 | } | ||
145 | if (ptr) | ||
146 | ENGINE_free(ptr); | ||
147 | display_engine_list(); | ||
148 | if(!ENGINE_add(new_h3) || !ENGINE_add(new_h2)) | ||
149 | { | ||
150 | printf("Add failed!\n"); | ||
151 | goto end; | ||
152 | } | ||
153 | display_engine_list(); | ||
154 | if(!ENGINE_remove(new_h2)) | ||
155 | { | ||
156 | printf("Remove failed!\n"); | ||
157 | goto end; | ||
158 | } | ||
159 | display_engine_list(); | ||
160 | if(!ENGINE_add(new_h4)) | ||
161 | { | ||
162 | printf("Add failed!\n"); | ||
163 | goto end; | ||
164 | } | ||
165 | display_engine_list(); | ||
166 | if(ENGINE_add(new_h3)) | ||
167 | { | ||
168 | printf("Add *should* have failed but didn't!\n"); | ||
169 | goto end; | ||
170 | } | ||
171 | else | ||
172 | printf("Add that should fail did.\n"); | ||
173 | ERR_clear_error(); | ||
174 | if(ENGINE_remove(new_h2)) | ||
175 | { | ||
176 | printf("Remove *should* have failed but didn't!\n"); | ||
177 | goto end; | ||
178 | } | ||
179 | else | ||
180 | printf("Remove that should fail did.\n"); | ||
181 | ERR_clear_error(); | ||
182 | if(!ENGINE_remove(new_h3)) | ||
183 | { | ||
184 | printf("Remove failed!\n"); | ||
185 | goto end; | ||
186 | } | ||
187 | display_engine_list(); | ||
188 | if(!ENGINE_remove(new_h4)) | ||
189 | { | ||
190 | printf("Remove failed!\n"); | ||
191 | goto end; | ||
192 | } | ||
193 | display_engine_list(); | ||
194 | /* Depending on whether there's any hardware support compiled | ||
195 | * in, this remove may be destined to fail. */ | ||
196 | ptr = ENGINE_get_first(); | ||
197 | if(ptr) | ||
198 | if(!ENGINE_remove(ptr)) | ||
199 | printf("Remove failed!i - probably no hardware " | ||
200 | "support present.\n"); | ||
201 | if (ptr) | ||
202 | ENGINE_free(ptr); | ||
203 | display_engine_list(); | ||
204 | if(!ENGINE_add(new_h1) || !ENGINE_remove(new_h1)) | ||
205 | { | ||
206 | printf("Couldn't add and remove to an empty list!\n"); | ||
207 | goto end; | ||
208 | } | ||
209 | else | ||
210 | printf("Successfully added and removed to an empty list!\n"); | ||
211 | printf("About to beef up the engine-type list\n"); | ||
212 | for(loop = 0; loop < 512; loop++) | ||
213 | { | ||
214 | sprintf(buf, "id%i", loop); | ||
215 | id = BUF_strdup(buf); | ||
216 | sprintf(buf, "Fake engine type %i", loop); | ||
217 | name = BUF_strdup(buf); | ||
218 | if(((block[loop] = ENGINE_new()) == NULL) || | ||
219 | !ENGINE_set_id(block[loop], id) || | ||
220 | !ENGINE_set_name(block[loop], name)) | ||
221 | { | ||
222 | printf("Couldn't create block of ENGINE structures.\n" | ||
223 | "I'll probably also core-dump now, damn.\n"); | ||
224 | goto end; | ||
225 | } | ||
226 | } | ||
227 | for(loop = 0; loop < 512; loop++) | ||
228 | { | ||
229 | if(!ENGINE_add(block[loop])) | ||
230 | { | ||
231 | printf("\nAdding stopped at %i, (%s,%s)\n", | ||
232 | loop, ENGINE_get_id(block[loop]), | ||
233 | ENGINE_get_name(block[loop])); | ||
234 | goto cleanup_loop; | ||
235 | } | ||
236 | else | ||
237 | printf("."); fflush(stdout); | ||
238 | } | ||
239 | cleanup_loop: | ||
240 | printf("\nAbout to empty the engine-type list\n"); | ||
241 | while((ptr = ENGINE_get_first()) != NULL) | ||
242 | { | ||
243 | if(!ENGINE_remove(ptr)) | ||
244 | { | ||
245 | printf("\nRemove failed!\n"); | ||
246 | goto end; | ||
247 | } | ||
248 | ENGINE_free(ptr); | ||
249 | printf("."); fflush(stdout); | ||
250 | } | ||
251 | for(loop = 0; loop < 512; loop++) | ||
252 | { | ||
253 | OPENSSL_free((void *)ENGINE_get_id(block[loop])); | ||
254 | OPENSSL_free((void *)ENGINE_get_name(block[loop])); | ||
255 | } | ||
256 | printf("\nTests completed happily\n"); | ||
257 | to_return = 0; | ||
258 | end: | ||
259 | if(to_return) | ||
260 | ERR_print_errors_fp(stderr); | ||
261 | if(new_h1) ENGINE_free(new_h1); | ||
262 | if(new_h2) ENGINE_free(new_h2); | ||
263 | if(new_h3) ENGINE_free(new_h3); | ||
264 | if(new_h4) ENGINE_free(new_h4); | ||
265 | for(loop = 0; loop < 512; loop++) | ||
266 | if(block[loop]) | ||
267 | ENGINE_free(block[loop]); | ||
268 | ENGINE_cleanup(); | ||
269 | CRYPTO_cleanup_all_ex_data(); | ||
270 | ERR_free_strings(); | ||
271 | ERR_remove_state(0); | ||
272 | CRYPTO_mem_leaks_fp(stderr); | ||
273 | return to_return; | ||
274 | } | ||
diff --git a/src/lib/libssl/test/evptests.txt b/src/lib/libssl/test/evptests.txt new file mode 100644 index 0000000000..dfe91a5bc0 --- /dev/null +++ b/src/lib/libssl/test/evptests.txt | |||
@@ -0,0 +1,288 @@ | |||
1 | #cipher:key:iv:plaintext:ciphertext:0/1(decrypt/encrypt) | ||
2 | #digest:::input:output | ||
3 | |||
4 | # SHA(1) tests (from shatest.c) | ||
5 | SHA1:::616263:a9993e364706816aba3e25717850c26c9cd0d89d | ||
6 | |||
7 | # MD5 tests (from md5test.c) | ||
8 | MD5::::d41d8cd98f00b204e9800998ecf8427e | ||
9 | MD5:::61:0cc175b9c0f1b6a831c399e269772661 | ||
10 | MD5:::616263:900150983cd24fb0d6963f7d28e17f72 | ||
11 | MD5:::6d65737361676520646967657374:f96b697d7cb7938d525a2f31aaf161d0 | ||
12 | MD5:::6162636465666768696a6b6c6d6e6f707172737475767778797a:c3fcd3d76192e4007dfb496cca67e13b | ||
13 | MD5:::4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a30313233343536373839:d174ab98d277d9f5a5611c2c9f419d9f | ||
14 | MD5:::3132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930:57edf4a22be3c955ac49da2e2107b67a | ||
15 | |||
16 | # AES 128 ECB tests (from FIPS-197 test vectors, encrypt) | ||
17 | |||
18 | AES-128-ECB:000102030405060708090A0B0C0D0E0F::00112233445566778899AABBCCDDEEFF:69C4E0D86A7B0430D8CDB78070B4C55A:1 | ||
19 | |||
20 | # AES 192 ECB tests (from FIPS-197 test vectors, encrypt) | ||
21 | |||
22 | AES-192-ECB:000102030405060708090A0B0C0D0E0F1011121314151617::00112233445566778899AABBCCDDEEFF:DDA97CA4864CDFE06EAF70A0EC0D7191:1 | ||
23 | |||
24 | # AES 256 ECB tests (from FIPS-197 test vectors, encrypt) | ||
25 | |||
26 | AES-256-ECB:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F::00112233445566778899AABBCCDDEEFF:8EA2B7CA516745BFEAFC49904B496089:1 | ||
27 | |||
28 | # AES 128 ECB tests (from NIST test vectors, encrypt) | ||
29 | |||
30 | #AES-128-ECB:00000000000000000000000000000000::00000000000000000000000000000000:C34C052CC0DA8D73451AFE5F03BE297F:1 | ||
31 | |||
32 | # AES 128 ECB tests (from NIST test vectors, decrypt) | ||
33 | |||
34 | #AES-128-ECB:00000000000000000000000000000000::44416AC2D1F53C583303917E6BE9EBE0:00000000000000000000000000000000:0 | ||
35 | |||
36 | # AES 192 ECB tests (from NIST test vectors, decrypt) | ||
37 | |||
38 | #AES-192-ECB:000000000000000000000000000000000000000000000000::48E31E9E256718F29229319C19F15BA4:00000000000000000000000000000000:0 | ||
39 | |||
40 | # AES 256 ECB tests (from NIST test vectors, decrypt) | ||
41 | |||
42 | #AES-256-ECB:0000000000000000000000000000000000000000000000000000000000000000::058CCFFDBBCB382D1F6F56585D8A4ADE:00000000000000000000000000000000:0 | ||
43 | |||
44 | # AES 128 CBC tests (from NIST test vectors, encrypt) | ||
45 | |||
46 | #AES-128-CBC:00000000000000000000000000000000:00000000000000000000000000000000:00000000000000000000000000000000:8A05FC5E095AF4848A08D328D3688E3D:1 | ||
47 | |||
48 | # AES 192 CBC tests (from NIST test vectors, encrypt) | ||
49 | |||
50 | #AES-192-CBC:000000000000000000000000000000000000000000000000:00000000000000000000000000000000:00000000000000000000000000000000:7BD966D53AD8C1BB85D2ADFAE87BB104:1 | ||
51 | |||
52 | # AES 256 CBC tests (from NIST test vectors, encrypt) | ||
53 | |||
54 | #AES-256-CBC:0000000000000000000000000000000000000000000000000000000000000000:00000000000000000000000000000000:00000000000000000000000000000000:FE3C53653E2F45B56FCD88B2CC898FF0:1 | ||
55 | |||
56 | # AES 128 CBC tests (from NIST test vectors, decrypt) | ||
57 | |||
58 | #AES-128-CBC:00000000000000000000000000000000:00000000000000000000000000000000:FACA37E0B0C85373DF706E73F7C9AF86:00000000000000000000000000000000:0 | ||
59 | |||
60 | # AES tests from NIST document SP800-38A | ||
61 | # For all ECB encrypts and decrypts, the transformed sequence is | ||
62 | # AES-bits-ECB:key::plaintext:ciphertext:encdec | ||
63 | # ECB-AES128.Encrypt and ECB-AES128.Decrypt | ||
64 | AES-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::6BC1BEE22E409F96E93D7E117393172A:3AD77BB40D7A3660A89ECAF32466EF97 | ||
65 | AES-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::AE2D8A571E03AC9C9EB76FAC45AF8E51:F5D3D58503B9699DE785895A96FDBAAF | ||
66 | AES-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::30C81C46A35CE411E5FBC1191A0A52EF:43B1CD7F598ECE23881B00E3ED030688 | ||
67 | AES-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::F69F2445DF4F9B17AD2B417BE66C3710:7B0C785E27E8AD3F8223207104725DD4 | ||
68 | # ECB-AES192.Encrypt and ECB-AES192.Decrypt | ||
69 | AES-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::6BC1BEE22E409F96E93D7E117393172A:BD334F1D6E45F25FF712A214571FA5CC | ||
70 | AES-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::AE2D8A571E03AC9C9EB76FAC45AF8E51:974104846D0AD3AD7734ECB3ECEE4EEF | ||
71 | AES-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::30C81C46A35CE411E5FBC1191A0A52EF:EF7AFD2270E2E60ADCE0BA2FACE6444E | ||
72 | AES-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::F69F2445DF4F9B17AD2B417BE66C3710:9A4B41BA738D6C72FB16691603C18E0E | ||
73 | # ECB-AES256.Encrypt and ECB-AES256.Decrypt | ||
74 | AES-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::6BC1BEE22E409F96E93D7E117393172A:F3EED1BDB5D2A03C064B5A7E3DB181F8 | ||
75 | AES-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::AE2D8A571E03AC9C9EB76FAC45AF8E51:591CCB10D410ED26DC5BA74A31362870 | ||
76 | AES-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::30C81C46A35CE411E5FBC1191A0A52EF:B6ED21B99CA6F4F9F153E7B1BEAFED1D | ||
77 | AES-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::F69F2445DF4F9B17AD2B417BE66C3710:23304B7A39F9F3FF067D8D8F9E24ECC7 | ||
78 | # For all CBC encrypts and decrypts, the transformed sequence is | ||
79 | # AES-bits-CBC:key:IV/ciphertext':plaintext:ciphertext:encdec | ||
80 | # CBC-AES128.Encrypt and CBC-AES128.Decrypt | ||
81 | AES-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:7649ABAC8119B246CEE98E9B12E9197D | ||
82 | AES-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:7649ABAC8119B246CEE98E9B12E9197D:AE2D8A571E03AC9C9EB76FAC45AF8E51:5086CB9B507219EE95DB113A917678B2 | ||
83 | AES-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:5086CB9B507219EE95DB113A917678B2:30C81C46A35CE411E5FBC1191A0A52EF:73BED6B8E3C1743B7116E69E22229516 | ||
84 | AES-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:73BED6B8E3C1743B7116E69E22229516:F69F2445DF4F9B17AD2B417BE66C3710:3FF1CAA1681FAC09120ECA307586E1A7 | ||
85 | # CBC-AES192.Encrypt and CBC-AES192.Decrypt | ||
86 | AES-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:4F021DB243BC633D7178183A9FA071E8 | ||
87 | AES-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:4F021DB243BC633D7178183A9FA071E8:AE2D8A571E03AC9C9EB76FAC45AF8E51:B4D9ADA9AD7DEDF4E5E738763F69145A | ||
88 | AES-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:B4D9ADA9AD7DEDF4E5E738763F69145A:30C81C46A35CE411E5FBC1191A0A52EF:571B242012FB7AE07FA9BAAC3DF102E0 | ||
89 | AES-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:571B242012FB7AE07FA9BAAC3DF102E0:F69F2445DF4F9B17AD2B417BE66C3710:08B0E27988598881D920A9E64F5615CD | ||
90 | # CBC-AES256.Encrypt and CBC-AES256.Decrypt | ||
91 | AES-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:F58C4C04D6E5F1BA779EABFB5F7BFBD6 | ||
92 | AES-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:F58C4C04D6E5F1BA779EABFB5F7BFBD6:AE2D8A571E03AC9C9EB76FAC45AF8E51:9CFC4E967EDB808D679F777BC6702C7D | ||
93 | AES-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:9CFC4E967EDB808D679F777BC6702C7D:30C81C46A35CE411E5FBC1191A0A52EF:39F23369A9D9BACFA530E26304231461 | ||
94 | AES-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:39F23369A9D9BACFA530E26304231461:F69F2445DF4F9B17AD2B417BE66C3710:B2EB05E2C39BE9FCDA6C19078C6A9D1B | ||
95 | |||
96 | # CFB1-AES128.Encrypt | ||
97 | |||
98 | AES-128-CFB1:2b7e151628aed2a6abf7158809cf4f3c:000102030405060708090a0b0c0d0e0f:00:00:1 | ||
99 | AES-128-CFB1:2b7e151628aed2a6abf7158809cf4f3c:00020406080a0c0e10121416181a1c1e:80:80:1 | ||
100 | AES-128-CFB1:2b7e151628aed2a6abf7158809cf4f3c:0004080c1014181c2024282c3034383d:80:80:1 | ||
101 | AES-128-CFB1:2b7e151628aed2a6abf7158809cf4f3c:0008101820283038404850586068707b:00:00:1 | ||
102 | AES-128-CFB1:2b7e151628aed2a6abf7158809cf4f3c:00102030405060708090a0b0c0d0e0f6:80:80:1 | ||
103 | AES-128-CFB1:2b7e151628aed2a6abf7158809cf4f3c:0020406080a0c0e10121416181a1c1ed:00:00:1 | ||
104 | AES-128-CFB1:2b7e151628aed2a6abf7158809cf4f3c:004080c1014181c2024282c3034383da:80:00:1 | ||
105 | AES-128-CFB1:2b7e151628aed2a6abf7158809cf4f3c:008101820283038404850586068707b4:80:00:1 | ||
106 | AES-128-CFB1:2b7e151628aed2a6abf7158809cf4f3c:0102030405060708090a0b0c0d0e0f68:80:80:1 | ||
107 | AES-128-CFB1:2b7e151628aed2a6abf7158809cf4f3c:020406080a0c0e10121416181a1c1ed1:80:00:1 | ||
108 | AES-128-CFB1:2b7e151628aed2a6abf7158809cf4f3c:04080c1014181c2024282c3034383da2:00:80:1 | ||
109 | AES-128-CFB1:2b7e151628aed2a6abf7158809cf4f3c:08101820283038404850586068707b45:00:80:1 | ||
110 | AES-128-CFB1:2b7e151628aed2a6abf7158809cf4f3c:102030405060708090a0b0c0d0e0f68b:00:00:1 | ||
111 | AES-128-CFB1:2b7e151628aed2a6abf7158809cf4f3c:20406080a0c0e10121416181a1c1ed16:00:00:1 | ||
112 | AES-128-CFB1:2b7e151628aed2a6abf7158809cf4f3c:4080c1014181c2024282c3034383da2c:00:80:1 | ||
113 | AES-128-CFB1:2b7e151628aed2a6abf7158809cf4f3c:8101820283038404850586068707b459:80:80:1 | ||
114 | # all of the above packed into one... | ||
115 | # in: 0110 1011 1100 0001 = 6bc1 | ||
116 | # out: 0110 1000 1011 0011 = 68b3 | ||
117 | AES-128-CFB1*8:2b7e151628aed2a6abf7158809cf4f3c:000102030405060708090a0b0c0d0e0f:6bc1:68b3:1 | ||
118 | |||
119 | # CFB1-AES128.Decrypt | ||
120 | AES-128-CFB1:2b7e151628aed2a6abf7158809cf4f3c:000102030405060708090a0b0c0d0e0f:00:00:0 | ||
121 | AES-128-CFB1:2b7e151628aed2a6abf7158809cf4f3c:00020406080a0c0e10121416181a1c1e:80:80:0 | ||
122 | AES-128-CFB1:2b7e151628aed2a6abf7158809cf4f3c:0004080c1014181c2024282c3034383d:80:80:0 | ||
123 | AES-128-CFB1:2b7e151628aed2a6abf7158809cf4f3c:0008101820283038404850586068707b:00:00:0 | ||
124 | AES-128-CFB1:2b7e151628aed2a6abf7158809cf4f3c:00102030405060708090a0b0c0d0e0f6:80:80:0 | ||
125 | AES-128-CFB1:2b7e151628aed2a6abf7158809cf4f3c:0020406080a0c0e10121416181a1c1ed:00:00:0 | ||
126 | AES-128-CFB1:2b7e151628aed2a6abf7158809cf4f3c:004080c1014181c2024282c3034383da:80:00:0 | ||
127 | AES-128-CFB1:2b7e151628aed2a6abf7158809cf4f3c:008101820283038404850586068707b4:80:00:0 | ||
128 | AES-128-CFB1:2b7e151628aed2a6abf7158809cf4f3c:0102030405060708090a0b0c0d0e0f68:80:80:0 | ||
129 | AES-128-CFB1:2b7e151628aed2a6abf7158809cf4f3c:020406080a0c0e10121416181a1c1ed1:80:00:0 | ||
130 | AES-128-CFB1:2b7e151628aed2a6abf7158809cf4f3c:04080c1014181c2024282c3034383da2:00:80:0 | ||
131 | AES-128-CFB1:2b7e151628aed2a6abf7158809cf4f3c:08101820283038404850586068707b45:00:80:0 | ||
132 | AES-128-CFB1:2b7e151628aed2a6abf7158809cf4f3c:102030405060708090a0b0c0d0e0f68b:00:00:0 | ||
133 | AES-128-CFB1:2b7e151628aed2a6abf7158809cf4f3c:20406080a0c0e10121416181a1c1ed16:00:00:0 | ||
134 | AES-128-CFB1:2b7e151628aed2a6abf7158809cf4f3c:4080c1014181c2024282c3034383da2c:00:80:0 | ||
135 | AES-128-CFB1:2b7e151628aed2a6abf7158809cf4f3c:8101820283038404850586068707b459:80:80:0 | ||
136 | # all of the above packed into one... | ||
137 | # in: 0110 1000 1011 0011 = 68b3 | ||
138 | # out: 0110 1011 1100 0001 = 6bc1 | ||
139 | AES-128-CFB1*8:2b7e151628aed2a6abf7158809cf4f3c:000102030405060708090a0b0c0d0e0f:6bc1:68b3:0 | ||
140 | |||
141 | # TODO: CFB1-AES192 and 256 | ||
142 | |||
143 | # CFB8-AES128.Encrypt | ||
144 | |||
145 | AES-128-CFB8:2b7e151628aed2a6abf7158809cf4f3c:000102030405060708090a0b0c0d0e0f:6b:3b:1 | ||
146 | AES-128-CFB8:2b7e151628aed2a6abf7158809cf4f3c:0102030405060708090a0b0c0d0e0f3b:c1:79:1 | ||
147 | AES-128-CFB8:2b7e151628aed2a6abf7158809cf4f3c:02030405060708090a0b0c0d0e0f3b79:be:42:1 | ||
148 | AES-128-CFB8:2b7e151628aed2a6abf7158809cf4f3c:030405060708090a0b0c0d0e0f3b7942:e2:4c:1 | ||
149 | AES-128-CFB8:2b7e151628aed2a6abf7158809cf4f3c:0405060708090a0b0c0d0e0f3b79424c:2e:9c:1 | ||
150 | AES-128-CFB8:2b7e151628aed2a6abf7158809cf4f3c:05060708090a0b0c0d0e0f3b79424c9c:40:0d:1 | ||
151 | AES-128-CFB8:2b7e151628aed2a6abf7158809cf4f3c:060708090a0b0c0d0e0f3b79424c9c0d:9f:d4:1 | ||
152 | AES-128-CFB8:2b7e151628aed2a6abf7158809cf4f3c:0708090a0b0c0d0e0f3b79424c9c0dd4:96:36:1 | ||
153 | AES-128-CFB8:2b7e151628aed2a6abf7158809cf4f3c:08090a0b0c0d0e0f3b79424c9c0dd436:e9:ba:1 | ||
154 | AES-128-CFB8:2b7e151628aed2a6abf7158809cf4f3c:090a0b0c0d0e0f3b79424c9c0dd436ba:3d:ce:1 | ||
155 | AES-128-CFB8:2b7e151628aed2a6abf7158809cf4f3c:0a0b0c0d0e0f3b79424c9c0dd436bace:7e:9e:1 | ||
156 | AES-128-CFB8:2b7e151628aed2a6abf7158809cf4f3c:0b0c0d0e0f3b79424c9c0dd436bace9e:11:0e:1 | ||
157 | AES-128-CFB8:2b7e151628aed2a6abf7158809cf4f3c:0c0d0e0f3b79424c9c0dd436bace9e0e:73:d4:1 | ||
158 | AES-128-CFB8:2b7e151628aed2a6abf7158809cf4f3c:0d0e0f3b79424c9c0dd436bace9e0ed4:93:58:1 | ||
159 | AES-128-CFB8:2b7e151628aed2a6abf7158809cf4f3c:0e0f3b79424c9c0dd436bace9e0ed458:17:6a:1 | ||
160 | AES-128-CFB8:2b7e151628aed2a6abf7158809cf4f3c:0f3b79424c9c0dd436bace9e0ed4586a:2a:4f:1 | ||
161 | AES-128-CFB8:2b7e151628aed2a6abf7158809cf4f3c:3b79424c9c0dd436bace9e0ed4586a4f:ae:32:1 | ||
162 | AES-128-CFB8:2b7e151628aed2a6abf7158809cf4f3c:79424c9c0dd436bace9e0ed4586a4f32:2d:b9:1 | ||
163 | # all of the above packed into one | ||
164 | AES-128-CFB8:2b7e151628aed2a6abf7158809cf4f3c:000102030405060708090a0b0c0d0e0f:6bc1bee22e409f96e93d7e117393172aae2d:3b79424c9c0dd436bace9e0ed4586a4f32b9:1 | ||
165 | |||
166 | # CFB8-AES128.Decrypt | ||
167 | |||
168 | AES-128-CFB8:2b7e151628aed2a6abf7158809cf4f3c:000102030405060708090a0b0c0d0e0f:6b:3b:0 | ||
169 | AES-128-CFB8:2b7e151628aed2a6abf7158809cf4f3c:0102030405060708090a0b0c0d0e0f3b:c1:79:0 | ||
170 | AES-128-CFB8:2b7e151628aed2a6abf7158809cf4f3c:02030405060708090a0b0c0d0e0f3b79:be:42:0 | ||
171 | AES-128-CFB8:2b7e151628aed2a6abf7158809cf4f3c:030405060708090a0b0c0d0e0f3b7942:e2:4c:0 | ||
172 | AES-128-CFB8:2b7e151628aed2a6abf7158809cf4f3c:0405060708090a0b0c0d0e0f3b79424c:2e:9c:0 | ||
173 | AES-128-CFB8:2b7e151628aed2a6abf7158809cf4f3c:05060708090a0b0c0d0e0f3b79424c9c:40:0d:0 | ||
174 | AES-128-CFB8:2b7e151628aed2a6abf7158809cf4f3c:060708090a0b0c0d0e0f3b79424c9c0d:9f:d4:0 | ||
175 | AES-128-CFB8:2b7e151628aed2a6abf7158809cf4f3c:0708090a0b0c0d0e0f3b79424c9c0dd4:96:36:0 | ||
176 | AES-128-CFB8:2b7e151628aed2a6abf7158809cf4f3c:08090a0b0c0d0e0f3b79424c9c0dd436:e9:ba:0 | ||
177 | AES-128-CFB8:2b7e151628aed2a6abf7158809cf4f3c:090a0b0c0d0e0f3b79424c9c0dd436ba:3d:ce:0 | ||
178 | AES-128-CFB8:2b7e151628aed2a6abf7158809cf4f3c:0a0b0c0d0e0f3b79424c9c0dd436bace:7e:9e:0 | ||
179 | AES-128-CFB8:2b7e151628aed2a6abf7158809cf4f3c:0b0c0d0e0f3b79424c9c0dd436bace9e:11:0e:0 | ||
180 | AES-128-CFB8:2b7e151628aed2a6abf7158809cf4f3c:0c0d0e0f3b79424c9c0dd436bace9e0e:73:d4:0 | ||
181 | AES-128-CFB8:2b7e151628aed2a6abf7158809cf4f3c:0d0e0f3b79424c9c0dd436bace9e0ed4:93:58:0 | ||
182 | AES-128-CFB8:2b7e151628aed2a6abf7158809cf4f3c:0e0f3b79424c9c0dd436bace9e0ed458:17:6a:0 | ||
183 | AES-128-CFB8:2b7e151628aed2a6abf7158809cf4f3c:0f3b79424c9c0dd436bace9e0ed4586a:2a:4f:0 | ||
184 | AES-128-CFB8:2b7e151628aed2a6abf7158809cf4f3c:3b79424c9c0dd436bace9e0ed4586a4f:ae:32:0 | ||
185 | AES-128-CFB8:2b7e151628aed2a6abf7158809cf4f3c:79424c9c0dd436bace9e0ed4586a4f32:2d:b9:0 | ||
186 | # all of the above packed into one | ||
187 | AES-128-CFB8:2b7e151628aed2a6abf7158809cf4f3c:000102030405060708090a0b0c0d0e0f:6bc1bee22e409f96e93d7e117393172aae2d:3b79424c9c0dd436bace9e0ed4586a4f32b9:0 | ||
188 | |||
189 | # TODO: 192 and 256 bit keys | ||
190 | |||
191 | # For all CFB128 encrypts and decrypts, the transformed sequence is | ||
192 | # AES-bits-CFB:key:IV/ciphertext':plaintext:ciphertext:encdec | ||
193 | # CFB128-AES128.Encrypt | ||
194 | AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:3B3FD92EB72DAD20333449F8E83CFB4A:1 | ||
195 | AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:3B3FD92EB72DAD20333449F8E83CFB4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:C8A64537A0B3A93FCDE3CDAD9F1CE58B:1 | ||
196 | AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:C8A64537A0B3A93FCDE3CDAD9F1CE58B:30C81C46A35CE411E5FBC1191A0A52EF:26751F67A3CBB140B1808CF187A4F4DF:1 | ||
197 | AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:26751F67A3CBB140B1808CF187A4F4DF:F69F2445DF4F9B17AD2B417BE66C3710:C04B05357C5D1C0EEAC4C66F9FF7F2E6:1 | ||
198 | # CFB128-AES128.Decrypt | ||
199 | AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:3B3FD92EB72DAD20333449F8E83CFB4A:0 | ||
200 | AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:3B3FD92EB72DAD20333449F8E83CFB4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:C8A64537A0B3A93FCDE3CDAD9F1CE58B:0 | ||
201 | AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:C8A64537A0B3A93FCDE3CDAD9F1CE58B:30C81C46A35CE411E5FBC1191A0A52EF:26751F67A3CBB140B1808CF187A4F4DF:0 | ||
202 | AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:26751F67A3CBB140B1808CF187A4F4DF:F69F2445DF4F9B17AD2B417BE66C3710:C04B05357C5D1C0EEAC4C66F9FF7F2E6:0 | ||
203 | # CFB128-AES192.Encrypt | ||
204 | AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CDC80D6FDDF18CAB34C25909C99A4174:1 | ||
205 | AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:CDC80D6FDDF18CAB34C25909C99A4174:AE2D8A571E03AC9C9EB76FAC45AF8E51:67CE7F7F81173621961A2B70171D3D7A:1 | ||
206 | AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:67CE7F7F81173621961A2B70171D3D7A:30C81C46A35CE411E5FBC1191A0A52EF:2E1E8A1DD59B88B1C8E60FED1EFAC4C9:1 | ||
207 | AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:2E1E8A1DD59B88B1C8E60FED1EFAC4C9:F69F2445DF4F9B17AD2B417BE66C3710:C05F9F9CA9834FA042AE8FBA584B09FF:1 | ||
208 | # CFB128-AES192.Decrypt | ||
209 | AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CDC80D6FDDF18CAB34C25909C99A4174:0 | ||
210 | AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:CDC80D6FDDF18CAB34C25909C99A4174:AE2D8A571E03AC9C9EB76FAC45AF8E51:67CE7F7F81173621961A2B70171D3D7A:0 | ||
211 | AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:67CE7F7F81173621961A2B70171D3D7A:30C81C46A35CE411E5FBC1191A0A52EF:2E1E8A1DD59B88B1C8E60FED1EFAC4C9:0 | ||
212 | AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:2E1E8A1DD59B88B1C8E60FED1EFAC4C9:F69F2445DF4F9B17AD2B417BE66C3710:C05F9F9CA9834FA042AE8FBA584B09FF:0 | ||
213 | # CFB128-AES256.Encrypt | ||
214 | AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:DC7E84BFDA79164B7ECD8486985D3860:1 | ||
215 | AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:DC7E84BFDA79164B7ECD8486985D3860:AE2D8A571E03AC9C9EB76FAC45AF8E51:39FFED143B28B1C832113C6331E5407B:1 | ||
216 | AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:39FFED143B28B1C832113C6331E5407B:30C81C46A35CE411E5FBC1191A0A52EF:DF10132415E54B92A13ED0A8267AE2F9:1 | ||
217 | AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:DF10132415E54B92A13ED0A8267AE2F9:F69F2445DF4F9B17AD2B417BE66C3710:75A385741AB9CEF82031623D55B1E471:1 | ||
218 | # CFB128-AES256.Decrypt | ||
219 | AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:DC7E84BFDA79164B7ECD8486985D3860:0 | ||
220 | AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:DC7E84BFDA79164B7ECD8486985D3860:AE2D8A571E03AC9C9EB76FAC45AF8E51:39FFED143B28B1C832113C6331E5407B:0 | ||
221 | AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:39FFED143B28B1C832113C6331E5407B:30C81C46A35CE411E5FBC1191A0A52EF:DF10132415E54B92A13ED0A8267AE2F9:0 | ||
222 | AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:DF10132415E54B92A13ED0A8267AE2F9:F69F2445DF4F9B17AD2B417BE66C3710:75A385741AB9CEF82031623D55B1E471:0 | ||
223 | # For all OFB encrypts and decrypts, the transformed sequence is | ||
224 | # AES-bits-CFB:key:IV/output':plaintext:ciphertext:encdec | ||
225 | # OFB-AES128.Encrypt | ||
226 | AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:3B3FD92EB72DAD20333449F8E83CFB4A:1 | ||
227 | AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:50FE67CC996D32B6DA0937E99BAFEC60:AE2D8A571E03AC9C9EB76FAC45AF8E51:7789508D16918F03F53C52DAC54ED825:1 | ||
228 | AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:D9A4DADA0892239F6B8B3D7680E15674:30C81C46A35CE411E5FBC1191A0A52EF:9740051E9C5FECF64344F7A82260EDCC:1 | ||
229 | AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:A78819583F0308E7A6BF36B1386ABF23:F69F2445DF4F9B17AD2B417BE66C3710:304C6528F659C77866A510D9C1D6AE5E:1 | ||
230 | # OFB-AES128.Decrypt | ||
231 | AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:3B3FD92EB72DAD20333449F8E83CFB4A:0 | ||
232 | AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:50FE67CC996D32B6DA0937E99BAFEC60:AE2D8A571E03AC9C9EB76FAC45AF8E51:7789508D16918F03F53C52DAC54ED825:0 | ||
233 | AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:D9A4DADA0892239F6B8B3D7680E15674:30C81C46A35CE411E5FBC1191A0A52EF:9740051E9C5FECF64344F7A82260EDCC:0 | ||
234 | AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:A78819583F0308E7A6BF36B1386ABF23:F69F2445DF4F9B17AD2B417BE66C3710:304C6528F659C77866A510D9C1D6AE5E:0 | ||
235 | # OFB-AES192.Encrypt | ||
236 | AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CDC80D6FDDF18CAB34C25909C99A4174:1 | ||
237 | AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:A609B38DF3B1133DDDFF2718BA09565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:FCC28B8D4C63837C09E81700C1100401:1 | ||
238 | AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:52EF01DA52602FE0975F78AC84BF8A50:30C81C46A35CE411E5FBC1191A0A52EF:8D9A9AEAC0F6596F559C6D4DAF59A5F2:1 | ||
239 | AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:BD5286AC63AABD7EB067AC54B553F71D:F69F2445DF4F9B17AD2B417BE66C3710:6D9F200857CA6C3E9CAC524BD9ACC92A:1 | ||
240 | # OFB-AES192.Decrypt | ||
241 | AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CDC80D6FDDF18CAB34C25909C99A4174:0 | ||
242 | AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:A609B38DF3B1133DDDFF2718BA09565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:FCC28B8D4C63837C09E81700C1100401:0 | ||
243 | AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:52EF01DA52602FE0975F78AC84BF8A50:30C81C46A35CE411E5FBC1191A0A52EF:8D9A9AEAC0F6596F559C6D4DAF59A5F2:0 | ||
244 | AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:BD5286AC63AABD7EB067AC54B553F71D:F69F2445DF4F9B17AD2B417BE66C3710:6D9F200857CA6C3E9CAC524BD9ACC92A:0 | ||
245 | # OFB-AES256.Encrypt | ||
246 | AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:DC7E84BFDA79164B7ECD8486985D3860:1 | ||
247 | AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:B7BF3A5DF43989DD97F0FA97EBCE2F4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:4FEBDC6740D20B3AC88F6AD82A4FB08D:1 | ||
248 | AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E1C656305ED1A7A6563805746FE03EDC:30C81C46A35CE411E5FBC1191A0A52EF:71AB47A086E86EEDF39D1C5BBA97C408:1 | ||
249 | AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:41635BE625B48AFC1666DD42A09D96E7:F69F2445DF4F9B17AD2B417BE66C3710:0126141D67F37BE8538F5A8BE740E484:1 | ||
250 | # OFB-AES256.Decrypt | ||
251 | AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:DC7E84BFDA79164B7ECD8486985D3860:0 | ||
252 | AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:B7BF3A5DF43989DD97F0FA97EBCE2F4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:4FEBDC6740D20B3AC88F6AD82A4FB08D:0 | ||
253 | AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E1C656305ED1A7A6563805746FE03EDC:30C81C46A35CE411E5FBC1191A0A52EF:71AB47A086E86EEDF39D1C5BBA97C408:0 | ||
254 | AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:41635BE625B48AFC1666DD42A09D96E7:F69F2445DF4F9B17AD2B417BE66C3710:0126141D67F37BE8538F5A8BE740E484:0 | ||
255 | |||
256 | # DES ECB tests (from destest) | ||
257 | |||
258 | DES-ECB:0000000000000000::0000000000000000:8CA64DE9C1B123A7 | ||
259 | DES-ECB:FFFFFFFFFFFFFFFF::FFFFFFFFFFFFFFFF:7359B2163E4EDC58 | ||
260 | DES-ECB:3000000000000000::1000000000000001:958E6E627A05557B | ||
261 | DES-ECB:1111111111111111::1111111111111111:F40379AB9E0EC533 | ||
262 | DES-ECB:0123456789ABCDEF::1111111111111111:17668DFC7292532D | ||
263 | DES-ECB:1111111111111111::0123456789ABCDEF:8A5AE1F81AB8F2DD | ||
264 | DES-ECB:FEDCBA9876543210::0123456789ABCDEF:ED39D950FA74BCC4 | ||
265 | |||
266 | # DESX-CBC tests (from destest) | ||
267 | DESX-CBC:0123456789abcdeff1e0d3c2b5a49786fedcba9876543210:fedcba9876543210:37363534333231204E6F77206973207468652074696D6520666F722000000000:846B2914851E9A2954732F8AA0A611C115CDC2D7951B1053A63C5E03B21AA3C4 | ||
268 | |||
269 | # DES EDE3 CBC tests (from destest) | ||
270 | DES-EDE3-CBC:0123456789abcdeff1e0d3c2b5a49786fedcba9876543210:fedcba9876543210:37363534333231204E6F77206973207468652074696D6520666F722000000000:3FE301C962AC01D02213763C1CBD4CDC799657C064ECF5D41C673812CFDE9675 | ||
271 | |||
272 | # DES CFB1 from FIPS 81 | ||
273 | # plaintext: 0100 1110 0110 1111 0111 0111 = 4e6f77 | ||
274 | # ciphertext: 1100 1101 0001 1110 1100 1001 = cd1ec9 | ||
275 | |||
276 | DES-CFB1*8:0123456789abcdef:1234567890abcdef:4e6f77:cd1ec9 | ||
277 | |||
278 | # DES CFB8 from FIPS 81 | ||
279 | |||
280 | DES-CFB8:0123456789abcdef:1234567890abcdef:4e6f7720697320746865:f31fda07011462ee187f | ||
281 | |||
282 | # RC4 tests (from rc4test) | ||
283 | RC4:0123456789abcdef0123456789abcdef::0123456789abcdef:75b7878099e0c596 | ||
284 | RC4:0123456789abcdef0123456789abcdef::0000000000000000:7494c2e7104b0879 | ||
285 | RC4:00000000000000000000000000000000::0000000000000000:de188941a3375d3a | ||
286 | RC4:ef012345ef012345ef012345ef012345::0000000000000000000000000000000000000000:d6a141a7ec3c38dfbd615a1162e1c7ba36b67858 | ||
287 | RC4:0123456789abcdef0123456789abcdef::123456789ABCDEF0123456789ABCDEF0123456789ABCDEF012345678:66a0949f8af7d6891f7f832ba833c00c892ebe30143ce28740011ecf | ||
288 | RC4:ef012345ef012345ef012345ef012345::00000000000000000000:d6a141a7ec3c38dfbd61 | ||
diff --git a/src/lib/libssl/test/maketests.com b/src/lib/libssl/test/maketests.com new file mode 100644 index 0000000000..dfbfef7b1b --- /dev/null +++ b/src/lib/libssl/test/maketests.com | |||
@@ -0,0 +1,913 @@ | |||
1 | $! | ||
2 | $! MAKETESTS.COM | ||
3 | $! Written By: Robert Byer | ||
4 | $! Vice-President | ||
5 | $! A-Com Computing, Inc. | ||
6 | $! byer@mail.all-net.net | ||
7 | $! | ||
8 | $! Changes by Richard Levitte <richard@levitte.org> | ||
9 | $! | ||
10 | $! This command files compiles and creates all the various different | ||
11 | $! "test" programs for the different types of encryption for OpenSSL. | ||
12 | $! It was written so it would try to determine what "C" compiler to | ||
13 | $! use or you can specify which "C" compiler to use. | ||
14 | $! | ||
15 | $! The test "executeables" will be placed in a directory called | ||
16 | $! [.xxx.EXE.TEST] where "xxx" denotes AXP or VAX depending on your machines | ||
17 | $! architecture. | ||
18 | $! | ||
19 | $! Specify DEBUG or NODEBUG P1 to compile with or without debugger | ||
20 | $! information. | ||
21 | $! | ||
22 | $! Specify which compiler at P2 to try to compile under. | ||
23 | $! | ||
24 | $! VAXC For VAX C. | ||
25 | $! DECC For DEC C. | ||
26 | $! GNUC For GNU C. | ||
27 | $! | ||
28 | $! If you don't speficy a compiler, it will try to determine which | ||
29 | $! "C" compiler to use. | ||
30 | $! | ||
31 | $! P3, if defined, sets a TCP/IP library to use, through one of the following | ||
32 | $! keywords: | ||
33 | $! | ||
34 | $! UCX for UCX | ||
35 | $! SOCKETSHR for SOCKETSHR+NETLIB | ||
36 | $! | ||
37 | $! P4, if defined, sets a compiler thread NOT needed on OpenVMS 7.1 (and up) | ||
38 | $! | ||
39 | $! | ||
40 | $! Define A TCP/IP Library That We Will Need To Link To. | ||
41 | $! (That is, If Wee Need To Link To One.) | ||
42 | $! | ||
43 | $ TCPIP_LIB = "" | ||
44 | $! | ||
45 | $! Check Which Architecture We Are Using. | ||
46 | $! | ||
47 | $ IF (F$GETSYI("CPU").GE.128) | ||
48 | $ THEN | ||
49 | $! | ||
50 | $! The Architecture Is AXP. | ||
51 | $! | ||
52 | $ ARCH := AXP | ||
53 | $! | ||
54 | $! Else... | ||
55 | $! | ||
56 | $ ELSE | ||
57 | $! | ||
58 | $! The Architecture Is VAX. | ||
59 | $! | ||
60 | $ ARCH := VAX | ||
61 | $! | ||
62 | $! End The Architecture Check. | ||
63 | $! | ||
64 | $ ENDIF | ||
65 | $! | ||
66 | $! Check To Make Sure We Have Valid Command Line Parameters. | ||
67 | $! | ||
68 | $ GOSUB CHECK_OPTIONS | ||
69 | $! | ||
70 | $! Initialise logical names and such | ||
71 | $! | ||
72 | $ GOSUB INITIALISE | ||
73 | $! | ||
74 | $! Tell The User What Kind of Machine We Run On. | ||
75 | $! | ||
76 | $ WRITE SYS$OUTPUT "Compiling On A ",ARCH," Machine." | ||
77 | $! | ||
78 | $! Define The CRYPTO-LIB We Are To Use. | ||
79 | $! | ||
80 | $ CRYPTO_LIB := SYS$DISK:[-.'ARCH'.EXE.CRYPTO]LIBCRYPTO.OLB | ||
81 | $! | ||
82 | $! Define The SSL We Are To Use. | ||
83 | $! | ||
84 | $ SSL_LIB := SYS$DISK:[-.'ARCH'.EXE.SSL]LIBSSL.OLB | ||
85 | $! | ||
86 | $! Define The OBJ Directory. | ||
87 | $! | ||
88 | $ OBJ_DIR := SYS$DISK:[-.'ARCH'.OBJ.TEST] | ||
89 | $! | ||
90 | $! Check To See If The Architecture Specific OBJ Directory Exists. | ||
91 | $! | ||
92 | $ IF (F$PARSE(OBJ_DIR).EQS."") | ||
93 | $ THEN | ||
94 | $! | ||
95 | $! The EXE Directory Dosen't Exist, So Create It. | ||
96 | $! | ||
97 | $ CREATE/DIRECTORY 'OBJ_DIR' | ||
98 | $! | ||
99 | $! End The Architecture Specific OBJ Directory Check. | ||
100 | $! | ||
101 | $ ENDIF | ||
102 | $! | ||
103 | $! Define The EXE Directory. | ||
104 | $! | ||
105 | $ EXE_DIR := SYS$DISK:[-.'ARCH'.EXE.TEST] | ||
106 | $! | ||
107 | $! Check To See If The Architecture Specific EXE Directory Exists. | ||
108 | $! | ||
109 | $ IF (F$PARSE(EXE_DIR).EQS."") | ||
110 | $ THEN | ||
111 | $! | ||
112 | $! The EXE Directory Dosen't Exist, So Create It. | ||
113 | $! | ||
114 | $ CREATE/DIRECTORY 'EXE_DIR' | ||
115 | $! | ||
116 | $! End The Architecture Specific EXE Directory Check. | ||
117 | $! | ||
118 | $ ENDIF | ||
119 | $! | ||
120 | $! Check To See If We Have The Proper Libraries. | ||
121 | $! | ||
122 | $ GOSUB LIB_CHECK | ||
123 | $! | ||
124 | $! Check To See If We Have A Linker Option File. | ||
125 | $! | ||
126 | $ GOSUB CHECK_OPT_FILE | ||
127 | $! | ||
128 | $! Define The TEST Files. | ||
129 | $! | ||
130 | $ TEST_FILES = "BNTEST,ECTEST,IDEATEST,MD2TEST,MD4TEST,MD5TEST,HMACTEST,"+ - | ||
131 | "RC2TEST,RC4TEST,RC5TEST,"+ - | ||
132 | "DESTEST,SHATEST,SHA1TEST,MDC2TEST,RMDTEST,"+ - | ||
133 | "RANDTEST,DHTEST,ENGINETEST,"+ - | ||
134 | "BFTEST,CASTTEST,SSLTEST,EXPTEST,DSATEST,RSA_TEST,"+ - | ||
135 | "EVP_TEST" | ||
136 | $ TCPIP_PROGRAMS = ",," | ||
137 | $ IF COMPILER .EQS. "VAXC" THEN - | ||
138 | TCPIP_PROGRAMS = ",SSLTEST," | ||
139 | $! | ||
140 | $! Define A File Counter And Set It To "0". | ||
141 | $! | ||
142 | $ FILE_COUNTER = 0 | ||
143 | $! | ||
144 | $! Top Of The File Loop. | ||
145 | $! | ||
146 | $ NEXT_FILE: | ||
147 | $! | ||
148 | $! O.K, Extract The File Name From The File List. | ||
149 | $! | ||
150 | $ FILE_NAME = F$ELEMENT(FILE_COUNTER,",",TEST_FILES) | ||
151 | $! | ||
152 | $! Check To See If We Are At The End Of The File List. | ||
153 | $! | ||
154 | $ IF (FILE_NAME.EQS.",") THEN GOTO FILE_DONE | ||
155 | $! | ||
156 | $! Increment The Counter. | ||
157 | $! | ||
158 | $ FILE_COUNTER = FILE_COUNTER + 1 | ||
159 | $! | ||
160 | $! Create The Source File Name. | ||
161 | $! | ||
162 | $ SOURCE_FILE = "SYS$DISK:[]" + FILE_NAME + ".C" | ||
163 | $! | ||
164 | $! Create The Object File Name. | ||
165 | $! | ||
166 | $ OBJECT_FILE = OBJ_DIR + FILE_NAME + ".OBJ" | ||
167 | $! | ||
168 | $! Create The Executable File Name. | ||
169 | $! | ||
170 | $ EXE_FILE = EXE_DIR + FILE_NAME + ".EXE" | ||
171 | $ ON WARNING THEN GOTO NEXT_FILE | ||
172 | $! | ||
173 | $! Check To See If The File We Want To Compile Actually Exists. | ||
174 | $! | ||
175 | $ IF (F$SEARCH(SOURCE_FILE).EQS."") | ||
176 | $ THEN | ||
177 | $! | ||
178 | $! Tell The User That The File Dosen't Exist. | ||
179 | $! | ||
180 | $ WRITE SYS$OUTPUT "" | ||
181 | $ WRITE SYS$OUTPUT "The File ",SOURCE_FILE," Dosen't Exist." | ||
182 | $ WRITE SYS$OUTPUT "" | ||
183 | $! | ||
184 | $! Exit The Build. | ||
185 | $! | ||
186 | $ GOTO EXIT | ||
187 | $ ENDIF | ||
188 | $! | ||
189 | $! Tell The User What We Are Building. | ||
190 | $! | ||
191 | $ WRITE SYS$OUTPUT "Building The ",FILE_NAME," Test Program." | ||
192 | $! | ||
193 | $! Compile The File. | ||
194 | $! | ||
195 | $ ON ERROR THEN GOTO NEXT_FILE | ||
196 | $ CC/OBJECT='OBJECT_FILE' 'SOURCE_FILE' | ||
197 | $ ON WARNING THEN GOTO NEXT_FILE | ||
198 | $! | ||
199 | $! Check If What We Are About To Compile Works Without A TCP/IP Library. | ||
200 | $! | ||
201 | $ IF ((TCPIP_LIB.EQS."").AND.((TCPIP_PROGRAMS-FILE_NAME).NES.TCPIP_PROGRAMS)) | ||
202 | $ THEN | ||
203 | $! | ||
204 | $! Inform The User That A TCP/IP Library Is Needed To Compile This Program. | ||
205 | $! | ||
206 | $ WRITE SYS$OUTPUT FILE_NAME," Needs A TCP/IP Library. Can't Link. Skipping..." | ||
207 | $ GOTO NEXT_FILE | ||
208 | $! | ||
209 | $! End The TCP/IP Library Check. | ||
210 | $! | ||
211 | $ ENDIF | ||
212 | $! | ||
213 | $! Link The Program, Check To See If We Need To Link With RSAREF Or Not. | ||
214 | $! Check To See If We Are To Link With A Specific TCP/IP Library. | ||
215 | $! | ||
216 | $ IF (TCPIP_LIB.NES."") | ||
217 | $ THEN | ||
218 | $! | ||
219 | $! Don't Link With The RSAREF Routines And TCP/IP Library. | ||
220 | $! | ||
221 | $ LINK/'DEBUGGER'/'TRACEBACK' /EXE='EXE_FILE' - | ||
222 | 'OBJECT_FILE', - | ||
223 | 'SSL_LIB'/LIBRARY,'CRYPTO_LIB'/LIBRARY, - | ||
224 | 'TCPIP_LIB','OPT_FILE'/OPTION | ||
225 | $! | ||
226 | $! Else... | ||
227 | $! | ||
228 | $ ELSE | ||
229 | $! | ||
230 | $! Don't Link With The RSAREF Routines And Link With A TCP/IP Library. | ||
231 | $! | ||
232 | $ LINK/'DEBUGGER'/'TRACEBACK' /EXE='EXE_FILE' - | ||
233 | 'OBJECT_FILE', - | ||
234 | 'SSL_LIB'/LIBRARY,'CRYPTO_LIB'/LIBRARY, - | ||
235 | 'OPT_FILE'/OPTION | ||
236 | $! | ||
237 | $! End The TCP/IP Library Check. | ||
238 | $! | ||
239 | $ ENDIF | ||
240 | $! | ||
241 | $! Go Back And Do It Again. | ||
242 | $! | ||
243 | $ GOTO NEXT_FILE | ||
244 | $! | ||
245 | $! All Done With This Library Part. | ||
246 | $! | ||
247 | $ FILE_DONE: | ||
248 | $! | ||
249 | $! All Done, Time To Exit. | ||
250 | $! | ||
251 | $ EXIT: | ||
252 | $ GOSUB CLEANUP | ||
253 | $ EXIT | ||
254 | $! | ||
255 | $! Check For The Link Option FIle. | ||
256 | $! | ||
257 | $ CHECK_OPT_FILE: | ||
258 | $! | ||
259 | $! Check To See If We Need To Make A VAX C Option File. | ||
260 | $! | ||
261 | $ IF (COMPILER.EQS."VAXC") | ||
262 | $ THEN | ||
263 | $! | ||
264 | $! Check To See If We Already Have A VAX C Linker Option File. | ||
265 | $! | ||
266 | $ IF (F$SEARCH(OPT_FILE).EQS."") | ||
267 | $ THEN | ||
268 | $! | ||
269 | $! We Need A VAX C Linker Option File. | ||
270 | $! | ||
271 | $ CREATE 'OPT_FILE' | ||
272 | $DECK | ||
273 | ! | ||
274 | ! Default System Options File To Link Agianst | ||
275 | ! The Sharable VAX C Runtime Library. | ||
276 | ! | ||
277 | SYS$SHARE:VAXCRTL.EXE/SHARE | ||
278 | $EOD | ||
279 | $! | ||
280 | $! End The Option File Check. | ||
281 | $! | ||
282 | $ ENDIF | ||
283 | $! | ||
284 | $! End The VAXC Check. | ||
285 | $! | ||
286 | $ ENDIF | ||
287 | $! | ||
288 | $! Check To See If We Need A GNU C Option File. | ||
289 | $! | ||
290 | $ IF (COMPILER.EQS."GNUC") | ||
291 | $ THEN | ||
292 | $! | ||
293 | $! Check To See If We Already Have A GNU C Linker Option File. | ||
294 | $! | ||
295 | $ IF (F$SEARCH(OPT_FILE).EQS."") | ||
296 | $ THEN | ||
297 | $! | ||
298 | $! We Need A GNU C Linker Option File. | ||
299 | $! | ||
300 | $ CREATE 'OPT_FILE' | ||
301 | $DECK | ||
302 | ! | ||
303 | ! Default System Options File To Link Agianst | ||
304 | ! The Sharable C Runtime Library. | ||
305 | ! | ||
306 | GNU_CC:[000000]GCCLIB/LIBRARY | ||
307 | SYS$SHARE:VAXCRTL/SHARE | ||
308 | $EOD | ||
309 | $! | ||
310 | $! End The Option File Check. | ||
311 | $! | ||
312 | $ ENDIF | ||
313 | $! | ||
314 | $! End The GNU C Check. | ||
315 | $! | ||
316 | $ ENDIF | ||
317 | $! | ||
318 | $! Check To See If We Need A DEC C Option File. | ||
319 | $! | ||
320 | $ IF (COMPILER.EQS."DECC") | ||
321 | $ THEN | ||
322 | $! | ||
323 | $! Check To See If We Already Have A DEC C Linker Option File. | ||
324 | $! | ||
325 | $ IF (F$SEARCH(OPT_FILE).EQS."") | ||
326 | $ THEN | ||
327 | $! | ||
328 | $! Figure Out If We Need An AXP Or A VAX Linker Option File. | ||
329 | $! | ||
330 | $ IF (ARCH.EQS."VAX") | ||
331 | $ THEN | ||
332 | $! | ||
333 | $! We Need A DEC C Linker Option File For VAX. | ||
334 | $! | ||
335 | $ CREATE 'OPT_FILE' | ||
336 | $DECK | ||
337 | ! | ||
338 | ! Default System Options File To Link Agianst | ||
339 | ! The Sharable DEC C Runtime Library. | ||
340 | ! | ||
341 | SYS$SHARE:DECC$SHR.EXE/SHARE | ||
342 | $EOD | ||
343 | $! | ||
344 | $! Else... | ||
345 | $! | ||
346 | $ ELSE | ||
347 | $! | ||
348 | $! Create The AXP Linker Option File. | ||
349 | $! | ||
350 | $ CREATE 'OPT_FILE' | ||
351 | $DECK | ||
352 | ! | ||
353 | ! Default System Options File For AXP To Link Agianst | ||
354 | ! The Sharable C Runtime Library. | ||
355 | ! | ||
356 | SYS$SHARE:CMA$OPEN_LIB_SHR/SHARE | ||
357 | SYS$SHARE:CMA$OPEN_RTL/SHARE | ||
358 | $EOD | ||
359 | $! | ||
360 | $! End The VAX/AXP DEC C Option File Check. | ||
361 | $! | ||
362 | $ ENDIF | ||
363 | $! | ||
364 | $! End The Option File Search. | ||
365 | $! | ||
366 | $ ENDIF | ||
367 | $! | ||
368 | $! End The DEC C Check. | ||
369 | $! | ||
370 | $ ENDIF | ||
371 | $! | ||
372 | $! Tell The User What Linker Option File We Are Using. | ||
373 | $! | ||
374 | $ WRITE SYS$OUTPUT "Using Linker Option File ",OPT_FILE,"." | ||
375 | $! | ||
376 | $! Time To RETURN. | ||
377 | $! | ||
378 | $ RETURN | ||
379 | $! | ||
380 | $! Check To See If We Have The Appropiate Libraries. | ||
381 | $! | ||
382 | $ LIB_CHECK: | ||
383 | $! | ||
384 | $! Look For The Library LIBCRYPTO.OLB. | ||
385 | $! | ||
386 | $ IF (F$SEARCH(CRYPTO_LIB).EQS."") | ||
387 | $ THEN | ||
388 | $! | ||
389 | $! Tell The User We Can't Find The LIBCRYPTO.OLB Library. | ||
390 | $! | ||
391 | $ WRITE SYS$OUTPUT "" | ||
392 | $ WRITE SYS$OUTPUT "Can't Find The Library ",CRYPTO_LIB,"." | ||
393 | $ WRITE SYS$OUTPUT "We Can't Link Without It." | ||
394 | $ WRITE SYS$OUTPUT "" | ||
395 | $! | ||
396 | $! Since We Can't Link Without It, Exit. | ||
397 | $! | ||
398 | $ EXIT | ||
399 | $! | ||
400 | $! End The Crypto Library Check. | ||
401 | $! | ||
402 | $ ENDIF | ||
403 | $! | ||
404 | $! Look For The Library LIBSSL.OLB. | ||
405 | $! | ||
406 | $ IF (F$SEARCH(SSL_LIB).EQS."") | ||
407 | $ THEN | ||
408 | $! | ||
409 | $! Tell The User We Can't Find The LIBSSL.OLB Library. | ||
410 | $! | ||
411 | $ WRITE SYS$OUTPUT "" | ||
412 | $ WRITE SYS$OUTPUT "Can't Find The Library ",SSL_LIB,"." | ||
413 | $ WRITE SYS$OUTPUT "Some Of The Test Programs Need To Link To It." | ||
414 | $ WRITE SYS$OUTPUT "" | ||
415 | $! | ||
416 | $! Since We Can't Link Without It, Exit. | ||
417 | $! | ||
418 | $ EXIT | ||
419 | $! | ||
420 | $! End The SSL Library Check. | ||
421 | $! | ||
422 | $ ENDIF | ||
423 | $! | ||
424 | $! Time To Return. | ||
425 | $! | ||
426 | $ RETURN | ||
427 | $! | ||
428 | $! Check The User's Options. | ||
429 | $! | ||
430 | $ CHECK_OPTIONS: | ||
431 | $! | ||
432 | $! Check To See If P1 Is Blank. | ||
433 | $! | ||
434 | $ IF (P1.EQS."NODEBUG") | ||
435 | $ THEN | ||
436 | $! | ||
437 | $! P1 Is NODEBUG, So Compile Without Debugger Information. | ||
438 | $! | ||
439 | $ DEBUGGER = "NODEBUG" | ||
440 | $ TRACEBACK = "NOTRACEBACK" | ||
441 | $ GCC_OPTIMIZE = "OPTIMIZE" | ||
442 | $ CC_OPTIMIZE = "OPTIMIZE" | ||
443 | $ WRITE SYS$OUTPUT "No Debugger Information Will Be Produced During Compile." | ||
444 | $ WRITE SYS$OUTPUT "Compiling With Compiler Optimization." | ||
445 | $! | ||
446 | $! Else... | ||
447 | $! | ||
448 | $ ELSE | ||
449 | $! | ||
450 | $! Check To See If We Are To Compile With Debugger Information. | ||
451 | $! | ||
452 | $ IF (P1.EQS."DEBUG") | ||
453 | $ THEN | ||
454 | $! | ||
455 | $! Compile With Debugger Information. | ||
456 | $! | ||
457 | $ DEBUGGER = "DEBUG" | ||
458 | $ TRACEBACK = "TRACEBACK" | ||
459 | $ GCC_OPTIMIZE = "NOOPTIMIZE" | ||
460 | $ CC_OPTIMIZE = "NOOPTIMIZE" | ||
461 | $ WRITE SYS$OUTPUT "Debugger Information Will Be Produced During Compile." | ||
462 | $ WRITE SYS$OUTPUT "Compiling Without Compiler Optimization." | ||
463 | $! | ||
464 | $! Else... | ||
465 | $! | ||
466 | $ ELSE | ||
467 | $! | ||
468 | $! Tell The User Entered An Invalid Option.. | ||
469 | $! | ||
470 | $ WRITE SYS$OUTPUT "" | ||
471 | $ WRITE SYS$OUTPUT "The Option ",P1," Is Invalid. The Valid Options Are:" | ||
472 | $ WRITE SYS$OUTPUT "" | ||
473 | $ WRITE SYS$OUTPUT " DEBUG : Compile With The Debugger Information." | ||
474 | $ WRITE SYS$OUTPUT " NODEBUG : Compile Without The Debugger Information." | ||
475 | $ WRITE SYS$OUTPUT "" | ||
476 | $! | ||
477 | $! Time To EXIT. | ||
478 | $! | ||
479 | $ EXIT | ||
480 | $! | ||
481 | $! End The Valid Arguement Check. | ||
482 | $! | ||
483 | $ ENDIF | ||
484 | $! | ||
485 | $! End The P2 Check. | ||
486 | $! | ||
487 | $ ENDIF | ||
488 | $! | ||
489 | $! Check To See If P2 Is Blank. | ||
490 | $! | ||
491 | $ IF (P2.EQS."") | ||
492 | $ THEN | ||
493 | $! | ||
494 | $! O.K., The User Didn't Specify A Compiler, Let's Try To | ||
495 | $! Find Out Which One To Use. | ||
496 | $! | ||
497 | $! Check To See If We Have GNU C. | ||
498 | $! | ||
499 | $ IF (F$TRNLNM("GNU_CC").NES."") | ||
500 | $ THEN | ||
501 | $! | ||
502 | $! Looks Like GNUC, Set To Use GNUC. | ||
503 | $! | ||
504 | $ P2 = "GNUC" | ||
505 | $! | ||
506 | $! End The GNU C Compiler Check. | ||
507 | $! | ||
508 | $ ELSE | ||
509 | $! | ||
510 | $! Check To See If We Have VAXC Or DECC. | ||
511 | $! | ||
512 | $ IF (ARCH.EQS."AXP").OR.(F$TRNLNM("DECC$CC_DEFAULT").NES."") | ||
513 | $ THEN | ||
514 | $! | ||
515 | $! Looks Like DECC, Set To Use DECC. | ||
516 | $! | ||
517 | $ P2 = "DECC" | ||
518 | $! | ||
519 | $! Else... | ||
520 | $! | ||
521 | $ ELSE | ||
522 | $! | ||
523 | $! Looks Like VAXC, Set To Use VAXC. | ||
524 | $! | ||
525 | $ P2 = "VAXC" | ||
526 | $! | ||
527 | $! End The VAXC Compiler Check. | ||
528 | $! | ||
529 | $ ENDIF | ||
530 | $! | ||
531 | $! End The DECC & VAXC Compiler Check. | ||
532 | $! | ||
533 | $ ENDIF | ||
534 | $! | ||
535 | $! End The Compiler Check. | ||
536 | $! | ||
537 | $ ENDIF | ||
538 | $! | ||
539 | $! Check To See If We Have A Option For P3. | ||
540 | $! | ||
541 | $ IF (P3.EQS."") | ||
542 | $ THEN | ||
543 | $! | ||
544 | $! Find out what socket library we have available | ||
545 | $! | ||
546 | $ IF F$PARSE("SOCKETSHR:") .NES. "" | ||
547 | $ THEN | ||
548 | $! | ||
549 | $! We have SOCKETSHR, and it is my opinion that it's the best to use. | ||
550 | $! | ||
551 | $ P3 = "SOCKETSHR" | ||
552 | $! | ||
553 | $! Tell the user | ||
554 | $! | ||
555 | $ WRITE SYS$OUTPUT "Using SOCKETSHR for TCP/IP" | ||
556 | $! | ||
557 | $! Else, let's look for something else | ||
558 | $! | ||
559 | $ ELSE | ||
560 | $! | ||
561 | $! Like UCX (the reason to do this before Multinet is that the UCX | ||
562 | $! emulation is easier to use...) | ||
563 | $! | ||
564 | $ IF F$TRNLNM("UCX$IPC_SHR") .NES. "" - | ||
565 | .OR. F$PARSE("SYS$SHARE:UCX$IPC_SHR.EXE") .NES. "" - | ||
566 | .OR. F$PARSE("SYS$LIBRARY:UCX$IPC.OLB") .NES. "" | ||
567 | $ THEN | ||
568 | $! | ||
569 | $! Last resort: a UCX or UCX-compatible library | ||
570 | $! | ||
571 | $ P3 = "UCX" | ||
572 | $! | ||
573 | $! Tell the user | ||
574 | $! | ||
575 | $ WRITE SYS$OUTPUT "Using UCX or an emulation thereof for TCP/IP" | ||
576 | $! | ||
577 | $! That was all... | ||
578 | $! | ||
579 | $ ENDIF | ||
580 | $ ENDIF | ||
581 | $ ENDIF | ||
582 | $! | ||
583 | $! Set Up Initial CC Definitions, Possibly With User Ones | ||
584 | $! | ||
585 | $ CCDEFS = "TCPIP_TYPE_''P3'" | ||
586 | $ IF F$TYPE(USER_CCDEFS) .NES. "" THEN CCDEFS = CCDEFS + "," + USER_CCDEFS | ||
587 | $ CCEXTRAFLAGS = "" | ||
588 | $ IF F$TYPE(USER_CCFLAGS) .NES. "" THEN CCEXTRAFLAGS = USER_CCFLAGS | ||
589 | $ CCDISABLEWARNINGS = "LONGLONGTYPE,LONGLONGSUFX" | ||
590 | $ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. "" THEN - | ||
591 | CCDISABLEWARNINGS = CCDISABLEWARNINGS + "," + USER_CCDISABLEWARNINGS | ||
592 | $! | ||
593 | $! Check To See If The User Entered A Valid Paramter. | ||
594 | $! | ||
595 | $ IF (P2.EQS."VAXC").OR.(P2.EQS."DECC").OR.(P2.EQS."GNUC") | ||
596 | $ THEN | ||
597 | $! | ||
598 | $! Check To See If The User Wanted DECC. | ||
599 | $! | ||
600 | $ IF (P2.EQS."DECC") | ||
601 | $ THEN | ||
602 | $! | ||
603 | $! Looks Like DECC, Set To Use DECC. | ||
604 | $! | ||
605 | $ COMPILER = "DECC" | ||
606 | $! | ||
607 | $! Tell The User We Are Using DECC. | ||
608 | $! | ||
609 | $ WRITE SYS$OUTPUT "Using DECC 'C' Compiler." | ||
610 | $! | ||
611 | $! Use DECC... | ||
612 | $! | ||
613 | $ CC = "CC" | ||
614 | $ IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" - | ||
615 | THEN CC = "CC/DECC" | ||
616 | $ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/STANDARD=ANSI89" + - | ||
617 | "/NOLIST/PREFIX=ALL" + - | ||
618 | "/INCLUDE=(SYS$DISK:[-],SYS$DISK:[-.CRYPTO])" + CCEXTRAFLAGS | ||
619 | $! | ||
620 | $! Define The Linker Options File Name. | ||
621 | $! | ||
622 | $ OPT_FILE = "SYS$DISK:[]VAX_DECC_OPTIONS.OPT" | ||
623 | $! | ||
624 | $! End DECC Check. | ||
625 | $! | ||
626 | $ ENDIF | ||
627 | $! | ||
628 | $! Check To See If We Are To Use VAXC. | ||
629 | $! | ||
630 | $ IF (P2.EQS."VAXC") | ||
631 | $ THEN | ||
632 | $! | ||
633 | $! Looks Like VAXC, Set To Use VAXC. | ||
634 | $! | ||
635 | $ COMPILER = "VAXC" | ||
636 | $! | ||
637 | $! Tell The User We Are Using VAX C. | ||
638 | $! | ||
639 | $ WRITE SYS$OUTPUT "Using VAXC 'C' Compiler." | ||
640 | $! | ||
641 | $! Compile Using VAXC. | ||
642 | $! | ||
643 | $ CC = "CC" | ||
644 | $ IF ARCH.EQS."AXP" | ||
645 | $ THEN | ||
646 | $ WRITE SYS$OUTPUT "There is no VAX C on Alpha!" | ||
647 | $ EXIT | ||
648 | $ ENDIF | ||
649 | $ IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC" | ||
650 | $ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST" + - | ||
651 | "/INCLUDE=(SYS$DISK:[-],SYS$DISK:[-.CRYPTO])" + CCEXTRAFLAGS | ||
652 | $ CCDEFS = CCDEFS + ",""VAXC""" | ||
653 | $! | ||
654 | $! Define <sys> As SYS$COMMON:[SYSLIB] | ||
655 | $! | ||
656 | $ DEFINE/NOLOG SYS SYS$COMMON:[SYSLIB] | ||
657 | $! | ||
658 | $! Define The Linker Options File Name. | ||
659 | $! | ||
660 | $ OPT_FILE = "SYS$DISK:[]VAX_VAXC_OPTIONS.OPT" | ||
661 | $! | ||
662 | $! End VAXC Check | ||
663 | $! | ||
664 | $ ENDIF | ||
665 | $! | ||
666 | $! Check To See If We Are To Use GNU C. | ||
667 | $! | ||
668 | $ IF (P2.EQS."GNUC") | ||
669 | $ THEN | ||
670 | $! | ||
671 | $! Looks Like GNUC, Set To Use GNUC. | ||
672 | $! | ||
673 | $ COMPILER = "GNUC" | ||
674 | $! | ||
675 | $! Tell The User We Are Using GNUC. | ||
676 | $! | ||
677 | $ WRITE SYS$OUTPUT "Using GNU 'C' Compiler." | ||
678 | $! | ||
679 | $! Use GNU C... | ||
680 | $! | ||
681 | $ CC = "GCC/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + - | ||
682 | "/INCLUDE=(SYS$DISK:[-],SYS$DISK:[-.CRYPTO])" + CCEXTRAFLAGS | ||
683 | $! | ||
684 | $! Define The Linker Options File Name. | ||
685 | $! | ||
686 | $ OPT_FILE = "SYS$DISK:[]VAX_GNUC_OPTIONS.OPT" | ||
687 | $! | ||
688 | $! End The GNU C Check. | ||
689 | $! | ||
690 | $ ENDIF | ||
691 | $! | ||
692 | $! Set up default defines | ||
693 | $! | ||
694 | $ CCDEFS = """FLAT_INC=1""," + CCDEFS | ||
695 | $! | ||
696 | $! Finish up the definition of CC. | ||
697 | $! | ||
698 | $ IF COMPILER .EQS. "DECC" | ||
699 | $ THEN | ||
700 | $ IF CCDISABLEWARNINGS .EQS. "" | ||
701 | $ THEN | ||
702 | $ CC4DISABLEWARNINGS = "DOLLARID" | ||
703 | $ ELSE | ||
704 | $ CC4DISABLEWARNINGS = CCDISABLEWARNINGS + ",DOLLARID" | ||
705 | $ CCDISABLEWARNINGS = "/WARNING=(DISABLE=(" + CCDISABLEWARNINGS + "))" | ||
706 | $ ENDIF | ||
707 | $ CC4DISABLEWARNINGS = "/WARNING=(DISABLE=(" + CC4DISABLEWARNINGS + "))" | ||
708 | $ ELSE | ||
709 | $ CCDISABLEWARNINGS = "" | ||
710 | $ CC4DISABLEWARNINGS = "" | ||
711 | $ ENDIF | ||
712 | $ CC = CC + "/DEFINE=(" + CCDEFS + ")" + CCDISABLEWARNINGS | ||
713 | $! | ||
714 | $! Show user the result | ||
715 | $! | ||
716 | $ WRITE/SYMBOL SYS$OUTPUT "Main Compiling Command: ",CC | ||
717 | $! | ||
718 | $! Else The User Entered An Invalid Arguement. | ||
719 | $! | ||
720 | $ ELSE | ||
721 | $! | ||
722 | $! Tell The User We Don't Know What They Want. | ||
723 | $! | ||
724 | $ WRITE SYS$OUTPUT "" | ||
725 | $ WRITE SYS$OUTPUT "The Option ",P2," Is Invalid. The Valid Options Are:" | ||
726 | $ WRITE SYS$OUTPUT "" | ||
727 | $ WRITE SYS$OUTPUT " VAXC : To Compile With VAX C." | ||
728 | $ WRITE SYS$OUTPUT " DECC : To Compile With DEC C." | ||
729 | $ WRITE SYS$OUTPUT " GNUC : To Compile With GNU C." | ||
730 | $ WRITE SYS$OUTPUT "" | ||
731 | $! | ||
732 | $! Time To EXIT. | ||
733 | $! | ||
734 | $ EXIT | ||
735 | $ ENDIF | ||
736 | $! | ||
737 | $! Time to check the contents, and to make sure we get the correct library. | ||
738 | $! | ||
739 | $ IF P3.EQS."SOCKETSHR" .OR. P3.EQS."MULTINET" .OR. P3.EQS."UCX" - | ||
740 | .OR. P3.EQS."TCPIP" .OR. P3.EQS."NONE" | ||
741 | $ THEN | ||
742 | $! | ||
743 | $! Check to see if SOCKETSHR was chosen | ||
744 | $! | ||
745 | $ IF P3.EQS."SOCKETSHR" | ||
746 | $ THEN | ||
747 | $! | ||
748 | $! Set the library to use SOCKETSHR | ||
749 | $! | ||
750 | $ TCPIP_LIB = "SYS$DISK:[-.VMS]SOCKETSHR_SHR.OPT/OPT" | ||
751 | $! | ||
752 | $! Done with SOCKETSHR | ||
753 | $! | ||
754 | $ ENDIF | ||
755 | $! | ||
756 | $! Check to see if MULTINET was chosen | ||
757 | $! | ||
758 | $ IF P3.EQS."MULTINET" | ||
759 | $ THEN | ||
760 | $! | ||
761 | $! Set the library to use UXC emulation. | ||
762 | $! | ||
763 | $ P3 = "UCX" | ||
764 | $! | ||
765 | $! Done with MULTINET | ||
766 | $! | ||
767 | $ ENDIF | ||
768 | $! | ||
769 | $! Check to see if UCX was chosen | ||
770 | $! | ||
771 | $ IF P3.EQS."UCX" | ||
772 | $ THEN | ||
773 | $! | ||
774 | $! Set the library to use UCX. | ||
775 | $! | ||
776 | $ TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_DECC.OPT/OPT" | ||
777 | $ IF F$TRNLNM("UCX$IPC_SHR") .NES. "" | ||
778 | $ THEN | ||
779 | $ TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_DECC_LOG.OPT/OPT" | ||
780 | $ ELSE | ||
781 | $ IF COMPILER .NES. "DECC" .AND. ARCH .EQS. "VAX" THEN - | ||
782 | TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_VAXC.OPT/OPT" | ||
783 | $ ENDIF | ||
784 | $! | ||
785 | $! Done with UCX | ||
786 | $! | ||
787 | $ ENDIF | ||
788 | $! | ||
789 | $! Check to see if TCPIP was chosen | ||
790 | $! | ||
791 | $ IF P3.EQS."TCPIP" | ||
792 | $ THEN | ||
793 | $! | ||
794 | $! Set the library to use TCPIP (post UCX). | ||
795 | $! | ||
796 | $ TCPIP_LIB = "SYS$DISK:[-.VMS]TCPIP_SHR_DECC.OPT/OPT" | ||
797 | $! | ||
798 | $! Done with TCPIP | ||
799 | $! | ||
800 | $ ENDIF | ||
801 | $! | ||
802 | $! Check to see if NONE was chosen | ||
803 | $! | ||
804 | $ IF P3.EQS."NONE" | ||
805 | $ THEN | ||
806 | $! | ||
807 | $! Do not use a TCPIP library. | ||
808 | $! | ||
809 | $ TCPIP_LIB = "" | ||
810 | $! | ||
811 | $! Done with NONE | ||
812 | $! | ||
813 | $ ENDIF | ||
814 | $! | ||
815 | $! Print info | ||
816 | $! | ||
817 | $ WRITE SYS$OUTPUT "TCP/IP library spec: ", TCPIP_LIB | ||
818 | $! | ||
819 | $! Else The User Entered An Invalid Arguement. | ||
820 | $! | ||
821 | $ ELSE | ||
822 | $! | ||
823 | $! Tell The User We Don't Know What They Want. | ||
824 | $! | ||
825 | $ WRITE SYS$OUTPUT "" | ||
826 | $ WRITE SYS$OUTPUT "The Option ",P3," Is Invalid. The Valid Options Are:" | ||
827 | $ WRITE SYS$OUTPUT "" | ||
828 | $ WRITE SYS$OUTPUT " SOCKETSHR : To link with SOCKETSHR TCP/IP library." | ||
829 | $ WRITE SYS$OUTPUT " UCX : To link with UCX TCP/IP library." | ||
830 | $ WRITE SYS$OUTPUT " TCPIP : To link with TCPIP (post UCX) TCP/IP library." | ||
831 | $ WRITE SYS$OUTPUT "" | ||
832 | $! | ||
833 | $! Time To EXIT. | ||
834 | $! | ||
835 | $ EXIT | ||
836 | $! | ||
837 | $! Done with TCP/IP libraries | ||
838 | $! | ||
839 | $ ENDIF | ||
840 | $! | ||
841 | $! Special Threads For OpenVMS v7.1 Or Later | ||
842 | $! | ||
843 | $! Written By: Richard Levitte | ||
844 | $! richard@levitte.org | ||
845 | $! | ||
846 | $! | ||
847 | $! Check To See If We Have A Option For P4. | ||
848 | $! | ||
849 | $ IF (P4.EQS."") | ||
850 | $ THEN | ||
851 | $! | ||
852 | $! Get The Version Of VMS We Are Using. | ||
853 | $! | ||
854 | $ ISSEVEN := | ||
855 | $ TMP = F$ELEMENT(0,"-",F$EXTRACT(1,4,F$GETSYI("VERSION"))) | ||
856 | $ TMP = F$INTEGER(F$ELEMENT(0,".",TMP)+F$ELEMENT(1,".",TMP)) | ||
857 | $! | ||
858 | $! Check To See If The VMS Version Is v7.1 Or Later. | ||
859 | $! | ||
860 | $ IF (TMP.GE.71) | ||
861 | $ THEN | ||
862 | $! | ||
863 | $! We Have OpenVMS v7.1 Or Later, So Use The Special Threads. | ||
864 | $! | ||
865 | $ ISSEVEN := ,PTHREAD_USE_D4 | ||
866 | $! | ||
867 | $! End The VMS Version Check. | ||
868 | $! | ||
869 | $ ENDIF | ||
870 | $! | ||
871 | $! End The P4 Check. | ||
872 | $! | ||
873 | $ ENDIF | ||
874 | $! | ||
875 | $! Time To RETURN... | ||
876 | $! | ||
877 | $ RETURN | ||
878 | $! | ||
879 | $ INITIALISE: | ||
880 | $! | ||
881 | $! Save old value of the logical name OPENSSL | ||
882 | $! | ||
883 | $ __SAVE_OPENSSL = F$TRNLNM("OPENSSL","LNM$PROCESS_TABLE") | ||
884 | $! | ||
885 | $! Save directory information | ||
886 | $! | ||
887 | $ __HERE = F$PARSE(F$PARSE("A.;",F$ENVIRONMENT("PROCEDURE"))-"A.;","[]A.;") - "A.;" | ||
888 | $ __HERE = F$EDIT(__HERE,"UPCASE") | ||
889 | $ __TOP = __HERE - "TEST]" | ||
890 | $ __INCLUDE = __TOP + "INCLUDE.OPENSSL]" | ||
891 | $! | ||
892 | $! Set up the logical name OPENSSL to point at the include directory | ||
893 | $! | ||
894 | $ DEFINE OPENSSL/NOLOG '__INCLUDE' | ||
895 | $! | ||
896 | $! Done | ||
897 | $! | ||
898 | $ RETURN | ||
899 | $! | ||
900 | $ CLEANUP: | ||
901 | $! | ||
902 | $! Restore the logical name OPENSSL if it had a value | ||
903 | $! | ||
904 | $ IF __SAVE_OPENSSL .EQS. "" | ||
905 | $ THEN | ||
906 | $ DEASSIGN OPENSSL | ||
907 | $ ELSE | ||
908 | $ DEFINE/NOLOG OPENSSL '__SAVE_OPENSSL' | ||
909 | $ ENDIF | ||
910 | $! | ||
911 | $! Done | ||
912 | $! | ||
913 | $ RETURN | ||
diff --git a/src/lib/libssl/test/md4test.c b/src/lib/libssl/test/md4test.c new file mode 100644 index 0000000000..e0fdc42282 --- /dev/null +++ b/src/lib/libssl/test/md4test.c | |||
@@ -0,0 +1,134 @@ | |||
1 | /* crypto/md4/md4test.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 <string.h> | ||
61 | #include <stdlib.h> | ||
62 | |||
63 | #ifdef OPENSSL_NO_MD4 | ||
64 | int main(int argc, char *argv[]) | ||
65 | { | ||
66 | printf("No MD4 support\n"); | ||
67 | return(0); | ||
68 | } | ||
69 | #else | ||
70 | #include <openssl/evp.h> | ||
71 | #include <openssl/md4.h> | ||
72 | |||
73 | static char *test[]={ | ||
74 | "", | ||
75 | "a", | ||
76 | "abc", | ||
77 | "message digest", | ||
78 | "abcdefghijklmnopqrstuvwxyz", | ||
79 | "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", | ||
80 | "12345678901234567890123456789012345678901234567890123456789012345678901234567890", | ||
81 | NULL, | ||
82 | }; | ||
83 | |||
84 | static char *ret[]={ | ||
85 | "31d6cfe0d16ae931b73c59d7e0c089c0", | ||
86 | "bde52cb31de33e46245e05fbdbd6fb24", | ||
87 | "a448017aaf21d8525fc10ae87aa6729d", | ||
88 | "d9130a8164549fe818874806e1c7014b", | ||
89 | "d79e1c308aa5bbcdeea8ed63df412da9", | ||
90 | "043f8582f241db351ce627e153e7f0e4", | ||
91 | "e33b4ddc9c38f2199c3e7b164fcc0536", | ||
92 | }; | ||
93 | |||
94 | static char *pt(unsigned char *md); | ||
95 | int main(int argc, char *argv[]) | ||
96 | { | ||
97 | int i,err=0; | ||
98 | unsigned char **P,**R; | ||
99 | char *p; | ||
100 | unsigned char md[MD4_DIGEST_LENGTH]; | ||
101 | |||
102 | P=(unsigned char **)test; | ||
103 | R=(unsigned char **)ret; | ||
104 | i=1; | ||
105 | while (*P != NULL) | ||
106 | { | ||
107 | EVP_Digest(&(P[0][0]),(unsigned long)strlen((char *)*P),md,NULL,EVP_md4(), NULL); | ||
108 | p=pt(md); | ||
109 | if (strcmp(p,(char *)*R) != 0) | ||
110 | { | ||
111 | printf("error calculating MD4 on '%s'\n",*P); | ||
112 | printf("got %s instead of %s\n",p,*R); | ||
113 | err++; | ||
114 | } | ||
115 | else | ||
116 | printf("test %d ok\n",i); | ||
117 | i++; | ||
118 | R++; | ||
119 | P++; | ||
120 | } | ||
121 | exit(err); | ||
122 | return(0); | ||
123 | } | ||
124 | |||
125 | static char *pt(unsigned char *md) | ||
126 | { | ||
127 | int i; | ||
128 | static char buf[80]; | ||
129 | |||
130 | for (i=0; i<MD4_DIGEST_LENGTH; i++) | ||
131 | sprintf(&(buf[i*2]),"%02x",md[i]); | ||
132 | return(buf); | ||
133 | } | ||
134 | #endif | ||
diff --git a/src/lib/libssl/test/methtest.c b/src/lib/libssl/test/methtest.c new file mode 100644 index 0000000000..005c2f4822 --- /dev/null +++ b/src/lib/libssl/test/methtest.c | |||
@@ -0,0 +1,105 @@ | |||
1 | /* test/methtest.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/rsa.h> | ||
62 | #include <openssl/x509.h> | ||
63 | #include "meth.h" | ||
64 | #include <openssl/err.h> | ||
65 | |||
66 | int main(argc,argv) | ||
67 | int argc; | ||
68 | char *argv[]; | ||
69 | { | ||
70 | METHOD_CTX *top,*tmp1,*tmp2; | ||
71 | |||
72 | top=METH_new(x509_lookup()); /* get a top level context */ | ||
73 | if (top == NULL) goto err; | ||
74 | |||
75 | tmp1=METH_new(x509_by_file()); | ||
76 | if (top == NULL) goto err; | ||
77 | METH_arg(tmp1,METH_TYPE_FILE,"cafile1"); | ||
78 | METH_arg(tmp1,METH_TYPE_FILE,"cafile2"); | ||
79 | METH_push(top,METH_X509_CA_BY_SUBJECT,tmp1); | ||
80 | |||
81 | tmp2=METH_new(x509_by_dir()); | ||
82 | METH_arg(tmp2,METH_TYPE_DIR,"/home/eay/.CAcerts"); | ||
83 | METH_arg(tmp2,METH_TYPE_DIR,"/home/eay/SSLeay/certs"); | ||
84 | METH_arg(tmp2,METH_TYPE_DIR,"/usr/local/ssl/certs"); | ||
85 | METH_push(top,METH_X509_CA_BY_SUBJECT,tmp2); | ||
86 | |||
87 | /* tmp=METH_new(x509_by_issuer_dir); | ||
88 | METH_arg(tmp,METH_TYPE_DIR,"/home/eay/.mycerts"); | ||
89 | METH_push(top,METH_X509_BY_ISSUER,tmp); | ||
90 | |||
91 | tmp=METH_new(x509_by_issuer_primary); | ||
92 | METH_arg(tmp,METH_TYPE_FILE,"/home/eay/.mycerts/primary.pem"); | ||
93 | METH_push(top,METH_X509_BY_ISSUER,tmp); | ||
94 | */ | ||
95 | |||
96 | METH_init(top); | ||
97 | METH_control(tmp1,METH_CONTROL_DUMP,stdout); | ||
98 | METH_control(tmp2,METH_CONTROL_DUMP,stdout); | ||
99 | EXIT(0); | ||
100 | err: | ||
101 | ERR_load_crypto_strings(); | ||
102 | ERR_print_errors_fp(stderr); | ||
103 | EXIT(1); | ||
104 | return(0); | ||
105 | } | ||
diff --git a/src/lib/libssl/test/pkcs7-1.pem b/src/lib/libssl/test/pkcs7-1.pem new file mode 100644 index 0000000000..c47b27af88 --- /dev/null +++ b/src/lib/libssl/test/pkcs7-1.pem | |||
@@ -0,0 +1,15 @@ | |||
1 | -----BEGIN PKCS7----- | ||
2 | MIICUAYJKoZIhvcNAQcCoIICQTCCAj0CAQExDjAMBggqhkiG9w0CAgUAMCgGCSqG | ||
3 | SIb3DQEHAaAbBBlFdmVyeW9uZSBnZXRzIEZyaWRheSBvZmYuoIIBXjCCAVowggEE | ||
4 | AgQUAAApMA0GCSqGSIb3DQEBAgUAMCwxCzAJBgNVBAYTAlVTMR0wGwYDVQQKExRF | ||
5 | eGFtcGxlIE9yZ2FuaXphdGlvbjAeFw05MjA5MDkyMjE4MDZaFw05NDA5MDkyMjE4 | ||
6 | MDVaMEIxCzAJBgNVBAYTAlVTMR0wGwYDVQQKExRFeGFtcGxlIE9yZ2FuaXphdGlv | ||
7 | bjEUMBIGA1UEAxMLVGVzdCBVc2VyIDEwWzANBgkqhkiG9w0BAQEFAANKADBHAkAK | ||
8 | ZnkdxpiBaN56t3QZu3+wwAHGJxAnAHUUKULhmo2MUdBTs+N4Kh3l3Fr06+mUaBcB | ||
9 | FKHf5nzcmpr1XWVWILurAgMBAAEwDQYJKoZIhvcNAQECBQADQQBFGqHhqncgSl/N | ||
10 | 9XYGnQL3MsJvNnsNV4puZPOakR9Hld8JlDQFEaDR30ogsmp3TMrvdfxpLlTCoZN8 | ||
11 | BxEmnZsWMYGbMIGYAgEBMDQwLDELMAkGA1UEBhMCVVMxHTAbBgNVBAoTFEV4YW1w | ||
12 | bGUgT3JnYW5pemF0aW9uAgQUAAApMAwGCCqGSIb3DQICBQAwDQYJKoZIhvcNAQEB | ||
13 | BQAEQAX6aoEvx9+L9PJUJQngPoRuEbnGIL4gCe+0QO+8xmkhaZSsBPNBtX0FIC1C | ||
14 | j7Kie1x339mxW/w9VZNTUDQQweHh | ||
15 | -----END PKCS7----- | ||
diff --git a/src/lib/libssl/test/pkcs7.pem b/src/lib/libssl/test/pkcs7.pem new file mode 100644 index 0000000000..d55c60b94e --- /dev/null +++ b/src/lib/libssl/test/pkcs7.pem | |||
@@ -0,0 +1,54 @@ | |||
1 | MIAGCSqGSIb3DQEHAqCAMIACAQExADCABgkqhkiG9w0BBwEAAKCAMIIE+DCCBGGg | ||
2 | AwIBAgIQaGSF/JpbS1C223+yrc+N1DANBgkqhkiG9w0BAQQFADBiMREwDwYDVQQH | ||
3 | EwhJbnRlcm5ldDEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xNDAyBgNVBAsTK1Zl | ||
4 | cmlTaWduIENsYXNzIDEgQ0EgLSBJbmRpdmlkdWFsIFN1YnNjcmliZXIwHhcNOTYw | ||
5 | ODEyMDAwMDAwWhcNOTYwODE3MjM1OTU5WjCCASAxETAPBgNVBAcTCEludGVybmV0 | ||
6 | MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE0MDIGA1UECxMrVmVyaVNpZ24gQ2xh | ||
7 | c3MgMSBDQSAtIEluZGl2aWR1YWwgU3Vic2NyaWJlcjE3MDUGA1UECxMuRGlnaXRh | ||
8 | bCBJRCBDbGFzcyAxIC0gU01JTUUgVmVyaVNpZ24sIEluYy4gVEVTVDFGMEQGA1UE | ||
9 | CxM9d3d3LnZlcmlzaWduLmNvbS9yZXBvc2l0b3J5L0NQUyBJbmNvcnAuIGJ5IFJl | ||
10 | Zi4sTElBQi5MVEQoYyk5NjEZMBcGA1UEAxMQQWxleGFuZHJlIERlYWNvbjEgMB4G | ||
11 | CSqGSIb3DQEJARYRYWxleEB2ZXJpc2lnbi5jb20wWzANBgkqhkiG9w0BAQEFAANK | ||
12 | ADBHAkAOy7xxCAIkOfuIA2LyRpxgKlDORl8htdXYhF5iBGUx1GYaK6KF+bK/CCI0 | ||
13 | l4j2OfWGFBUrwGoWqxTNcWgTfMzRAgMBAAGjggIyMIICLjAJBgNVHRMEAjAAMIIC | ||
14 | HwYDVR0DBIICFjCCAhIwggIOMIICCgYLYIZIAYb4RQEHAQEwggH5FoIBp1RoaXMg | ||
15 | Y2VydGlmaWNhdGUgaW5jb3Jwb3JhdGVzIGJ5IHJlZmVyZW5jZSwgYW5kIGl0cyB1 | ||
16 | c2UgaXMgc3RyaWN0bHkgc3ViamVjdCB0bywgdGhlIFZlcmlTaWduIENlcnRpZmlj | ||
17 | YXRpb24gUHJhY3RpY2UgU3RhdGVtZW50IChDUFMpLCBhdmFpbGFibGUgYXQ6IGh0 | ||
18 | dHBzOi8vd3d3LnZlcmlzaWduLmNvbS9DUFM7IGJ5IEUtbWFpbCBhdCBDUFMtcmVx | ||
19 | dWVzdHNAdmVyaXNpZ24uY29tOyBvciBieSBtYWlsIGF0IFZlcmlTaWduLCBJbmMu | ||
20 | LCAyNTkzIENvYXN0IEF2ZS4sIE1vdW50YWluIFZpZXcsIENBIDk0MDQzIFVTQSBU | ||
21 | ZWwuICsxICg0MTUpIDk2MS04ODMwIENvcHlyaWdodCAoYykgMTk5NiBWZXJpU2ln | ||
22 | biwgSW5jLiAgQWxsIFJpZ2h0cyBSZXNlcnZlZC4gQ0VSVEFJTiBXQVJSQU5USUVT | ||
23 | IERJU0NMQUlNRUQgYW5kIExJQUJJTElUWSBMSU1JVEVELqAOBgxghkgBhvhFAQcB | ||
24 | AQGhDgYMYIZIAYb4RQEHAQECMCwwKhYoaHR0cHM6Ly93d3cudmVyaXNpZ24uY29t | ||
25 | L3JlcG9zaXRvcnkvQ1BTIDANBgkqhkiG9w0BAQQFAAOBgQAimWMGQwwwxk+b3KAL | ||
26 | HlSWXtU7LWHe29CEG8XeVNTvrqs6SBqT7OoENOkGxpfdpVgZ3Qw2SKjxDvbvpfSF | ||
27 | slsqcxWSgB/hWuaVuZCkvTw/dYGGOxkTJGxvDCfl1PZjX4dKbatslsi9Z9HpGWT7 | ||
28 | ttItRwKqcBKgmCJvKi1pGWED0zCCAnkwggHioAMCAQICEDURpVKQb+fQKaRAGdQR | ||
29 | /D4wDQYJKoZIhvcNAQECBQAwXzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlT | ||
30 | aWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAxIFB1YmxpYyBQcmltYXJ5IENlcnRp | ||
31 | ZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2MDYyNzAwMDAwMFoXDTk3MDYyNzIzNTk1 | ||
32 | OVowYjERMA8GA1UEBxMISW50ZXJuZXQxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMu | ||
33 | MTQwMgYDVQQLEytWZXJpU2lnbiBDbGFzcyAxIENBIC0gSW5kaXZpZHVhbCBTdWJz | ||
34 | Y3JpYmVyMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC2FKbPTdAFDdjKI9Bv | ||
35 | qrQpkmOOLPhvltcunXZLEbE2jVfJw/0cxrr+Hgi6M8qV6r7jW80GqLd5HUQq7XPy | ||
36 | sVKDaBBwZJHXPmv5912dFEObbpdFmIFH0S3L3bty10w/cariQPJUObwW7s987Lrb | ||
37 | P2wqsxaxhhKdrpM01bjV0Pc+qQIDAQABozMwMTAPBgNVHRMECDAGAQH/AgEBMAsG | ||
38 | A1UdDwQEAwIBBjARBglghkgBhvhCAQEEBAMCAgQwDQYJKoZIhvcNAQECBQADgYEA | ||
39 | KeXHoBmnbxRCgk0jM9e9mDppdxpsipIna/J8DOHEUuD4nONAr4+xOg73SBl026n7 | ||
40 | Bk55A2wvAMGo7+kKTZ+rHaFDDcmq4O+rzFri2RIOeGAncj1IcGptAQhvXoIhFMG4 | ||
41 | Jlzg1KlHZHqy7D3jex78zcSU7kKOu8f5tAX1jC3+sToAAKGAMIIBJzCBkTANBgkq | ||
42 | hkiG9w0BAQIFADBiMREwDwYDVQQHEwhJbnRlcm5ldDEXMBUGA1UEChMOVmVyaVNp | ||
43 | Z24sIEluYy4xNDAyBgNVBAsTK1ZlcmlTaWduIENsYXNzIDEgQ0EgLSBJbmRpdmlk | ||
44 | dWFsIFN1YnNjcmliZXIXDTk2MDcwMTE3MzA0MFoXDTk3MDcwMTAwMDAwMFowDQYJ | ||
45 | KoZIhvcNAQECBQADgYEAGLuQ6PX8A7AiqBEtWzYtl6lZNSDI0bR5YUo+D2Jzkw30 | ||
46 | dxQnJSbKXEc6XYuzAW5HvrzATXu5c19WWPT4cRDwmjH71i9QcDysWwf/wE0qGTiW | ||
47 | I3tQT0I5VGh7jIJD07nlBw3R4Xl8dH9kr85JsWinqDH5YKpIo9o8knY5n7+qjOow | ||
48 | ggEkMIGOMA0GCSqGSIb3DQEBAgUAMF8xCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5W | ||
49 | ZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgMSBQdWJsaWMgUHJpbWFyeSBD | ||
50 | ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eRcNOTYwNzE2MjMxMTI5WhcNOTYwODE1MDAw | ||
51 | MDAwWjANBgkqhkiG9w0BAQIFAAOBgQAXsLE4vnsY6sY67QrmWec7iaU2ehzxanEK | ||
52 | /9wKHZNuhlNzk+qGZZw2evxfUe2OaRbYpl8zuZvhK9BHD3ad14OSe9/zx5hOPgP/ | ||
53 | DQXt6R4R8Q/1JheBrolrgbavjvI2wKS8/Psp2prBrkF4T48+AKRmS8Zzh1guxgvP | ||
54 | b+xSu/jH0gAAMYAAAAAAAAAAAA== | ||
diff --git a/src/lib/libssl/test/r160test.c b/src/lib/libssl/test/r160test.c new file mode 100644 index 0000000000..a172e393ca --- /dev/null +++ b/src/lib/libssl/test/r160test.c | |||
@@ -0,0 +1,57 @@ | |||
1 | /* test/r160test.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 | */ | ||
diff --git a/src/lib/libssl/test/rsa_test.c b/src/lib/libssl/test/rsa_test.c new file mode 100644 index 0000000000..b8b462d33b --- /dev/null +++ b/src/lib/libssl/test/rsa_test.c | |||
@@ -0,0 +1,318 @@ | |||
1 | /* test vectors from p1ovect1.txt */ | ||
2 | |||
3 | #include <stdio.h> | ||
4 | #include <string.h> | ||
5 | |||
6 | #include "e_os.h" | ||
7 | |||
8 | #include <openssl/crypto.h> | ||
9 | #include <openssl/err.h> | ||
10 | #include <openssl/rand.h> | ||
11 | #ifdef OPENSSL_NO_RSA | ||
12 | int main(int argc, char *argv[]) | ||
13 | { | ||
14 | printf("No RSA support\n"); | ||
15 | return(0); | ||
16 | } | ||
17 | #else | ||
18 | #include <openssl/rsa.h> | ||
19 | #include <openssl/engine.h> | ||
20 | |||
21 | #define SetKey \ | ||
22 | key->n = BN_bin2bn(n, sizeof(n)-1, key->n); \ | ||
23 | key->e = BN_bin2bn(e, sizeof(e)-1, key->e); \ | ||
24 | key->d = BN_bin2bn(d, sizeof(d)-1, key->d); \ | ||
25 | key->p = BN_bin2bn(p, sizeof(p)-1, key->p); \ | ||
26 | key->q = BN_bin2bn(q, sizeof(q)-1, key->q); \ | ||
27 | key->dmp1 = BN_bin2bn(dmp1, sizeof(dmp1)-1, key->dmp1); \ | ||
28 | key->dmq1 = BN_bin2bn(dmq1, sizeof(dmq1)-1, key->dmq1); \ | ||
29 | key->iqmp = BN_bin2bn(iqmp, sizeof(iqmp)-1, key->iqmp); \ | ||
30 | memcpy(c, ctext_ex, sizeof(ctext_ex) - 1); \ | ||
31 | return (sizeof(ctext_ex) - 1); | ||
32 | |||
33 | static int key1(RSA *key, unsigned char *c) | ||
34 | { | ||
35 | static unsigned char n[] = | ||
36 | "\x00\xAA\x36\xAB\xCE\x88\xAC\xFD\xFF\x55\x52\x3C\x7F\xC4\x52\x3F" | ||
37 | "\x90\xEF\xA0\x0D\xF3\x77\x4A\x25\x9F\x2E\x62\xB4\xC5\xD9\x9C\xB5" | ||
38 | "\xAD\xB3\x00\xA0\x28\x5E\x53\x01\x93\x0E\x0C\x70\xFB\x68\x76\x93" | ||
39 | "\x9C\xE6\x16\xCE\x62\x4A\x11\xE0\x08\x6D\x34\x1E\xBC\xAC\xA0\xA1" | ||
40 | "\xF5"; | ||
41 | |||
42 | static unsigned char e[] = "\x11"; | ||
43 | |||
44 | static unsigned char d[] = | ||
45 | "\x0A\x03\x37\x48\x62\x64\x87\x69\x5F\x5F\x30\xBC\x38\xB9\x8B\x44" | ||
46 | "\xC2\xCD\x2D\xFF\x43\x40\x98\xCD\x20\xD8\xA1\x38\xD0\x90\xBF\x64" | ||
47 | "\x79\x7C\x3F\xA7\xA2\xCD\xCB\x3C\xD1\xE0\xBD\xBA\x26\x54\xB4\xF9" | ||
48 | "\xDF\x8E\x8A\xE5\x9D\x73\x3D\x9F\x33\xB3\x01\x62\x4A\xFD\x1D\x51"; | ||
49 | |||
50 | static unsigned char p[] = | ||
51 | "\x00\xD8\x40\xB4\x16\x66\xB4\x2E\x92\xEA\x0D\xA3\xB4\x32\x04\xB5" | ||
52 | "\xCF\xCE\x33\x52\x52\x4D\x04\x16\xA5\xA4\x41\xE7\x00\xAF\x46\x12" | ||
53 | "\x0D"; | ||
54 | |||
55 | static unsigned char q[] = | ||
56 | "\x00\xC9\x7F\xB1\xF0\x27\xF4\x53\xF6\x34\x12\x33\xEA\xAA\xD1\xD9" | ||
57 | "\x35\x3F\x6C\x42\xD0\x88\x66\xB1\xD0\x5A\x0F\x20\x35\x02\x8B\x9D" | ||
58 | "\x89"; | ||
59 | |||
60 | static unsigned char dmp1[] = | ||
61 | "\x59\x0B\x95\x72\xA2\xC2\xA9\xC4\x06\x05\x9D\xC2\xAB\x2F\x1D\xAF" | ||
62 | "\xEB\x7E\x8B\x4F\x10\xA7\x54\x9E\x8E\xED\xF5\xB4\xFC\xE0\x9E\x05"; | ||
63 | |||
64 | static unsigned char dmq1[] = | ||
65 | "\x00\x8E\x3C\x05\x21\xFE\x15\xE0\xEA\x06\xA3\x6F\xF0\xF1\x0C\x99" | ||
66 | "\x52\xC3\x5B\x7A\x75\x14\xFD\x32\x38\xB8\x0A\xAD\x52\x98\x62\x8D" | ||
67 | "\x51"; | ||
68 | |||
69 | static unsigned char iqmp[] = | ||
70 | "\x36\x3F\xF7\x18\x9D\xA8\xE9\x0B\x1D\x34\x1F\x71\xD0\x9B\x76\xA8" | ||
71 | "\xA9\x43\xE1\x1D\x10\xB2\x4D\x24\x9F\x2D\xEA\xFE\xF8\x0C\x18\x26"; | ||
72 | |||
73 | static unsigned char ctext_ex[] = | ||
74 | "\x1b\x8f\x05\xf9\xca\x1a\x79\x52\x6e\x53\xf3\xcc\x51\x4f\xdb\x89" | ||
75 | "\x2b\xfb\x91\x93\x23\x1e\x78\xb9\x92\xe6\x8d\x50\xa4\x80\xcb\x52" | ||
76 | "\x33\x89\x5c\x74\x95\x8d\x5d\x02\xab\x8c\x0f\xd0\x40\xeb\x58\x44" | ||
77 | "\xb0\x05\xc3\x9e\xd8\x27\x4a\x9d\xbf\xa8\x06\x71\x40\x94\x39\xd2"; | ||
78 | |||
79 | SetKey; | ||
80 | } | ||
81 | |||
82 | static int key2(RSA *key, unsigned char *c) | ||
83 | { | ||
84 | static unsigned char n[] = | ||
85 | "\x00\xA3\x07\x9A\x90\xDF\x0D\xFD\x72\xAC\x09\x0C\xCC\x2A\x78\xB8" | ||
86 | "\x74\x13\x13\x3E\x40\x75\x9C\x98\xFA\xF8\x20\x4F\x35\x8A\x0B\x26" | ||
87 | "\x3C\x67\x70\xE7\x83\xA9\x3B\x69\x71\xB7\x37\x79\xD2\x71\x7B\xE8" | ||
88 | "\x34\x77\xCF"; | ||
89 | |||
90 | static unsigned char e[] = "\x3"; | ||
91 | |||
92 | static unsigned char d[] = | ||
93 | "\x6C\xAF\xBC\x60\x94\xB3\xFE\x4C\x72\xB0\xB3\x32\xC6\xFB\x25\xA2" | ||
94 | "\xB7\x62\x29\x80\x4E\x68\x65\xFC\xA4\x5A\x74\xDF\x0F\x8F\xB8\x41" | ||
95 | "\x3B\x52\xC0\xD0\xE5\x3D\x9B\x59\x0F\xF1\x9B\xE7\x9F\x49\xDD\x21" | ||
96 | "\xE5\xEB"; | ||
97 | |||
98 | static unsigned char p[] = | ||
99 | "\x00\xCF\x20\x35\x02\x8B\x9D\x86\x98\x40\xB4\x16\x66\xB4\x2E\x92" | ||
100 | "\xEA\x0D\xA3\xB4\x32\x04\xB5\xCF\xCE\x91"; | ||
101 | |||
102 | static unsigned char q[] = | ||
103 | "\x00\xC9\x7F\xB1\xF0\x27\xF4\x53\xF6\x34\x12\x33\xEA\xAA\xD1\xD9" | ||
104 | "\x35\x3F\x6C\x42\xD0\x88\x66\xB1\xD0\x5F"; | ||
105 | |||
106 | static unsigned char dmp1[] = | ||
107 | "\x00\x8A\x15\x78\xAC\x5D\x13\xAF\x10\x2B\x22\xB9\x99\xCD\x74\x61" | ||
108 | "\xF1\x5E\x6D\x22\xCC\x03\x23\xDF\xDF\x0B"; | ||
109 | |||
110 | static unsigned char dmq1[] = | ||
111 | "\x00\x86\x55\x21\x4A\xC5\x4D\x8D\x4E\xCD\x61\x77\xF1\xC7\x36\x90" | ||
112 | "\xCE\x2A\x48\x2C\x8B\x05\x99\xCB\xE0\x3F"; | ||
113 | |||
114 | static unsigned char iqmp[] = | ||
115 | "\x00\x83\xEF\xEF\xB8\xA9\xA4\x0D\x1D\xB6\xED\x98\xAD\x84\xED\x13" | ||
116 | "\x35\xDC\xC1\x08\xF3\x22\xD0\x57\xCF\x8D"; | ||
117 | |||
118 | static unsigned char ctext_ex[] = | ||
119 | "\x14\xbd\xdd\x28\xc9\x83\x35\x19\x23\x80\xe8\xe5\x49\xb1\x58\x2a" | ||
120 | "\x8b\x40\xb4\x48\x6d\x03\xa6\xa5\x31\x1f\x1f\xd5\xf0\xa1\x80\xe4" | ||
121 | "\x17\x53\x03\x29\xa9\x34\x90\x74\xb1\x52\x13\x54\x29\x08\x24\x52" | ||
122 | "\x62\x51"; | ||
123 | |||
124 | SetKey; | ||
125 | } | ||
126 | |||
127 | static int key3(RSA *key, unsigned char *c) | ||
128 | { | ||
129 | static unsigned char n[] = | ||
130 | "\x00\xBB\xF8\x2F\x09\x06\x82\xCE\x9C\x23\x38\xAC\x2B\x9D\xA8\x71" | ||
131 | "\xF7\x36\x8D\x07\xEE\xD4\x10\x43\xA4\x40\xD6\xB6\xF0\x74\x54\xF5" | ||
132 | "\x1F\xB8\xDF\xBA\xAF\x03\x5C\x02\xAB\x61\xEA\x48\xCE\xEB\x6F\xCD" | ||
133 | "\x48\x76\xED\x52\x0D\x60\xE1\xEC\x46\x19\x71\x9D\x8A\x5B\x8B\x80" | ||
134 | "\x7F\xAF\xB8\xE0\xA3\xDF\xC7\x37\x72\x3E\xE6\xB4\xB7\xD9\x3A\x25" | ||
135 | "\x84\xEE\x6A\x64\x9D\x06\x09\x53\x74\x88\x34\xB2\x45\x45\x98\x39" | ||
136 | "\x4E\xE0\xAA\xB1\x2D\x7B\x61\xA5\x1F\x52\x7A\x9A\x41\xF6\xC1\x68" | ||
137 | "\x7F\xE2\x53\x72\x98\xCA\x2A\x8F\x59\x46\xF8\xE5\xFD\x09\x1D\xBD" | ||
138 | "\xCB"; | ||
139 | |||
140 | static unsigned char e[] = "\x11"; | ||
141 | |||
142 | static unsigned char d[] = | ||
143 | "\x00\xA5\xDA\xFC\x53\x41\xFA\xF2\x89\xC4\xB9\x88\xDB\x30\xC1\xCD" | ||
144 | "\xF8\x3F\x31\x25\x1E\x06\x68\xB4\x27\x84\x81\x38\x01\x57\x96\x41" | ||
145 | "\xB2\x94\x10\xB3\xC7\x99\x8D\x6B\xC4\x65\x74\x5E\x5C\x39\x26\x69" | ||
146 | "\xD6\x87\x0D\xA2\xC0\x82\xA9\x39\xE3\x7F\xDC\xB8\x2E\xC9\x3E\xDA" | ||
147 | "\xC9\x7F\xF3\xAD\x59\x50\xAC\xCF\xBC\x11\x1C\x76\xF1\xA9\x52\x94" | ||
148 | "\x44\xE5\x6A\xAF\x68\xC5\x6C\x09\x2C\xD3\x8D\xC3\xBE\xF5\xD2\x0A" | ||
149 | "\x93\x99\x26\xED\x4F\x74\xA1\x3E\xDD\xFB\xE1\xA1\xCE\xCC\x48\x94" | ||
150 | "\xAF\x94\x28\xC2\xB7\xB8\x88\x3F\xE4\x46\x3A\x4B\xC8\x5B\x1C\xB3" | ||
151 | "\xC1"; | ||
152 | |||
153 | static unsigned char p[] = | ||
154 | "\x00\xEE\xCF\xAE\x81\xB1\xB9\xB3\xC9\x08\x81\x0B\x10\xA1\xB5\x60" | ||
155 | "\x01\x99\xEB\x9F\x44\xAE\xF4\xFD\xA4\x93\xB8\x1A\x9E\x3D\x84\xF6" | ||
156 | "\x32\x12\x4E\xF0\x23\x6E\x5D\x1E\x3B\x7E\x28\xFA\xE7\xAA\x04\x0A" | ||
157 | "\x2D\x5B\x25\x21\x76\x45\x9D\x1F\x39\x75\x41\xBA\x2A\x58\xFB\x65" | ||
158 | "\x99"; | ||
159 | |||
160 | static unsigned char q[] = | ||
161 | "\x00\xC9\x7F\xB1\xF0\x27\xF4\x53\xF6\x34\x12\x33\xEA\xAA\xD1\xD9" | ||
162 | "\x35\x3F\x6C\x42\xD0\x88\x66\xB1\xD0\x5A\x0F\x20\x35\x02\x8B\x9D" | ||
163 | "\x86\x98\x40\xB4\x16\x66\xB4\x2E\x92\xEA\x0D\xA3\xB4\x32\x04\xB5" | ||
164 | "\xCF\xCE\x33\x52\x52\x4D\x04\x16\xA5\xA4\x41\xE7\x00\xAF\x46\x15" | ||
165 | "\x03"; | ||
166 | |||
167 | static unsigned char dmp1[] = | ||
168 | "\x54\x49\x4C\xA6\x3E\xBA\x03\x37\xE4\xE2\x40\x23\xFC\xD6\x9A\x5A" | ||
169 | "\xEB\x07\xDD\xDC\x01\x83\xA4\xD0\xAC\x9B\x54\xB0\x51\xF2\xB1\x3E" | ||
170 | "\xD9\x49\x09\x75\xEA\xB7\x74\x14\xFF\x59\xC1\xF7\x69\x2E\x9A\x2E" | ||
171 | "\x20\x2B\x38\xFC\x91\x0A\x47\x41\x74\xAD\xC9\x3C\x1F\x67\xC9\x81"; | ||
172 | |||
173 | static unsigned char dmq1[] = | ||
174 | "\x47\x1E\x02\x90\xFF\x0A\xF0\x75\x03\x51\xB7\xF8\x78\x86\x4C\xA9" | ||
175 | "\x61\xAD\xBD\x3A\x8A\x7E\x99\x1C\x5C\x05\x56\xA9\x4C\x31\x46\xA7" | ||
176 | "\xF9\x80\x3F\x8F\x6F\x8A\xE3\x42\xE9\x31\xFD\x8A\xE4\x7A\x22\x0D" | ||
177 | "\x1B\x99\xA4\x95\x84\x98\x07\xFE\x39\xF9\x24\x5A\x98\x36\xDA\x3D"; | ||
178 | |||
179 | static unsigned char iqmp[] = | ||
180 | "\x00\xB0\x6C\x4F\xDA\xBB\x63\x01\x19\x8D\x26\x5B\xDB\xAE\x94\x23" | ||
181 | "\xB3\x80\xF2\x71\xF7\x34\x53\x88\x50\x93\x07\x7F\xCD\x39\xE2\x11" | ||
182 | "\x9F\xC9\x86\x32\x15\x4F\x58\x83\xB1\x67\xA9\x67\xBF\x40\x2B\x4E" | ||
183 | "\x9E\x2E\x0F\x96\x56\xE6\x98\xEA\x36\x66\xED\xFB\x25\x79\x80\x39" | ||
184 | "\xF7"; | ||
185 | |||
186 | static unsigned char ctext_ex[] = | ||
187 | "\xb8\x24\x6b\x56\xa6\xed\x58\x81\xae\xb5\x85\xd9\xa2\x5b\x2a\xd7" | ||
188 | "\x90\xc4\x17\xe0\x80\x68\x1b\xf1\xac\x2b\xc3\xde\xb6\x9d\x8b\xce" | ||
189 | "\xf0\xc4\x36\x6f\xec\x40\x0a\xf0\x52\xa7\x2e\x9b\x0e\xff\xb5\xb3" | ||
190 | "\xf2\xf1\x92\xdb\xea\xca\x03\xc1\x27\x40\x05\x71\x13\xbf\x1f\x06" | ||
191 | "\x69\xac\x22\xe9\xf3\xa7\x85\x2e\x3c\x15\xd9\x13\xca\xb0\xb8\x86" | ||
192 | "\x3a\x95\xc9\x92\x94\xce\x86\x74\x21\x49\x54\x61\x03\x46\xf4\xd4" | ||
193 | "\x74\xb2\x6f\x7c\x48\xb4\x2e\xe6\x8e\x1f\x57\x2a\x1f\xc4\x02\x6a" | ||
194 | "\xc4\x56\xb4\xf5\x9f\x7b\x62\x1e\xa1\xb9\xd8\x8f\x64\x20\x2f\xb1"; | ||
195 | |||
196 | SetKey; | ||
197 | } | ||
198 | |||
199 | static int pad_unknown(void) | ||
200 | { | ||
201 | unsigned long l; | ||
202 | while ((l = ERR_get_error()) != 0) | ||
203 | if (ERR_GET_REASON(l) == RSA_R_UNKNOWN_PADDING_TYPE) | ||
204 | return(1); | ||
205 | return(0); | ||
206 | } | ||
207 | |||
208 | static const char rnd_seed[] = "string to make the random number generator think it has entropy"; | ||
209 | |||
210 | int main(int argc, char *argv[]) | ||
211 | { | ||
212 | int err=0; | ||
213 | int v; | ||
214 | RSA *key; | ||
215 | unsigned char ptext[256]; | ||
216 | unsigned char ctext[256]; | ||
217 | static unsigned char ptext_ex[] = "\x54\x85\x9b\x34\x2c\x49\xea\x2a"; | ||
218 | unsigned char ctext_ex[256]; | ||
219 | int plen; | ||
220 | int clen = 0; | ||
221 | int num; | ||
222 | |||
223 | CRYPTO_malloc_debug_init(); | ||
224 | CRYPTO_dbg_set_options(V_CRYPTO_MDEBUG_ALL); | ||
225 | CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON); | ||
226 | |||
227 | RAND_seed(rnd_seed, sizeof rnd_seed); /* or OAEP may fail */ | ||
228 | |||
229 | plen = sizeof(ptext_ex) - 1; | ||
230 | |||
231 | for (v = 0; v < 3; v++) | ||
232 | { | ||
233 | key = RSA_new(); | ||
234 | switch (v) { | ||
235 | case 0: | ||
236 | clen = key1(key, ctext_ex); | ||
237 | break; | ||
238 | case 1: | ||
239 | clen = key2(key, ctext_ex); | ||
240 | break; | ||
241 | case 2: | ||
242 | clen = key3(key, ctext_ex); | ||
243 | break; | ||
244 | } | ||
245 | |||
246 | num = RSA_public_encrypt(plen, ptext_ex, ctext, key, | ||
247 | RSA_PKCS1_PADDING); | ||
248 | if (num != clen) | ||
249 | { | ||
250 | printf("PKCS#1 v1.5 encryption failed!\n"); | ||
251 | err=1; | ||
252 | goto oaep; | ||
253 | } | ||
254 | |||
255 | num = RSA_private_decrypt(num, ctext, ptext, key, | ||
256 | RSA_PKCS1_PADDING); | ||
257 | if (num != plen || memcmp(ptext, ptext_ex, num) != 0) | ||
258 | { | ||
259 | printf("PKCS#1 v1.5 decryption failed!\n"); | ||
260 | err=1; | ||
261 | } | ||
262 | else | ||
263 | printf("PKCS #1 v1.5 encryption/decryption ok\n"); | ||
264 | |||
265 | oaep: | ||
266 | ERR_clear_error(); | ||
267 | num = RSA_public_encrypt(plen, ptext_ex, ctext, key, | ||
268 | RSA_PKCS1_OAEP_PADDING); | ||
269 | if (num == -1 && pad_unknown()) | ||
270 | { | ||
271 | printf("No OAEP support\n"); | ||
272 | goto next; | ||
273 | } | ||
274 | if (num != clen) | ||
275 | { | ||
276 | printf("OAEP encryption failed!\n"); | ||
277 | err=1; | ||
278 | goto next; | ||
279 | } | ||
280 | |||
281 | num = RSA_private_decrypt(num, ctext, ptext, key, | ||
282 | RSA_PKCS1_OAEP_PADDING); | ||
283 | if (num != plen || memcmp(ptext, ptext_ex, num) != 0) | ||
284 | { | ||
285 | printf("OAEP decryption (encrypted data) failed!\n"); | ||
286 | err=1; | ||
287 | } | ||
288 | else if (memcmp(ctext, ctext_ex, num) == 0) | ||
289 | { | ||
290 | printf("OAEP test vector %d passed!\n", v); | ||
291 | goto next; | ||
292 | } | ||
293 | |||
294 | /* Different ciphertexts (rsa_oaep.c without -DPKCS_TESTVECT). | ||
295 | Try decrypting ctext_ex */ | ||
296 | |||
297 | num = RSA_private_decrypt(clen, ctext_ex, ptext, key, | ||
298 | RSA_PKCS1_OAEP_PADDING); | ||
299 | |||
300 | if (num != plen || memcmp(ptext, ptext_ex, num) != 0) | ||
301 | { | ||
302 | printf("OAEP decryption (test vector data) failed!\n"); | ||
303 | err=1; | ||
304 | } | ||
305 | else | ||
306 | printf("OAEP encryption/decryption ok\n"); | ||
307 | next: | ||
308 | RSA_free(key); | ||
309 | } | ||
310 | |||
311 | CRYPTO_cleanup_all_ex_data(); | ||
312 | ERR_remove_state(0); | ||
313 | |||
314 | CRYPTO_mem_leaks_fp(stderr); | ||
315 | |||
316 | return err; | ||
317 | } | ||
318 | #endif | ||
diff --git a/src/lib/libssl/test/tcrl b/src/lib/libssl/test/tcrl new file mode 100644 index 0000000000..3ffed12a03 --- /dev/null +++ b/src/lib/libssl/test/tcrl | |||
@@ -0,0 +1,85 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | if test "$OSTYPE" = msdosdjgpp; then | ||
4 | PATH=../apps\;$PATH | ||
5 | else | ||
6 | PATH=../apps:$PATH | ||
7 | fi | ||
8 | export PATH | ||
9 | |||
10 | cmd='../util/shlib_wrap.sh ../apps/openssl crl' | ||
11 | |||
12 | if [ "$1"x != "x" ]; then | ||
13 | t=$1 | ||
14 | else | ||
15 | t=testcrl.pem | ||
16 | fi | ||
17 | |||
18 | echo testing crl conversions | ||
19 | cp $t fff.p | ||
20 | |||
21 | echo "p -> d" | ||
22 | $cmd -in fff.p -inform p -outform d >f.d | ||
23 | if [ $? != 0 ]; then exit 1; fi | ||
24 | #echo "p -> t" | ||
25 | #$cmd -in fff.p -inform p -outform t >f.t | ||
26 | #if [ $? != 0 ]; then exit 1; fi | ||
27 | echo "p -> p" | ||
28 | $cmd -in fff.p -inform p -outform p >f.p | ||
29 | if [ $? != 0 ]; then exit 1; fi | ||
30 | |||
31 | echo "d -> d" | ||
32 | $cmd -in f.d -inform d -outform d >ff.d1 | ||
33 | if [ $? != 0 ]; then exit 1; fi | ||
34 | #echo "t -> d" | ||
35 | #$cmd -in f.t -inform t -outform d >ff.d2 | ||
36 | #if [ $? != 0 ]; then exit 1; fi | ||
37 | echo "p -> d" | ||
38 | $cmd -in f.p -inform p -outform d >ff.d3 | ||
39 | if [ $? != 0 ]; then exit 1; fi | ||
40 | |||
41 | #echo "d -> t" | ||
42 | #$cmd -in f.d -inform d -outform t >ff.t1 | ||
43 | #if [ $? != 0 ]; then exit 1; fi | ||
44 | #echo "t -> t" | ||
45 | #$cmd -in f.t -inform t -outform t >ff.t2 | ||
46 | #if [ $? != 0 ]; then exit 1; fi | ||
47 | #echo "p -> t" | ||
48 | #$cmd -in f.p -inform p -outform t >ff.t3 | ||
49 | #if [ $? != 0 ]; then exit 1; fi | ||
50 | |||
51 | echo "d -> p" | ||
52 | $cmd -in f.d -inform d -outform p >ff.p1 | ||
53 | if [ $? != 0 ]; then exit 1; fi | ||
54 | #echo "t -> p" | ||
55 | #$cmd -in f.t -inform t -outform p >ff.p2 | ||
56 | #if [ $? != 0 ]; then exit 1; fi | ||
57 | echo "p -> p" | ||
58 | $cmd -in f.p -inform p -outform p >ff.p3 | ||
59 | if [ $? != 0 ]; then exit 1; fi | ||
60 | |||
61 | cmp fff.p f.p | ||
62 | if [ $? != 0 ]; then exit 1; fi | ||
63 | cmp fff.p ff.p1 | ||
64 | if [ $? != 0 ]; then exit 1; fi | ||
65 | #cmp fff.p ff.p2 | ||
66 | #if [ $? != 0 ]; then exit 1; fi | ||
67 | cmp fff.p ff.p3 | ||
68 | if [ $? != 0 ]; then exit 1; fi | ||
69 | |||
70 | #cmp f.t ff.t1 | ||
71 | #if [ $? != 0 ]; then exit 1; fi | ||
72 | #cmp f.t ff.t2 | ||
73 | #if [ $? != 0 ]; then exit 1; fi | ||
74 | #cmp f.t ff.t3 | ||
75 | #if [ $? != 0 ]; then exit 1; fi | ||
76 | |||
77 | cmp f.p ff.p1 | ||
78 | if [ $? != 0 ]; then exit 1; fi | ||
79 | #cmp f.p ff.p2 | ||
80 | #if [ $? != 0 ]; then exit 1; fi | ||
81 | cmp f.p ff.p3 | ||
82 | if [ $? != 0 ]; then exit 1; fi | ||
83 | |||
84 | /bin/rm -f f.* ff.* fff.* | ||
85 | exit 0 | ||
diff --git a/src/lib/libssl/test/tcrl.com b/src/lib/libssl/test/tcrl.com new file mode 100644 index 0000000000..86bf9735aa --- /dev/null +++ b/src/lib/libssl/test/tcrl.com | |||
@@ -0,0 +1,83 @@ | |||
1 | $! TCRL.COM -- Tests crl keys | ||
2 | $ | ||
3 | $ __arch := VAX | ||
4 | $ if f$getsyi("cpu") .ge. 128 then __arch := AXP | ||
5 | $ exe_dir := sys$disk:[-.'__arch'.exe.apps] | ||
6 | $ | ||
7 | $ cmd := mcr 'exe_dir'openssl crl | ||
8 | $ | ||
9 | $ t := testcrl.pem | ||
10 | $ if p1 .nes. "" then t = p1 | ||
11 | $ | ||
12 | $ write sys$output "testing CRL conversions" | ||
13 | $ if f$search("fff.*") .nes "" then delete fff.*;* | ||
14 | $ if f$search("ff.*") .nes "" then delete ff.*;* | ||
15 | $ if f$search("f.*") .nes "" then delete f.*;* | ||
16 | $ convert/fdl=sys$input: 't' fff.p | ||
17 | RECORD | ||
18 | FORMAT STREAM_LF | ||
19 | $ | ||
20 | $ write sys$output "p -> d" | ||
21 | $ 'cmd' -in fff.p -inform p -outform d -out f.d | ||
22 | $ if $severity .ne. 1 then exit 3 | ||
23 | $! write sys$output "p -> t" | ||
24 | $! 'cmd' -in fff.p -inform p -outform t -out f.t | ||
25 | $! if $severity .ne. 1 then exit 3 | ||
26 | $ write sys$output "p -> p" | ||
27 | $ 'cmd' -in fff.p -inform p -outform p -out f.p | ||
28 | $ if $severity .ne. 1 then exit 3 | ||
29 | $ | ||
30 | $ write sys$output "d -> d" | ||
31 | $ 'cmd' -in f.d -inform d -outform d -out ff.d1 | ||
32 | $ if $severity .ne. 1 then exit 3 | ||
33 | $! write sys$output "t -> d" | ||
34 | $! 'cmd' -in f.t -inform t -outform d -out ff.d2 | ||
35 | $! if $severity .ne. 1 then exit 3 | ||
36 | $ write sys$output "p -> d" | ||
37 | $ 'cmd' -in f.p -inform p -outform d -out ff.d3 | ||
38 | $ if $severity .ne. 1 then exit 3 | ||
39 | $ | ||
40 | $! write sys$output "d -> t" | ||
41 | $! 'cmd' -in f.d -inform d -outform t -out ff.t1 | ||
42 | $! if $severity .ne. 1 then exit 3 | ||
43 | $! write sys$output "t -> t" | ||
44 | $! 'cmd' -in f.t -inform t -outform t -out ff.t2 | ||
45 | $! if $severity .ne. 1 then exit 3 | ||
46 | $! write sys$output "p -> t" | ||
47 | $! 'cmd' -in f.p -inform p -outform t -out ff.t3 | ||
48 | $! if $severity .ne. 1 then exit 3 | ||
49 | $ | ||
50 | $ write sys$output "d -> p" | ||
51 | $ 'cmd' -in f.d -inform d -outform p -out ff.p1 | ||
52 | $ if $severity .ne. 1 then exit 3 | ||
53 | $! write sys$output "t -> p" | ||
54 | $! 'cmd' -in f.t -inform t -outform p -out ff.p2 | ||
55 | $! if $severity .ne. 1 then exit 3 | ||
56 | $ write sys$output "p -> p" | ||
57 | $ 'cmd' -in f.p -inform p -outform p -out ff.p3 | ||
58 | $ if $severity .ne. 1 then exit 3 | ||
59 | $ | ||
60 | $ backup/compare fff.p f.p | ||
61 | $ if $severity .ne. 1 then exit 3 | ||
62 | $ backup/compare fff.p ff.p1 | ||
63 | $ if $severity .ne. 1 then exit 3 | ||
64 | $! backup/compare fff.p ff.p2 | ||
65 | $! if $severity .ne. 1 then exit 3 | ||
66 | $ backup/compare fff.p ff.p3 | ||
67 | $ if $severity .ne. 1 then exit 3 | ||
68 | $ | ||
69 | $! backup/compare f.t ff.t1 | ||
70 | $! if $severity .ne. 1 then exit 3 | ||
71 | $! backup/compare f.t ff.t2 | ||
72 | $! if $severity .ne. 1 then exit 3 | ||
73 | $! backup/compare f.t ff.t3 | ||
74 | $! if $severity .ne. 1 then exit 3 | ||
75 | $ | ||
76 | $ backup/compare f.p ff.p1 | ||
77 | $ if $severity .ne. 1 then exit 3 | ||
78 | $! backup/compare f.p ff.p2 | ||
79 | $! if $severity .ne. 1 then exit 3 | ||
80 | $ backup/compare f.p ff.p3 | ||
81 | $ if $severity .ne. 1 then exit 3 | ||
82 | $ | ||
83 | $ delete f.*;*,ff.*;*,fff.*;* | ||
diff --git a/src/lib/libssl/test/test.cnf b/src/lib/libssl/test/test.cnf new file mode 100644 index 0000000000..faad3914a8 --- /dev/null +++ b/src/lib/libssl/test/test.cnf | |||
@@ -0,0 +1,88 @@ | |||
1 | # | ||
2 | # SSLeay example configuration file. | ||
3 | # This is mostly being used for generation of certificate requests. | ||
4 | # | ||
5 | |||
6 | RANDFILE = ./.rnd | ||
7 | |||
8 | #################################################################### | ||
9 | [ ca ] | ||
10 | default_ca = CA_default # The default ca section | ||
11 | |||
12 | #################################################################### | ||
13 | [ CA_default ] | ||
14 | |||
15 | dir = ./demoCA # Where everything is kept | ||
16 | certs = $dir/certs # Where the issued certs are kept | ||
17 | crl_dir = $dir/crl # Where the issued crl are kept | ||
18 | database = $dir/index.txt # database index file. | ||
19 | new_certs_dir = $dir/new_certs # default place for new certs. | ||
20 | |||
21 | certificate = $dir/CAcert.pem # The CA certificate | ||
22 | serial = $dir/serial # The current serial number | ||
23 | crl = $dir/crl.pem # The current CRL | ||
24 | private_key = $dir/private/CAkey.pem# The private key | ||
25 | RANDFILE = $dir/private/.rand # private random number file | ||
26 | |||
27 | default_days = 365 # how long to certify for | ||
28 | default_crl_days= 30 # how long before next CRL | ||
29 | default_md = md5 # which md to use. | ||
30 | |||
31 | # A few difference way of specifying how similar the request should look | ||
32 | # For type CA, the listed attributes must be the same, and the optional | ||
33 | # and supplied fields are just that :-) | ||
34 | policy = policy_match | ||
35 | |||
36 | # For the CA policy | ||
37 | [ policy_match ] | ||
38 | countryName = match | ||
39 | stateOrProvinceName = match | ||
40 | organizationName = match | ||
41 | organizationalUnitName = optional | ||
42 | commonName = supplied | ||
43 | emailAddress = optional | ||
44 | |||
45 | # For the 'anything' policy | ||
46 | # At this point in time, you must list all acceptable 'object' | ||
47 | # types. | ||
48 | [ policy_anything ] | ||
49 | countryName = optional | ||
50 | stateOrProvinceName = optional | ||
51 | localityName = optional | ||
52 | organizationName = optional | ||
53 | organizationalUnitName = optional | ||
54 | commonName = supplied | ||
55 | emailAddress = optional | ||
56 | |||
57 | #################################################################### | ||
58 | [ req ] | ||
59 | default_bits = 512 | ||
60 | default_keyfile = testkey.pem | ||
61 | distinguished_name = req_distinguished_name | ||
62 | encrypt_rsa_key = no | ||
63 | |||
64 | [ req_distinguished_name ] | ||
65 | countryName = Country Name (2 letter code) | ||
66 | countryName_default = AU | ||
67 | countryName_value = AU | ||
68 | |||
69 | stateOrProvinceName = State or Province Name (full name) | ||
70 | stateOrProvinceName_default = Queensland | ||
71 | stateOrProvinceName_value = | ||
72 | |||
73 | localityName = Locality Name (eg, city) | ||
74 | localityName_value = Brisbane | ||
75 | |||
76 | organizationName = Organization Name (eg, company) | ||
77 | organizationName_default = | ||
78 | organizationName_value = CryptSoft Pty Ltd | ||
79 | |||
80 | organizationalUnitName = Organizational Unit Name (eg, section) | ||
81 | organizationalUnitName_default = | ||
82 | organizationalUnitName_value = . | ||
83 | |||
84 | commonName = Common Name (eg, YOUR name) | ||
85 | commonName_value = Eric Young | ||
86 | |||
87 | emailAddress = Email Address | ||
88 | emailAddress_value = eay@mincom.oz.au | ||
diff --git a/src/lib/libssl/test/testca b/src/lib/libssl/test/testca new file mode 100644 index 0000000000..5b2faa78f1 --- /dev/null +++ b/src/lib/libssl/test/testca | |||
@@ -0,0 +1,51 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | SH="/bin/sh" | ||
4 | if test "$OSTYPE" = msdosdjgpp; then | ||
5 | PATH=./apps\;../apps\;$PATH | ||
6 | else | ||
7 | PATH=../apps:$PATH | ||
8 | fi | ||
9 | export SH PATH | ||
10 | |||
11 | SSLEAY_CONFIG="-config CAss.cnf" | ||
12 | export SSLEAY_CONFIG | ||
13 | |||
14 | OPENSSL="`pwd`/../util/shlib_wrap.sh openssl" | ||
15 | export OPENSSL | ||
16 | |||
17 | /bin/rm -fr demoCA | ||
18 | $SH ../apps/CA.sh -newca <<EOF | ||
19 | EOF | ||
20 | |||
21 | if [ $? != 0 ]; then | ||
22 | exit 1; | ||
23 | fi | ||
24 | |||
25 | SSLEAY_CONFIG="-config Uss.cnf" | ||
26 | export SSLEAY_CONFIG | ||
27 | $SH ../apps/CA.sh -newreq | ||
28 | if [ $? != 0 ]; then | ||
29 | exit 1; | ||
30 | fi | ||
31 | |||
32 | |||
33 | SSLEAY_CONFIG="-config ../apps/openssl.cnf" | ||
34 | export SSLEAY_CONFIG | ||
35 | $SH ../apps/CA.sh -sign <<EOF | ||
36 | y | ||
37 | y | ||
38 | EOF | ||
39 | if [ $? != 0 ]; then | ||
40 | exit 1; | ||
41 | fi | ||
42 | |||
43 | |||
44 | $SH ../apps/CA.sh -verify newcert.pem | ||
45 | if [ $? != 0 ]; then | ||
46 | exit 1; | ||
47 | fi | ||
48 | |||
49 | /bin/rm -fr demoCA newcert.pem newreq.pem | ||
50 | #usage: CA -newcert|-newreq|-newca|-sign|-verify | ||
51 | |||
diff --git a/src/lib/libssl/test/testca.com b/src/lib/libssl/test/testca.com new file mode 100644 index 0000000000..c670f2bf5f --- /dev/null +++ b/src/lib/libssl/test/testca.com | |||
@@ -0,0 +1,78 @@ | |||
1 | $! TESTCA.COM | ||
2 | $ | ||
3 | $ __arch := VAX | ||
4 | $ if f$getsyi("cpu") .ge. 128 then __arch := AXP | ||
5 | $ exe_dir := sys$disk:[-.'__arch'.exe.apps] | ||
6 | $ | ||
7 | $ openssl := mcr 'exe_dir'openssl | ||
8 | $ | ||
9 | $ SSLEAY_CONFIG="-config ""CAss.cnf""" | ||
10 | $ | ||
11 | $ set noon | ||
12 | $ if f$search("demoCA.dir") .nes. "" | ||
13 | $ then | ||
14 | $ call deltree [.demoCA]*.* | ||
15 | $ set file/prot=(S:RWED,O:RWED,G:RWED,W:RWED) demoCA.dir;* | ||
16 | $ delete demoCA.dir;* | ||
17 | $ endif | ||
18 | $ set on | ||
19 | $ open/read sys$ca_input VMSca-response.1 | ||
20 | $ @[-.apps]CA.com -input sys$ca_input -newca | ||
21 | $ close sys$ca_input | ||
22 | $ if $severity .ne. 1 then exit 3 | ||
23 | $ | ||
24 | $ | ||
25 | $ SSLEAY_CONFIG="-config ""Uss.cnf""" | ||
26 | $ @[-.apps]CA.com -newreq | ||
27 | $ if $severity .ne. 1 then exit 3 | ||
28 | $ | ||
29 | $ | ||
30 | $ SSLEAY_CONFIG="-config [-.apps]openssl-vms.cnf" | ||
31 | $ open/read sys$ca_input VMSca-response.2 | ||
32 | $ @[-.apps]CA.com -input sys$ca_input -sign | ||
33 | $ close sys$ca_input | ||
34 | $ if $severity .ne. 1 then exit 3 | ||
35 | $ | ||
36 | $ | ||
37 | $ @[-.apps]CA.com -verify newcert.pem | ||
38 | $ if $severity .ne. 1 then exit 3 | ||
39 | $ | ||
40 | $ set noon | ||
41 | $ call deltree [.demoCA]*.* | ||
42 | $ set file/prot=(S:RWED,O:RWED,G:RWED,W:RWED) demoCA.dir;* | ||
43 | $ delete demoCA.dir;* | ||
44 | $ if f$search("newcert.pem") .nes. "" then delete newcert.pem;* | ||
45 | $ if f$search("newcert.pem") .nes. "" then delete newreq.pem;* | ||
46 | $ set on | ||
47 | $! #usage: CA -newcert|-newreq|-newca|-sign|-verify | ||
48 | $ | ||
49 | $ exit | ||
50 | $ | ||
51 | $ deltree: subroutine ! P1 is a name of a directory | ||
52 | $ on control_y then goto dt_STOP | ||
53 | $ on warning then goto dt_exit | ||
54 | $ _dt_def = f$trnlnm("SYS$DISK")+f$directory() | ||
55 | $ if f$parse(p1) .eqs. "" then exit | ||
56 | $ set default 'f$parse(p1,,,"DEVICE")''f$parse(p1,,,"DIRECTORY")' | ||
57 | $ p1 = f$parse(p1,,,"NAME") + f$parse(p1,,,"TYPE") | ||
58 | $ _fp = f$parse(".DIR",p1) | ||
59 | $ dt_loop: | ||
60 | $ _f = f$search(_fp) | ||
61 | $ if _f .eqs. "" then goto dt_loopend | ||
62 | $ call deltree [.'f$parse(_f,,,"NAME")']*.* | ||
63 | $ goto dt_loop | ||
64 | $ dt_loopend: | ||
65 | $ _fp = f$parse(p1,".;*") | ||
66 | $ if f$search(_fp) .eqs. "" then goto dt_exit | ||
67 | $ set noon | ||
68 | $ set file/prot=(S:RWED,O:RWED,G:RWED,W:RWED) '_fp' | ||
69 | $ set on | ||
70 | $ delete/nolog '_fp' | ||
71 | $ dt_exit: | ||
72 | $ set default '_dt_def' | ||
73 | $ exit | ||
74 | $ dt_STOP: | ||
75 | $ set default '_dt_def' | ||
76 | $ stop/id="" | ||
77 | $ exit | ||
78 | $ endsubroutine | ||
diff --git a/src/lib/libssl/test/testcrl.pem b/src/lib/libssl/test/testcrl.pem new file mode 100644 index 0000000000..0989788354 --- /dev/null +++ b/src/lib/libssl/test/testcrl.pem | |||
@@ -0,0 +1,16 @@ | |||
1 | -----BEGIN X509 CRL----- | ||
2 | MIICjTCCAfowDQYJKoZIhvcNAQECBQAwXzELMAkGA1UEBhMCVVMxIDAeBgNVBAoT | ||
3 | F1JTQSBEYXRhIFNlY3VyaXR5LCBJbmMuMS4wLAYDVQQLEyVTZWN1cmUgU2VydmVy | ||
4 | IENlcnRpZmljYXRpb24gQXV0aG9yaXR5Fw05NTA1MDIwMjEyMjZaFw05NTA2MDEw | ||
5 | MDAxNDlaMIIBaDAWAgUCQQAABBcNOTUwMjAxMTcyNDI2WjAWAgUCQQAACRcNOTUw | ||
6 | MjEwMDIxNjM5WjAWAgUCQQAADxcNOTUwMjI0MDAxMjQ5WjAWAgUCQQAADBcNOTUw | ||
7 | MjI1MDA0NjQ0WjAWAgUCQQAAGxcNOTUwMzEzMTg0MDQ5WjAWAgUCQQAAFhcNOTUw | ||
8 | MzE1MTkxNjU0WjAWAgUCQQAAGhcNOTUwMzE1MTk0MDQxWjAWAgUCQQAAHxcNOTUw | ||
9 | MzI0MTk0NDMzWjAWAgUCcgAABRcNOTUwMzI5MjAwNzExWjAWAgUCcgAAERcNOTUw | ||
10 | MzMwMDIzNDI2WjAWAgUCQQAAIBcNOTUwNDA3MDExMzIxWjAWAgUCcgAAHhcNOTUw | ||
11 | NDA4MDAwMjU5WjAWAgUCcgAAQRcNOTUwNDI4MTcxNzI0WjAWAgUCcgAAOBcNOTUw | ||
12 | NDI4MTcyNzIxWjAWAgUCcgAATBcNOTUwNTAyMDIxMjI2WjANBgkqhkiG9w0BAQIF | ||
13 | AAN+AHqOEJXSDejYy0UwxxrH/9+N2z5xu/if0J6qQmK92W0hW158wpJg+ovV3+wQ | ||
14 | wvIEPRL2rocL0tKfAsVq1IawSJzSNgxG0lrcla3MrJBnZ4GaZDu4FutZh72MR3Gt | ||
15 | JaAL3iTJHJD55kK2D/VoyY1djlsPuNh6AEgdVwFAyp0v | ||
16 | -----END X509 CRL----- | ||
diff --git a/src/lib/libssl/test/testenc b/src/lib/libssl/test/testenc new file mode 100644 index 0000000000..4571ea2875 --- /dev/null +++ b/src/lib/libssl/test/testenc | |||
@@ -0,0 +1,54 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | testsrc=Makefile | ||
4 | test=./p | ||
5 | cmd="../util/shlib_wrap.sh ../apps/openssl" | ||
6 | |||
7 | cat $testsrc >$test; | ||
8 | |||
9 | echo cat | ||
10 | $cmd enc -non-fips-allow < $test > $test.cipher | ||
11 | $cmd enc -non-fips-allow < $test.cipher >$test.clear | ||
12 | cmp $test $test.clear | ||
13 | if [ $? != 0 ] | ||
14 | then | ||
15 | exit 1 | ||
16 | else | ||
17 | /bin/rm $test.cipher $test.clear | ||
18 | fi | ||
19 | echo base64 | ||
20 | $cmd enc -non-fips-allow -a -e < $test > $test.cipher | ||
21 | $cmd enc -non-fips-allow -a -d < $test.cipher >$test.clear | ||
22 | cmp $test $test.clear | ||
23 | if [ $? != 0 ] | ||
24 | then | ||
25 | exit 1 | ||
26 | else | ||
27 | /bin/rm $test.cipher $test.clear | ||
28 | fi | ||
29 | |||
30 | for i in `$cmd list-cipher-commands` | ||
31 | do | ||
32 | echo $i | ||
33 | $cmd $i -non-fips-allow -bufsize 113 -e -k test < $test > $test.$i.cipher | ||
34 | $cmd $i -non-fips-allow -bufsize 157 -d -k test < $test.$i.cipher >$test.$i.clear | ||
35 | cmp $test $test.$i.clear | ||
36 | if [ $? != 0 ] | ||
37 | then | ||
38 | exit 1 | ||
39 | else | ||
40 | /bin/rm $test.$i.cipher $test.$i.clear | ||
41 | fi | ||
42 | |||
43 | echo $i base64 | ||
44 | $cmd $i -non-fips-allow -bufsize 113 -a -e -k test < $test > $test.$i.cipher | ||
45 | $cmd $i -non-fips-allow -bufsize 157 -a -d -k test < $test.$i.cipher >$test.$i.clear | ||
46 | cmp $test $test.$i.clear | ||
47 | if [ $? != 0 ] | ||
48 | then | ||
49 | exit 1 | ||
50 | else | ||
51 | /bin/rm $test.$i.cipher $test.$i.clear | ||
52 | fi | ||
53 | done | ||
54 | rm -f $test | ||
diff --git a/src/lib/libssl/test/testenc.com b/src/lib/libssl/test/testenc.com new file mode 100644 index 0000000000..5e6f521f9d --- /dev/null +++ b/src/lib/libssl/test/testenc.com | |||
@@ -0,0 +1,62 @@ | |||
1 | $! TESTENC.COM -- Test encoding and decoding | ||
2 | $ | ||
3 | $ __arch := VAX | ||
4 | $ if f$getsyi("cpu") .ge. 128 then __arch := AXP | ||
5 | $ exe_dir := sys$disk:[-.'__arch'.exe.apps] | ||
6 | $ | ||
7 | $ testsrc := makefile. | ||
8 | $ test := p.txt | ||
9 | $ cmd := mcr 'exe_dir'openssl | ||
10 | $ | ||
11 | $ if f$search(test) .nes. "" then delete 'test';* | ||
12 | $ convert/fdl=sys$input: 'testsrc' 'test' | ||
13 | RECORD | ||
14 | FORMAT STREAM_LF | ||
15 | $ | ||
16 | $ if f$search(test+"-cipher") .nes. "" then delete 'test'-cipher;* | ||
17 | $ if f$search(test+"-clear") .nes. "" then delete 'test'-clear;* | ||
18 | $ | ||
19 | $ write sys$output "cat" | ||
20 | $ 'cmd' enc -in 'test' -out 'test'-cipher | ||
21 | $ 'cmd' enc -in 'test'-cipher -out 'test'-clear | ||
22 | $ backup/compare 'test' 'test'-clear | ||
23 | $ if $severity .ne. 1 then exit 3 | ||
24 | $ delete 'test'-cipher;*,'test'-clear;* | ||
25 | $ | ||
26 | $ write sys$output "base64" | ||
27 | $ 'cmd' enc -a -e -in 'test' -out 'test'-cipher | ||
28 | $ 'cmd' enc -a -d -in 'test'-cipher -out 'test'-clear | ||
29 | $ backup/compare 'test' 'test'-clear | ||
30 | $ if $severity .ne. 1 then exit 3 | ||
31 | $ delete 'test'-cipher;*,'test'-clear;* | ||
32 | $ | ||
33 | $ define/user sys$output 'test'-cipher-commands | ||
34 | $ 'cmd' list-cipher-commands | ||
35 | $ open/read f 'test'-cipher-commands | ||
36 | $ loop_cipher_commands: | ||
37 | $ read/end=loop_cipher_commands_end f i | ||
38 | $ write sys$output i | ||
39 | $ | ||
40 | $ if f$search(test+"-"+i+"-cipher") .nes. "" then - | ||
41 | delete 'test'-'i'-cipher;* | ||
42 | $ if f$search(test+"-"+i+"-clear") .nes. "" then - | ||
43 | delete 'test'-'i'-clear;* | ||
44 | $ | ||
45 | $ 'cmd' 'i' -bufsize 113 -e -k test -in 'test' -out 'test'-'i'-cipher | ||
46 | $ 'cmd' 'i' -bufsize 157 -d -k test -in 'test'-'i'-cipher -out 'test'-'i'-clear | ||
47 | $ backup/compare 'test' 'test'-'i'-clear | ||
48 | $ if $severity .ne. 1 then exit 3 | ||
49 | $ delete 'test'-'i'-cipher;*,'test'-'i'-clear;* | ||
50 | $ | ||
51 | $ write sys$output i," base64" | ||
52 | $ 'cmd' 'i' -bufsize 113 -a -e -k test -in 'test' -out 'test'-'i'-cipher | ||
53 | $ 'cmd' 'i' -bufsize 157 -a -d -k test -in 'test'-'i'-cipher -out 'test'-'i'-clear | ||
54 | $ backup/compare 'test' 'test'-'i'-clear | ||
55 | $ if $severity .ne. 1 then exit 3 | ||
56 | $ delete 'test'-'i'-cipher;*,'test'-'i'-clear;* | ||
57 | $ | ||
58 | $ goto loop_cipher_commands | ||
59 | $ loop_cipher_commands_end: | ||
60 | $ close f | ||
61 | $ delete 'test'-cipher-commands;* | ||
62 | $ delete 'test';* | ||
diff --git a/src/lib/libssl/test/testfipsssl b/src/lib/libssl/test/testfipsssl new file mode 100644 index 0000000000..c4836edc25 --- /dev/null +++ b/src/lib/libssl/test/testfipsssl | |||
@@ -0,0 +1,113 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | if [ "$1" = "" ]; then | ||
4 | key=../apps/server.pem | ||
5 | else | ||
6 | key="$1" | ||
7 | fi | ||
8 | if [ "$2" = "" ]; then | ||
9 | cert=../apps/server.pem | ||
10 | else | ||
11 | cert="$2" | ||
12 | fi | ||
13 | |||
14 | ciphers="DHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:AES256-SHA:EDH-RSA-DES-CBC3-SHA:EDH-DSS-DES-CBC3-SHA:DES-CBC3-SHA:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA:AES128-SHA:EXP1024-DHE-DSS-DES-CBC-SHA:EXP1024-DES-CBC-SHA:EDH-RSA-DES-CBC-SHA:EDH-DSS-DES-CBC-SHA:DES-CBC-SHA:EXP-EDH-RSA-DES-CBC-SHA:EXP-EDH-DSS-DES-CBC-SHA:EXP-DES-CBC-SHA" | ||
15 | |||
16 | ssltest="../util/shlib_wrap.sh ./ssltest -F -key $key -cert $cert -c_key $key -c_cert $cert -cipher $ciphers" | ||
17 | |||
18 | if ../util/shlib_wrap.sh ../apps/openssl x509 -in $cert -text -noout | fgrep 'DSA Public Key' >/dev/null; then | ||
19 | dsa_cert=YES | ||
20 | else | ||
21 | dsa_cert=NO | ||
22 | fi | ||
23 | |||
24 | if [ "$3" = "" ]; then | ||
25 | CA="-CApath ../certs" | ||
26 | else | ||
27 | CA="-CAfile $3" | ||
28 | fi | ||
29 | |||
30 | if [ "$4" = "" ]; then | ||
31 | extra="" | ||
32 | else | ||
33 | extra="$4" | ||
34 | fi | ||
35 | |||
36 | ############################################################################# | ||
37 | |||
38 | echo test ssl3 is forbidden in FIPS mode | ||
39 | $ssltest -ssl3 $extra && exit 1 | ||
40 | |||
41 | echo test ssl2 is forbidden in FIPS mode | ||
42 | $ssltest -ssl2 $extra && exit 1 | ||
43 | |||
44 | echo test tls1 | ||
45 | $ssltest -tls1 $extra || exit 1 | ||
46 | |||
47 | echo test tls1 with server authentication | ||
48 | $ssltest -tls1 -server_auth $CA $extra || exit 1 | ||
49 | |||
50 | echo test tls1 with client authentication | ||
51 | $ssltest -tls1 -client_auth $CA $extra || exit 1 | ||
52 | |||
53 | echo test tls1 with both client and server authentication | ||
54 | $ssltest -tls1 -server_auth -client_auth $CA $extra || exit 1 | ||
55 | |||
56 | echo test tls1 via BIO pair | ||
57 | $ssltest -bio_pair -tls1 $extra || exit 1 | ||
58 | |||
59 | echo test tls1 with server authentication via BIO pair | ||
60 | $ssltest -bio_pair -tls1 -server_auth $CA $extra || exit 1 | ||
61 | |||
62 | echo test tls1 with client authentication via BIO pair | ||
63 | $ssltest -bio_pair -tls1 -client_auth $CA $extra || exit 1 | ||
64 | |||
65 | echo test tls1 with both client and server authentication via BIO pair | ||
66 | $ssltest -bio_pair -tls1 -server_auth -client_auth $CA $extra || exit 1 | ||
67 | |||
68 | # note that all the below actually choose TLS... | ||
69 | |||
70 | if [ $dsa_cert = NO ]; then | ||
71 | echo test sslv2/sslv3 w/o DHE via BIO pair | ||
72 | $ssltest -bio_pair -no_dhe $extra || exit 1 | ||
73 | fi | ||
74 | |||
75 | echo test sslv2/sslv3 with 1024bit DHE via BIO pair | ||
76 | $ssltest -bio_pair -dhe1024dsa -v $extra || exit 1 | ||
77 | |||
78 | echo test sslv2/sslv3 with server authentication | ||
79 | $ssltest -bio_pair -server_auth $CA $extra || exit 1 | ||
80 | |||
81 | echo test sslv2/sslv3 with client authentication via BIO pair | ||
82 | $ssltest -bio_pair -client_auth $CA $extra || exit 1 | ||
83 | |||
84 | echo test sslv2/sslv3 with both client and server authentication via BIO pair | ||
85 | $ssltest -bio_pair -server_auth -client_auth $CA $extra || exit 1 | ||
86 | |||
87 | echo test sslv2/sslv3 with both client and server authentication via BIO pair and app verify | ||
88 | $ssltest -bio_pair -server_auth -client_auth -app_verify $CA $extra || exit 1 | ||
89 | |||
90 | ############################################################################# | ||
91 | |||
92 | if ../util/shlib_wrap.sh ../apps/openssl no-dh; then | ||
93 | echo skipping anonymous DH tests | ||
94 | else | ||
95 | echo test tls1 with 1024bit anonymous DH, multiple handshakes | ||
96 | $ssltest -v -bio_pair -tls1 -cipher ADH -dhe1024dsa -num 10 -f -time $extra || exit 1 | ||
97 | fi | ||
98 | |||
99 | if ../util/shlib_wrap.sh ../apps/openssl no-rsa; then | ||
100 | echo skipping RSA tests | ||
101 | else | ||
102 | echo test tls1 with 1024bit RSA, no DHE, multiple handshakes | ||
103 | ../util/shlib_wrap.sh ./ssltest -v -bio_pair -tls1 -cert ../apps/server2.pem -no_dhe -num 10 -f -time $extra || exit 1 | ||
104 | |||
105 | if ../util/shlib_wrap.sh ../apps/openssl no-dh; then | ||
106 | echo skipping RSA+DHE tests | ||
107 | else | ||
108 | echo test tls1 with 1024bit RSA, 1024bit DHE, multiple handshakes | ||
109 | ../util/shlib_wrap.sh ./ssltest -v -bio_pair -tls1 -cert ../apps/server2.pem -dhe1024dsa -num 10 -f -time $extra || exit 1 | ||
110 | fi | ||
111 | fi | ||
112 | |||
113 | exit 0 | ||
diff --git a/src/lib/libssl/test/testgen b/src/lib/libssl/test/testgen new file mode 100644 index 0000000000..524c0d134c --- /dev/null +++ b/src/lib/libssl/test/testgen | |||
@@ -0,0 +1,44 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | T=testcert | ||
4 | KEY=512 | ||
5 | CA=../certs/testca.pem | ||
6 | |||
7 | /bin/rm -f $T.1 $T.2 $T.key | ||
8 | |||
9 | if test "$OSTYPE" = msdosdjgpp; then | ||
10 | PATH=../apps\;$PATH; | ||
11 | else | ||
12 | PATH=../apps:$PATH; | ||
13 | fi | ||
14 | export PATH | ||
15 | |||
16 | echo "generating certificate request" | ||
17 | |||
18 | echo "string to make the random number generator think it has entropy" >> ./.rnd | ||
19 | |||
20 | if ../util/shlib_wrap.sh ../apps/openssl no-rsa; then | ||
21 | req_new='-newkey dsa:../apps/dsa512.pem' | ||
22 | else | ||
23 | req_new='-new' | ||
24 | echo "There should be a 2 sequences of .'s and some +'s." | ||
25 | echo "There should not be more that at most 80 per line" | ||
26 | fi | ||
27 | |||
28 | echo "This could take some time." | ||
29 | |||
30 | rm -f testkey.pem testreq.pem | ||
31 | |||
32 | ../util/shlib_wrap.sh ../apps/openssl req -config test.cnf $req_new -out testreq.pem | ||
33 | if [ $? != 0 ]; then | ||
34 | echo problems creating request | ||
35 | exit 1 | ||
36 | fi | ||
37 | |||
38 | ../util/shlib_wrap.sh ../apps/openssl req -config test.cnf -verify -in testreq.pem -noout | ||
39 | if [ $? != 0 ]; then | ||
40 | echo signature on req is wrong | ||
41 | exit 1 | ||
42 | fi | ||
43 | |||
44 | exit 0 | ||
diff --git a/src/lib/libssl/test/testgen.com b/src/lib/libssl/test/testgen.com new file mode 100644 index 0000000000..5d28ebec72 --- /dev/null +++ b/src/lib/libssl/test/testgen.com | |||
@@ -0,0 +1,52 @@ | |||
1 | $! TETSGEN.COM | ||
2 | $ | ||
3 | $ __arch := VAX | ||
4 | $ if f$getsyi("cpu") .ge. 128 then __arch := AXP | ||
5 | $ exe_dir := sys$disk:[-.'__arch'.exe.apps] | ||
6 | $ | ||
7 | $ T := testcert | ||
8 | $ KEY = 512 | ||
9 | $ CA := [-.certs]testca.pem | ||
10 | $ | ||
11 | $ set noon | ||
12 | $ if f$search(T+".1;*") .nes. "" then delete 'T'.1;* | ||
13 | $ if f$search(T+".2;*") .nes. "" then delete 'T'.2;* | ||
14 | $ if f$search(T+".key;*") .nes. "" then delete 'T'.key;* | ||
15 | $ set on | ||
16 | $ | ||
17 | $ write sys$output "generating certificate request" | ||
18 | $ | ||
19 | $ append/new nl: .rnd | ||
20 | $ open/append random_file .rnd | ||
21 | $ write random_file "string to make the random number generator think it has entropy" | ||
22 | $ close random_file | ||
23 | $ | ||
24 | $ set noon | ||
25 | $ define/user sys$output nla0: | ||
26 | $ mcr 'exe_dir'openssl no-rsa | ||
27 | $ save_severity=$SEVERITY | ||
28 | $ set on | ||
29 | $ if save_severity | ||
30 | $ then | ||
31 | $ req_new="-newkey dsa:[-.apps]dsa512.pem" | ||
32 | $ else | ||
33 | $ req_new="-new" | ||
34 | $ write sys$output "There should be a 2 sequences of .'s and some +'s." | ||
35 | $ write sys$output "There should not be more that at most 80 per line" | ||
36 | $ endif | ||
37 | $ | ||
38 | $ write sys$output "This could take some time." | ||
39 | $ | ||
40 | $ mcr 'exe_dir'openssl req -config test.cnf 'req_new' -out testreq.pem | ||
41 | $ if $severity .ne. 1 | ||
42 | $ then | ||
43 | $ write sys$output "problems creating request" | ||
44 | $ exit 3 | ||
45 | $ endif | ||
46 | $ | ||
47 | $ mcr 'exe_dir'openssl req -config test.cnf -verify -in testreq.pem -noout | ||
48 | $ if $severity .ne. 1 | ||
49 | $ then | ||
50 | $ write sys$output "signature on req is wrong" | ||
51 | $ exit 3 | ||
52 | $ endif | ||
diff --git a/src/lib/libssl/test/testp7.pem b/src/lib/libssl/test/testp7.pem new file mode 100644 index 0000000000..e5b7866c31 --- /dev/null +++ b/src/lib/libssl/test/testp7.pem | |||
@@ -0,0 +1,46 @@ | |||
1 | -----BEGIN PKCS7----- | ||
2 | MIIIGAYJKoZIhvcNAQcCoIIICTCCCAUCAQExADALBgkqhkiG9w0BBwGgggY8MIIE | ||
3 | cjCCBBygAwIBAgIQeS+OJfWJUZAx6cX0eAiMjzANBgkqhkiG9w0BAQQFADBiMREw | ||
4 | DwYDVQQHEwhJbnRlcm5ldDEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xNDAyBgNV | ||
5 | BAsTK1ZlcmlTaWduIENsYXNzIDEgQ0EgLSBJbmRpdmlkdWFsIFN1YnNjcmliZXIw | ||
6 | HhcNOTYwNzE5MDAwMDAwWhcNOTcwMzMwMjM1OTU5WjCB1TERMA8GA1UEBxMISW50 | ||
7 | ZXJuZXQxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTQwMgYDVQQLEytWZXJpU2ln | ||
8 | biBDbGFzcyAxIENBIC0gSW5kaXZpZHVhbCBTdWJzY3JpYmVyMSgwJgYDVQQLEx9E | ||
9 | aWdpdGFsIElEIENsYXNzIDEgLSBTTUlNRSBUZXN0MUcwRQYDVQQLEz53d3cudmVy | ||
10 | aXNpZ24uY29tL3JlcG9zaXRvcnkvQ1BTLTEuMCBJbmMuIGJ5IFJlZi4sTElBQi5M | ||
11 | VEQoYyk5NjBbMA0GCSqGSIb3DQEBAQUAA0oAMEcCQA7LvHEIAiQ5+4gDYvJGnGAq | ||
12 | UM5GXyG11diEXmIEZTHUZhorooX5sr8IIjSXiPY59YYUFSvAaharFM1xaBN8zNEC | ||
13 | AwEAAaOCAjkwggI1MAkGA1UdEwQCMAAwggImBgNVHQMEggIdMIICGTCCAhUwggIR | ||
14 | BgtghkgBhvhFAQcBATCCAgAWggGrVGhpcyBjZXJ0aWZpY2F0ZSBpbmNvcnBvcmF0 | ||
15 | ZXMgYnkgcmVmZXJlbmNlLCBhbmQgaXRzIHVzZSBpcyBzdHJpY3RseSBzdWJqZWN0 | ||
16 | IHRvLCB0aGUgVmVyaVNpZ24gQ2VydGlmaWNhdGlvbiBQcmFjdGljZSBTdGF0ZW1l | ||
17 | bnQgKENQUyksIGF2YWlsYWJsZSBhdDogaHR0cHM6Ly93d3cudmVyaXNpZ24uY29t | ||
18 | L0NQUy0xLjA7IGJ5IEUtbWFpbCBhdCBDUFMtcmVxdWVzdHNAdmVyaXNpZ24uY29t | ||
19 | OyBvciBieSBtYWlsIGF0IFZlcmlTaWduLCBJbmMuLCAyNTkzIENvYXN0IEF2ZS4s | ||
20 | IE1vdW50YWluIFZpZXcsIENBIDk0MDQzIFVTQSBUZWwuICsxICg0MTUpIDk2MS04 | ||
21 | ODMwIENvcHlyaWdodCAoYykgMTk5NiBWZXJpU2lnbiwgSW5jLiAgQWxsIFJpZ2h0 | ||
22 | cyBSZXNlcnZlZC4gQ0VSVEFJTiBXQVJSQU5USUVTIERJU0NMQUlNRUQgYW5kIExJ | ||
23 | QUJJTElUWSBMSU1JVEVELqAOBgxghkgBhvhFAQcBAQGhDgYMYIZIAYb4RQEHAQEC | ||
24 | MC8wLRYraHR0cHM6Ly93d3cudmVyaXNpZ24uY29tL3JlcG9zaXRvcnkvQ1BTLTEu | ||
25 | AzANBgkqhkiG9w0BAQQFAANBAMCYDuSb/eIlYSxY31nZZTaCZkCSfHjlacMofExr | ||
26 | cF+A2yHoEuT+eCQkqM0pMNHXddUeoQ9RjV+VuMBNmm63DUYwggHCMIIBbKADAgEC | ||
27 | AhB8CYTq1bkRFJBYOd67cp9JMA0GCSqGSIb3DQEBAgUAMD4xCzAJBgNVBAYTAlVT | ||
28 | MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjEWMBQGA1UECxMNVEVTVCBSb290IFBD | ||
29 | QTAeFw05NjA3MTcwMDAwMDBaFw05NzA3MTcyMzU5NTlaMGIxETAPBgNVBAcTCElu | ||
30 | dGVybmV0MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE0MDIGA1UECxMrVmVyaVNp | ||
31 | Z24gQ2xhc3MgMSBDQSAtIEluZGl2aWR1YWwgU3Vic2NyaWJlcjBcMA0GCSqGSIb3 | ||
32 | DQEBAQUAA0sAMEgCQQDsVzrNgnDhbAJZrWeLd9g1vMZJA2W67D33TTbga6yMt+ES | ||
33 | TWEywhS6RNP+fzLGg7utinjH4tL60cXa0G27GDsLAgMBAAGjIjAgMAsGA1UdDwQE | ||
34 | AwIBBjARBglghkgBhvhCAQEEBAMCAgQwDQYJKoZIhvcNAQECBQADQQAUp6bRwkaD | ||
35 | 2d1MBs/mjUcgTI2fXVmW8tTm/Ud6OzUwpC3vYgybiOOA4f6mOC5dbyUHrLOsrihU | ||
36 | 47ZQ0Jo1DUfboYIBrTCBwTBtMA0GCSqGSIb3DQEBAgUAMD4xCzAJBgNVBAYTAlVT | ||
37 | MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjEWMBQGA1UECxMNVEVTVCBSb290IFBD | ||
38 | QRcNOTYwNzE3MTc0NDA5WhcNOTgwNzE3MDAwMDAwWjANBgkqhkiG9w0BAQIFAANB | ||
39 | AHitA0/xAukCjHzeh1AMT/l2oC68N+yFb+aJPHBBMxc6gG2MaKjBNwb5hcXUllMl | ||
40 | ExONA3ju10f7owIq3s3wx10wgeYwgZEwDQYJKoZIhvcNAQECBQAwYjERMA8GA1UE | ||
41 | BxMISW50ZXJuZXQxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTQwMgYDVQQLEytW | ||
42 | ZXJpU2lnbiBDbGFzcyAxIENBIC0gSW5kaXZpZHVhbCBTdWJzY3JpYmVyFw05NjA3 | ||
43 | MTcxNzU5MjlaFw05NzA3MTgwMDAwMDBaMA0GCSqGSIb3DQEBAgUAA0EAubVWYTsW | ||
44 | sQmste9f+UgMw8BkjDlM25fwQLrCfmmnLxjewey10kSROypUaJLb+r4oRALc0fG9 | ||
45 | XfZsaiiIgotQHjEA | ||
46 | -----END PKCS7----- | ||
diff --git a/src/lib/libssl/test/testreq2.pem b/src/lib/libssl/test/testreq2.pem new file mode 100644 index 0000000000..c3cdcffcbc --- /dev/null +++ b/src/lib/libssl/test/testreq2.pem | |||
@@ -0,0 +1,7 @@ | |||
1 | -----BEGIN CERTIFICATE REQUEST----- | ||
2 | MIHaMIGFAgEAMA4xDDAKBgNVBAMTA2NuNDBcMA0GCSqGSIb3DQEBAQUAA0sAMEgC | ||
3 | QQCQsnkyUGDY2R3mYoeTprFJKgWuJ3f1jUjlIuW5+wfAUoeMt35c4vcFZ2mIBpEG | ||
4 | DtzkNQN1kr2O9ldm9zYnYhyhAgMBAAGgEjAQBgorBgEEAYI3AgEOMQIwADANBgkq | ||
5 | hkiG9w0BAQQFAANBAAb2szZgVIxg3vK6kYLjGSBISyuzcXJ6IvuPW6M+yzi1Qgoi | ||
6 | gQhazHTJp91T8ItZEzUJGZSZl2e5iXlnffWB+/U= | ||
7 | -----END CERTIFICATE REQUEST----- | ||
diff --git a/src/lib/libssl/test/testrsa.pem b/src/lib/libssl/test/testrsa.pem new file mode 100644 index 0000000000..aad21067a8 --- /dev/null +++ b/src/lib/libssl/test/testrsa.pem | |||
@@ -0,0 +1,9 @@ | |||
1 | -----BEGIN RSA PRIVATE KEY----- | ||
2 | MIIBPAIBAAJBAKrbeqkuRk8VcRmWFmtP+LviMB3+6dizWW3DwaffznyHGAFwUJ/I | ||
3 | Tv0XtbsCyl3QoyKGhrOAy3RvPK5M38iuXT0CAwEAAQJAZ3cnzaHXM/bxGaR5CR1R | ||
4 | rD1qFBAVfoQFiOH9uPJgMaoAuoQEisPHVcZDKcOv4wEg6/TInAIXBnEigtqvRzuy | ||
5 | oQIhAPcgZzUq3yVooAaoov8UbXPxqHlwo6GBMqnv20xzkf6ZAiEAsP4BnIaQTM8S | ||
6 | mvcpHZwQJdmdHHkGKAs37Dfxi67HbkUCIQCeZGliHXFa071Fp06ZeWlR2ADonTZz | ||
7 | rJBhdTe0v5pCeQIhAIZfkiGgGBX4cIuuckzEm43g9WMUjxP/0GlK39vIyihxAiEA | ||
8 | mymehFRT0MvqW5xAKAx7Pgkt8HVKwVhc2LwGKHE0DZM= | ||
9 | -----END RSA PRIVATE KEY----- | ||
diff --git a/src/lib/libssl/test/tests.com b/src/lib/libssl/test/tests.com new file mode 100644 index 0000000000..07a3c7f16d --- /dev/null +++ b/src/lib/libssl/test/tests.com | |||
@@ -0,0 +1,246 @@ | |||
1 | $! TESTS.COM -- Performs the necessary tests | ||
2 | $! | ||
3 | $! P1 tests to be performed. Empty means all. | ||
4 | $ | ||
5 | $ __proc = f$element(0,";",f$environment("procedure")) | ||
6 | $ __here = f$parse(f$parse("A.;",__proc) - "A.;","[]A.;") - "A.;" | ||
7 | $ __save_default = f$environment("default") | ||
8 | $ __arch := VAX | ||
9 | $ if f$getsyi("cpu") .ge. 128 then __arch := AXP | ||
10 | $ texe_dir := sys$disk:[-.'__arch'.exe.test] | ||
11 | $ exe_dir := sys$disk:[-.'__arch'.exe.apps] | ||
12 | $ | ||
13 | $ set default '__here' | ||
14 | $ on control_y then goto exit | ||
15 | $ on error then goto exit | ||
16 | $ | ||
17 | $ if p1 .nes. "" | ||
18 | $ then | ||
19 | $ tests = p1 | ||
20 | $ else | ||
21 | $ tests := - | ||
22 | test_des,test_idea,test_sha,test_md4,test_md5,test_hmac,- | ||
23 | test_md2,test_mdc2,- | ||
24 | test_rmd,test_rc2,test_rc4,test_rc5,test_bf,test_cast,test_rd,- | ||
25 | test_rand,test_bn,test_ec,test_enc,test_x509,test_rsa,test_crl,test_sid,- | ||
26 | test_gen,test_req,test_pkcs7,test_verify,test_dh,test_dsa,- | ||
27 | test_ss,test_ca,test_engine,test_ssl,test_evp | ||
28 | $ endif | ||
29 | $ tests = f$edit(tests,"COLLAPSE") | ||
30 | $ | ||
31 | $ BNTEST := bntest | ||
32 | $ ECTEST := ectest | ||
33 | $ EXPTEST := exptest | ||
34 | $ IDEATEST := ideatest | ||
35 | $ SHATEST := shatest | ||
36 | $ SHA1TEST := sha1test | ||
37 | $ MDC2TEST := mdc2test | ||
38 | $ RMDTEST := rmdtest | ||
39 | $ MD2TEST := md2test | ||
40 | $ MD4TEST := md4test | ||
41 | $ MD5TEST := md5test | ||
42 | $ HMACTEST := hmactest | ||
43 | $ RC2TEST := rc2test | ||
44 | $ RC4TEST := rc4test | ||
45 | $ RC5TEST := rc5test | ||
46 | $ BFTEST := bftest | ||
47 | $ CASTTEST := casttest | ||
48 | $ DESTEST := destest | ||
49 | $ RANDTEST := randtest | ||
50 | $ DHTEST := dhtest | ||
51 | $ DSATEST := dsatest | ||
52 | $ METHTEST := methtest | ||
53 | $ SSLTEST := ssltest | ||
54 | $ RSATEST := rsa_test | ||
55 | $ ENGINETEST := enginetest | ||
56 | $ EVPTEST := evp_test | ||
57 | $ | ||
58 | $ tests_i = 0 | ||
59 | $ loop_tests: | ||
60 | $ tests_e = f$element(tests_i,",",tests) | ||
61 | $ tests_i = tests_i + 1 | ||
62 | $ if tests_e .eqs. "," then goto exit | ||
63 | $ gosub 'tests_e' | ||
64 | $ goto loop_tests | ||
65 | $ | ||
66 | $ test_evp: | ||
67 | $ mcr 'texe_dir''evptest' evptests.txt | ||
68 | $ return | ||
69 | $ test_des: | ||
70 | $ mcr 'texe_dir''destest' | ||
71 | $ return | ||
72 | $ test_idea: | ||
73 | $ mcr 'texe_dir''ideatest' | ||
74 | $ return | ||
75 | $ test_sha: | ||
76 | $ mcr 'texe_dir''shatest' | ||
77 | $ mcr 'texe_dir''sha1test' | ||
78 | $ return | ||
79 | $ test_mdc2: | ||
80 | $ mcr 'texe_dir''mdc2test' | ||
81 | $ return | ||
82 | $ test_md5: | ||
83 | $ mcr 'texe_dir''md5test' | ||
84 | $ return | ||
85 | $ test_md4: | ||
86 | $ mcr 'texe_dir''md4test' | ||
87 | $ return | ||
88 | $ test_hmac: | ||
89 | $ mcr 'texe_dir''hmactest' | ||
90 | $ return | ||
91 | $ test_md2: | ||
92 | $ mcr 'texe_dir''md2test' | ||
93 | $ return | ||
94 | $ test_rmd: | ||
95 | $ mcr 'texe_dir''rmdtest' | ||
96 | $ return | ||
97 | $ test_bf: | ||
98 | $ mcr 'texe_dir''bftest' | ||
99 | $ return | ||
100 | $ test_cast: | ||
101 | $ mcr 'texe_dir''casttest' | ||
102 | $ return | ||
103 | $ test_rc2: | ||
104 | $ mcr 'texe_dir''rc2test' | ||
105 | $ return | ||
106 | $ test_rc4: | ||
107 | $ mcr 'texe_dir''rc4test' | ||
108 | $ return | ||
109 | $ test_rc5: | ||
110 | $ mcr 'texe_dir''rc5test' | ||
111 | $ return | ||
112 | $ test_rand: | ||
113 | $ mcr 'texe_dir''randtest' | ||
114 | $ return | ||
115 | $ test_enc: | ||
116 | $ @testenc.com | ||
117 | $ return | ||
118 | $ test_x509: | ||
119 | $ define sys$error nla0: | ||
120 | $ write sys$output "test normal x509v1 certificate" | ||
121 | $ @tx509.com | ||
122 | $ write sys$output "test first x509v3 certificate" | ||
123 | $ @tx509.com v3-cert1.pem | ||
124 | $ write sys$output "test second x509v3 certificate" | ||
125 | $ @tx509.com v3-cert2.pem | ||
126 | $ deassign sys$error | ||
127 | $ return | ||
128 | $ test_rsa: | ||
129 | $ define sys$error nla0: | ||
130 | $ @trsa.com | ||
131 | $ deassign sys$error | ||
132 | $ mcr 'texe_dir''rsatest' | ||
133 | $ return | ||
134 | $ test_crl: | ||
135 | $ define sys$error nla0: | ||
136 | $ @tcrl.com | ||
137 | $ deassign sys$error | ||
138 | $ return | ||
139 | $ test_sid: | ||
140 | $ define sys$error nla0: | ||
141 | $ @tsid.com | ||
142 | $ deassign sys$error | ||
143 | $ return | ||
144 | $ test_req: | ||
145 | $ define sys$error nla0: | ||
146 | $ @treq.com | ||
147 | $ @treq.com testreq2.pem | ||
148 | $ deassign sys$error | ||
149 | $ return | ||
150 | $ test_pkcs7: | ||
151 | $ define sys$error nla0: | ||
152 | $ @tpkcs7.com | ||
153 | $ @tpkcs7d.com | ||
154 | $ deassign sys$error | ||
155 | $ return | ||
156 | $ test_bn: | ||
157 | $ write sys$output "starting big number library test, could take a while..." | ||
158 | $ create bntest-vms.fdl | ||
159 | FILE | ||
160 | ORGANIZATION sequential | ||
161 | RECORD | ||
162 | FORMAT stream_lf | ||
163 | $ create/fdl=bntest-vms.fdl bntest-vms.sh | ||
164 | $ open/append foo bntest-vms.sh | ||
165 | $ type/output=foo: sys$input: | ||
166 | << __FOO__ sh -c "`sh ./bctest`" | perl -e '$i=0; while (<STDIN>) {if (/^test (.*)/) {print STDERR "\nverify $1";} elsif (!/^0$/) {die "\nFailed! bc: $_";} else {print STDERR "."; $i++;}} print STDERR "\n$i tests passed\n"' | ||
167 | $ define/user sys$output bntest-vms.tmp | ||
168 | $ mcr 'texe_dir''bntest' | ||
169 | $ copy bntest-vms.tmp foo: | ||
170 | $ delete bntest-vms.tmp;* | ||
171 | $ type/output=foo: sys$input: | ||
172 | __FOO__ | ||
173 | $ close foo | ||
174 | $ write sys$output "-- copy the [.test]bntest-vms.sh and [.test]bctest files to a Unix system and" | ||
175 | $ write sys$output "-- run bntest-vms.sh through sh or bash to verify that the bignum operations" | ||
176 | $ write sys$output "-- went well." | ||
177 | $ write sys$output "" | ||
178 | $ write sys$output "test a^b%c implementations" | ||
179 | $ mcr 'texe_dir''exptest' | ||
180 | $ return | ||
181 | $ test_ec: | ||
182 | $ write sys$output "test elliptic curves" | ||
183 | $ mcr 'texe_dir''ectest' | ||
184 | $ return | ||
185 | $ test_verify: | ||
186 | $ write sys$output "The following command should have some OK's and some failures" | ||
187 | $ write sys$output "There are definitly a few expired certificates" | ||
188 | $ @tverify.com | ||
189 | $ return | ||
190 | $ test_dh: | ||
191 | $ write sys$output "Generate a set of DH parameters" | ||
192 | $ mcr 'texe_dir''dhtest' | ||
193 | $ return | ||
194 | $ test_dsa: | ||
195 | $ write sys$output "Generate a set of DSA parameters" | ||
196 | $ mcr 'texe_dir''dsatest' | ||
197 | $ return | ||
198 | $ test_gen: | ||
199 | $ write sys$output "Generate and verify a certificate request" | ||
200 | $ @testgen.com | ||
201 | $ return | ||
202 | $ maybe_test_ss: | ||
203 | $ testss_RDT = f$cvtime(f$file_attributes("testss.com","RDT")) | ||
204 | $ if f$cvtime(f$file_attributes("keyU.ss","RDT")) .les. testss_RDT then - | ||
205 | goto test_ss | ||
206 | $ if f$cvtime(f$file_attributes("certU.ss","RDT")) .les. testss_RDT then - | ||
207 | goto test_ss | ||
208 | $ if f$cvtime(f$file_attributes("certCA.ss","RDT")) .les. testss_RDT then - | ||
209 | goto test_ss | ||
210 | $ return | ||
211 | $ test_ss: | ||
212 | $ write sys$output "Generate and certify a test certificate" | ||
213 | $ @testss.com | ||
214 | $ return | ||
215 | $ test_engine: | ||
216 | $ write sys$output "Manipulate the ENGINE structures" | ||
217 | $ mcr 'texe_dir''enginetest' | ||
218 | $ return | ||
219 | $ test_ssl: | ||
220 | $ write sys$output "test SSL protocol" | ||
221 | $ gosub maybe_test_ss | ||
222 | $ @testssl.com keyU.ss certU.ss certCA.ss | ||
223 | $ return | ||
224 | $ test_ca: | ||
225 | $ set noon | ||
226 | $ define/user sys$output nla0: | ||
227 | $ mcr 'exe_dir'openssl no-rsa | ||
228 | $ save_severity=$SEVERITY | ||
229 | $ set on | ||
230 | $ if save_severity | ||
231 | $ then | ||
232 | $ write sys$output "skipping CA.com test -- requires RSA" | ||
233 | $ else | ||
234 | $ write sys$output "Generate and certify a test certificate via the 'ca' program" | ||
235 | $ @testca.com | ||
236 | $ endif | ||
237 | $ return | ||
238 | $ test_rd: | ||
239 | $ write sys$output "test Rijndael" | ||
240 | $ !mcr 'texe_dir''rdtest' | ||
241 | $ return | ||
242 | $ | ||
243 | $ | ||
244 | $ exit: | ||
245 | $ set default '__save_default' | ||
246 | $ exit | ||
diff --git a/src/lib/libssl/test/testsid.pem b/src/lib/libssl/test/testsid.pem new file mode 100644 index 0000000000..7ffd008f66 --- /dev/null +++ b/src/lib/libssl/test/testsid.pem | |||
@@ -0,0 +1,12 @@ | |||
1 | -----BEGIN SSL SESSION PARAMETERS----- | ||
2 | MIIB1gIBAQIBAgQDAQCABBCi11xa5qkOP8xrr02K/NQCBBBkIYQZM0Bt95W0EHNV | ||
3 | bA58oQYCBDIBr7WiBAICASyjggGGMIIBgjCCASwCAQMwDQYJKoZIhvcNAQEEBQAw | ||
4 | ODELMAkGA1UEBhMCQVUxDDAKBgNVBAgTA1FMRDEbMBkGA1UEAxMSU1NMZWF5L3Jz | ||
5 | YSB0ZXN0IENBMB4XDTk1MTAwOTIzMzEzNFoXDTk4MDcwNTIzMzEzNFowYDELMAkG | ||
6 | A1UEBhMCQVUxDDAKBgNVBAgTA1FMRDEZMBcGA1UEChMQTWluY29tIFB0eS4gTHRk | ||
7 | LjELMAkGA1UECxMCQ1MxGzAZBgNVBAMTElNTTGVheSBkZW1vIGNsaWVudDBcMA0G | ||
8 | CSqGSIb3DQEBAQUAA0sAMEgCQQC4pcXEL1lgVA+B5Q3TcuW/O3LZHoA73IYm8oFD | ||
9 | TezgCDhL2RTMn+seKWF36UtJKRIOBU9jZHCVVd0Me5ls6BEjAgMBAAEwDQYJKoZI | ||
10 | hvcNAQEEBQADQQBoIpOcwUY1qlVF7j3ROSGvUsbvByOBFmYWkIBgsCqR+9qo1A7L | ||
11 | CrWF5i8LWt/vLwAHaxWNx2YuBJMFyuK81fTvpA0EC3Rlc3Rjb250ZXh0 | ||
12 | -----END SSL SESSION PARAMETERS----- | ||
diff --git a/src/lib/libssl/test/testss b/src/lib/libssl/test/testss new file mode 100644 index 0000000000..1a426857d3 --- /dev/null +++ b/src/lib/libssl/test/testss | |||
@@ -0,0 +1,163 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | digest='-sha1' | ||
4 | reqcmd="../util/shlib_wrap.sh ../apps/openssl req" | ||
5 | x509cmd="../util/shlib_wrap.sh ../apps/openssl x509 $digest" | ||
6 | verifycmd="../util/shlib_wrap.sh ../apps/openssl verify" | ||
7 | dummycnf="../apps/openssl.cnf" | ||
8 | |||
9 | CAkey="keyCA.ss" | ||
10 | CAcert="certCA.ss" | ||
11 | CAreq="reqCA.ss" | ||
12 | CAconf="CAss.cnf" | ||
13 | CAreq2="req2CA.ss" # temp | ||
14 | |||
15 | Uconf="Uss.cnf" | ||
16 | Ukey="keyU.ss" | ||
17 | Ureq="reqU.ss" | ||
18 | Ucert="certU.ss" | ||
19 | |||
20 | P1conf="P1ss.cnf" | ||
21 | P1key="keyP1.ss" | ||
22 | P1req="reqP1.ss" | ||
23 | P1cert="certP1.ss" | ||
24 | P1intermediate="tmp_intP1.ss" | ||
25 | |||
26 | P2conf="P2ss.cnf" | ||
27 | P2key="keyP2.ss" | ||
28 | P2req="reqP2.ss" | ||
29 | P2cert="certP2.ss" | ||
30 | P2intermediate="tmp_intP2.ss" | ||
31 | |||
32 | echo | ||
33 | echo "make a certificate request using 'req'" | ||
34 | |||
35 | echo "string to make the random number generator think it has entropy" >> ./.rnd | ||
36 | |||
37 | if ../util/shlib_wrap.sh ../apps/openssl no-rsa; then | ||
38 | req_new='-newkey dsa:../apps/dsa512.pem' | ||
39 | else | ||
40 | req_new='-new' | ||
41 | fi | ||
42 | |||
43 | $reqcmd -config $CAconf -out $CAreq -keyout $CAkey $req_new #>err.ss | ||
44 | if [ $? != 0 ]; then | ||
45 | echo "error using 'req' to generate a certificate request" | ||
46 | exit 1 | ||
47 | fi | ||
48 | echo | ||
49 | echo "convert the certificate request into a self signed certificate using 'x509'" | ||
50 | $x509cmd -CAcreateserial -in $CAreq -days 30 -req -out $CAcert -signkey $CAkey -extfile $CAconf -extensions v3_ca >err.ss | ||
51 | if [ $? != 0 ]; then | ||
52 | echo "error using 'x509' to self sign a certificate request" | ||
53 | exit 1 | ||
54 | fi | ||
55 | |||
56 | echo | ||
57 | echo "convert a certificate into a certificate request using 'x509'" | ||
58 | $x509cmd -in $CAcert -x509toreq -signkey $CAkey -out $CAreq2 >err.ss | ||
59 | if [ $? != 0 ]; then | ||
60 | echo "error using 'x509' convert a certificate to a certificate request" | ||
61 | exit 1 | ||
62 | fi | ||
63 | |||
64 | $reqcmd -config $dummycnf -verify -in $CAreq -noout | ||
65 | if [ $? != 0 ]; then | ||
66 | echo first generated request is invalid | ||
67 | exit 1 | ||
68 | fi | ||
69 | |||
70 | $reqcmd -config $dummycnf -verify -in $CAreq2 -noout | ||
71 | if [ $? != 0 ]; then | ||
72 | echo second generated request is invalid | ||
73 | exit 1 | ||
74 | fi | ||
75 | |||
76 | $verifycmd -CAfile $CAcert $CAcert | ||
77 | if [ $? != 0 ]; then | ||
78 | echo first generated cert is invalid | ||
79 | exit 1 | ||
80 | fi | ||
81 | |||
82 | echo | ||
83 | echo "make a user certificate request using 'req'" | ||
84 | $reqcmd -config $Uconf -out $Ureq -keyout $Ukey $req_new >err.ss | ||
85 | if [ $? != 0 ]; then | ||
86 | echo "error using 'req' to generate a user certificate request" | ||
87 | exit 1 | ||
88 | fi | ||
89 | |||
90 | echo | ||
91 | echo "sign user certificate request with the just created CA via 'x509'" | ||
92 | $x509cmd -CAcreateserial -in $Ureq -days 30 -req -out $Ucert -CA $CAcert -CAkey $CAkey -extfile $Uconf -extensions v3_ee >err.ss | ||
93 | if [ $? != 0 ]; then | ||
94 | echo "error using 'x509' to sign a user certificate request" | ||
95 | exit 1 | ||
96 | fi | ||
97 | |||
98 | $verifycmd -CAfile $CAcert $Ucert | ||
99 | echo | ||
100 | echo "Certificate details" | ||
101 | $x509cmd -subject -issuer -startdate -enddate -noout -in $Ucert | ||
102 | |||
103 | echo | ||
104 | echo "make a proxy certificate request using 'req'" | ||
105 | $reqcmd -config $P1conf -out $P1req -keyout $P1key $req_new >err.ss | ||
106 | if [ $? != 0 ]; then | ||
107 | echo "error using 'req' to generate a proxy certificate request" | ||
108 | exit 1 | ||
109 | fi | ||
110 | |||
111 | echo | ||
112 | echo "sign proxy certificate request with the just created user certificate via 'x509'" | ||
113 | $x509cmd -CAcreateserial -in $P1req -days 30 -req -out $P1cert -CA $Ucert -CAkey $Ukey -extfile $P1conf -extensions v3_proxy >err.ss | ||
114 | if [ $? != 0 ]; then | ||
115 | echo "error using 'x509' to sign a proxy certificate request" | ||
116 | exit 1 | ||
117 | fi | ||
118 | |||
119 | cat $Ucert > $P1intermediate | ||
120 | $verifycmd -CAfile $CAcert -untrusted $P1intermediate $P1cert | ||
121 | echo | ||
122 | echo "Certificate details" | ||
123 | $x509cmd -subject -issuer -startdate -enddate -noout -in $P1cert | ||
124 | |||
125 | echo | ||
126 | echo "make another proxy certificate request using 'req'" | ||
127 | $reqcmd -config $P2conf -out $P2req -keyout $P2key $req_new >err.ss | ||
128 | if [ $? != 0 ]; then | ||
129 | echo "error using 'req' to generate another proxy certificate request" | ||
130 | exit 1 | ||
131 | fi | ||
132 | |||
133 | echo | ||
134 | echo "sign second proxy certificate request with the first proxy certificate via 'x509'" | ||
135 | $x509cmd -CAcreateserial -in $P2req -days 30 -req -out $P2cert -CA $P1cert -CAkey $P1key -extfile $P2conf -extensions v3_proxy >err.ss | ||
136 | if [ $? != 0 ]; then | ||
137 | echo "error using 'x509' to sign a second proxy certificate request" | ||
138 | exit 1 | ||
139 | fi | ||
140 | |||
141 | cat $Ucert $P1cert > $P2intermediate | ||
142 | $verifycmd -CAfile $CAcert -untrusted $P2intermediate $P2cert | ||
143 | echo | ||
144 | echo "Certificate details" | ||
145 | $x509cmd -subject -issuer -startdate -enddate -noout -in $P2cert | ||
146 | |||
147 | echo | ||
148 | echo The generated CA certificate is $CAcert | ||
149 | echo The generated CA private key is $CAkey | ||
150 | |||
151 | echo The generated user certificate is $Ucert | ||
152 | echo The generated user private key is $Ukey | ||
153 | |||
154 | echo The first generated proxy certificate is $P1cert | ||
155 | echo The first generated proxy private key is $P1key | ||
156 | |||
157 | echo The second generated proxy certificate is $P2cert | ||
158 | echo The second generated proxy private key is $P2key | ||
159 | |||
160 | /bin/rm err.ss | ||
161 | #/bin/rm $P1intermediate | ||
162 | #/bin/rm $P2intermediate | ||
163 | exit 0 | ||
diff --git a/src/lib/libssl/test/testss.com b/src/lib/libssl/test/testss.com new file mode 100644 index 0000000000..685ae5043d --- /dev/null +++ b/src/lib/libssl/test/testss.com | |||
@@ -0,0 +1,118 @@ | |||
1 | $! TESTSS.COM | ||
2 | $ | ||
3 | $ __arch := VAX | ||
4 | $ if f$getsyi("cpu") .ge. 128 then __arch := AXP | ||
5 | $ exe_dir := sys$disk:[-.'__arch'.exe.apps] | ||
6 | $ | ||
7 | $ digest="-md5" | ||
8 | $ reqcmd := mcr 'exe_dir'openssl req | ||
9 | $ x509cmd := mcr 'exe_dir'openssl x509 'digest' | ||
10 | $ verifycmd := mcr 'exe_dir'openssl verify | ||
11 | $ dummycnf := sys$disk:[-.apps]openssl-vms.cnf | ||
12 | $ | ||
13 | $ CAkey="""keyCA.ss""" | ||
14 | $ CAcert="""certCA.ss""" | ||
15 | $ CAreq="""reqCA.ss""" | ||
16 | $ CAconf="""CAss.cnf""" | ||
17 | $ CAreq2="""req2CA.ss""" ! temp | ||
18 | $ | ||
19 | $ Uconf="""Uss.cnf""" | ||
20 | $ Ukey="""keyU.ss""" | ||
21 | $ Ureq="""reqU.ss""" | ||
22 | $ Ucert="""certU.ss""" | ||
23 | $ | ||
24 | $ write sys$output "" | ||
25 | $ write sys$output "make a certificate request using 'req'" | ||
26 | $ | ||
27 | $ set noon | ||
28 | $ define/user sys$output nla0: | ||
29 | $ mcr 'exe_dir'openssl no-rsa | ||
30 | $ save_severity=$SEVERITY | ||
31 | $ set on | ||
32 | $ if save_severity | ||
33 | $ then | ||
34 | $ req_new="-newkey dsa:[-.apps]dsa512.pem" | ||
35 | $ else | ||
36 | $ req_new="-new" | ||
37 | $ endif | ||
38 | $ | ||
39 | $ 'reqcmd' -config 'CAconf' -out 'CAreq' -keyout 'CAkey' 'req_new' ! -out err.ss | ||
40 | $ if $severity .ne. 1 | ||
41 | $ then | ||
42 | $ write sys$output "error using 'req' to generate a certificate request" | ||
43 | $ exit 3 | ||
44 | $ endif | ||
45 | $ write sys$output "" | ||
46 | $ write sys$output "convert the certificate request into a self signed certificate using 'x509'" | ||
47 | $ define /user sys$output err.ss | ||
48 | $ 'x509cmd' "-CAcreateserial" -in 'CAreq' -days 30 -req -out 'CAcert' -signkey 'CAkey' | ||
49 | $ if $severity .ne. 1 | ||
50 | $ then | ||
51 | $ write sys$output "error using 'x509' to self sign a certificate request" | ||
52 | $ exit 3 | ||
53 | $ endif | ||
54 | $ | ||
55 | $ write sys$output "" | ||
56 | $ write sys$output "convert a certificate into a certificate request using 'x509'" | ||
57 | $ define /user sys$output err.ss | ||
58 | $ 'x509cmd' -in 'CAcert' -x509toreq -signkey 'CAkey' -out 'CAreq2' | ||
59 | $ if $severity .ne. 1 | ||
60 | $ then | ||
61 | $ write sys$output "error using 'x509' convert a certificate to a certificate request" | ||
62 | $ exit 3 | ||
63 | $ endif | ||
64 | $ | ||
65 | $ 'reqcmd' -config 'dummycnf' -verify -in 'CAreq' -noout | ||
66 | $ if $severity .ne. 1 | ||
67 | $ then | ||
68 | $ write sys$output "first generated request is invalid" | ||
69 | $ exit 3 | ||
70 | $ endif | ||
71 | $ | ||
72 | $ 'reqcmd' -config 'dummycnf' -verify -in 'CAreq2' -noout | ||
73 | $ if $severity .ne. 1 | ||
74 | $ then | ||
75 | $ write sys$output "second generated request is invalid" | ||
76 | $ exit 3 | ||
77 | $ endif | ||
78 | $ | ||
79 | $ 'verifycmd' "-CAfile" 'CAcert' 'CAcert' | ||
80 | $ if $severity .ne. 1 | ||
81 | $ then | ||
82 | $ write sys$output "first generated cert is invalid" | ||
83 | $ exit 3 | ||
84 | $ endif | ||
85 | $ | ||
86 | $ write sys$output "" | ||
87 | $ write sys$output "make another certificate request using 'req'" | ||
88 | $ define /user sys$output err.ss | ||
89 | $ 'reqcmd' -config 'Uconf' -out 'Ureq' -keyout 'Ukey' 'req_new' | ||
90 | $ if $severity .ne. 1 | ||
91 | $ then | ||
92 | $ write sys$output "error using 'req' to generate a certificate request" | ||
93 | $ exit 3 | ||
94 | $ endif | ||
95 | $ | ||
96 | $ write sys$output "" | ||
97 | $ write sys$output "sign certificate request with the just created CA via 'x509'" | ||
98 | $ define /user sys$output err.ss | ||
99 | $ 'x509cmd' "-CAcreateserial" -in 'Ureq' -days 30 -req -out 'Ucert' "-CA" 'CAcert' "-CAkey" 'CAkey' | ||
100 | $ if $severity .ne. 1 | ||
101 | $ then | ||
102 | $ write sys$output "error using 'x509' to sign a certificate request" | ||
103 | $ exit 3 | ||
104 | $ endif | ||
105 | $ | ||
106 | $ 'verifycmd' "-CAfile" 'CAcert' 'Ucert' | ||
107 | $ write sys$output "" | ||
108 | $ write sys$output "Certificate details" | ||
109 | $ 'x509cmd' -subject -issuer -startdate -enddate -noout -in 'Ucert' | ||
110 | $ | ||
111 | $ write sys$output "" | ||
112 | $ write sys$output "The generated CA certificate is ",CAcert | ||
113 | $ write sys$output "The generated CA private key is ",CAkey | ||
114 | $ | ||
115 | $ write sys$output "The generated user certificate is ",Ucert | ||
116 | $ write sys$output "The generated user private key is ",Ukey | ||
117 | $ | ||
118 | $ if f$search("err.ss;*") .nes. "" then delete err.ss;* | ||
diff --git a/src/lib/libssl/test/testssl b/src/lib/libssl/test/testssl new file mode 100644 index 0000000000..8ac90ae5ee --- /dev/null +++ b/src/lib/libssl/test/testssl | |||
@@ -0,0 +1,145 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | if [ "$1" = "" ]; then | ||
4 | key=../apps/server.pem | ||
5 | else | ||
6 | key="$1" | ||
7 | fi | ||
8 | if [ "$2" = "" ]; then | ||
9 | cert=../apps/server.pem | ||
10 | else | ||
11 | cert="$2" | ||
12 | fi | ||
13 | ssltest="../util/shlib_wrap.sh ./ssltest -key $key -cert $cert -c_key $key -c_cert $cert" | ||
14 | |||
15 | if ../util/shlib_wrap.sh ../apps/openssl x509 -in $cert -text -noout | fgrep 'DSA Public Key' >/dev/null; then | ||
16 | dsa_cert=YES | ||
17 | else | ||
18 | dsa_cert=NO | ||
19 | fi | ||
20 | |||
21 | if [ "$3" = "" ]; then | ||
22 | CA="-CApath ../certs" | ||
23 | else | ||
24 | CA="-CAfile $3" | ||
25 | fi | ||
26 | |||
27 | if [ "$4" = "" ]; then | ||
28 | extra="" | ||
29 | else | ||
30 | extra="$4" | ||
31 | fi | ||
32 | |||
33 | ############################################################################# | ||
34 | |||
35 | echo test sslv2 | ||
36 | $ssltest -ssl2 $extra || exit 1 | ||
37 | |||
38 | echo test sslv2 with server authentication | ||
39 | $ssltest -ssl2 -server_auth $CA $extra || exit 1 | ||
40 | |||
41 | if [ $dsa_cert = NO ]; then | ||
42 | echo test sslv2 with client authentication | ||
43 | $ssltest -ssl2 -client_auth $CA $extra || exit 1 | ||
44 | |||
45 | echo test sslv2 with both client and server authentication | ||
46 | $ssltest -ssl2 -server_auth -client_auth $CA $extra || exit 1 | ||
47 | fi | ||
48 | |||
49 | echo test sslv3 | ||
50 | $ssltest -ssl3 $extra || exit 1 | ||
51 | |||
52 | echo test sslv3 with server authentication | ||
53 | $ssltest -ssl3 -server_auth $CA $extra || exit 1 | ||
54 | |||
55 | echo test sslv3 with client authentication | ||
56 | $ssltest -ssl3 -client_auth $CA $extra || exit 1 | ||
57 | |||
58 | echo test sslv3 with both client and server authentication | ||
59 | $ssltest -ssl3 -server_auth -client_auth $CA $extra || exit 1 | ||
60 | |||
61 | echo test sslv2/sslv3 | ||
62 | $ssltest $extra || exit 1 | ||
63 | |||
64 | echo test sslv2/sslv3 with server authentication | ||
65 | $ssltest -server_auth $CA $extra || exit 1 | ||
66 | |||
67 | echo test sslv2/sslv3 with client authentication | ||
68 | $ssltest -client_auth $CA $extra || exit 1 | ||
69 | |||
70 | echo test sslv2/sslv3 with both client and server authentication | ||
71 | $ssltest -server_auth -client_auth $CA $extra || exit 1 | ||
72 | |||
73 | echo test sslv2 via BIO pair | ||
74 | $ssltest -bio_pair -ssl2 $extra || exit 1 | ||
75 | |||
76 | echo test sslv2 with server authentication via BIO pair | ||
77 | $ssltest -bio_pair -ssl2 -server_auth $CA $extra || exit 1 | ||
78 | |||
79 | if [ $dsa_cert = NO ]; then | ||
80 | echo test sslv2 with client authentication via BIO pair | ||
81 | $ssltest -bio_pair -ssl2 -client_auth $CA $extra || exit 1 | ||
82 | |||
83 | echo test sslv2 with both client and server authentication via BIO pair | ||
84 | $ssltest -bio_pair -ssl2 -server_auth -client_auth $CA $extra || exit 1 | ||
85 | fi | ||
86 | |||
87 | echo test sslv3 via BIO pair | ||
88 | $ssltest -bio_pair -ssl3 $extra || exit 1 | ||
89 | |||
90 | echo test sslv3 with server authentication via BIO pair | ||
91 | $ssltest -bio_pair -ssl3 -server_auth $CA $extra || exit 1 | ||
92 | |||
93 | echo test sslv3 with client authentication via BIO pair | ||
94 | $ssltest -bio_pair -ssl3 -client_auth $CA $extra || exit 1 | ||
95 | |||
96 | echo test sslv3 with both client and server authentication via BIO pair | ||
97 | $ssltest -bio_pair -ssl3 -server_auth -client_auth $CA $extra || exit 1 | ||
98 | |||
99 | echo test sslv2/sslv3 via BIO pair | ||
100 | $ssltest $extra || exit 1 | ||
101 | |||
102 | if [ $dsa_cert = NO ]; then | ||
103 | echo test sslv2/sslv3 w/o DHE via BIO pair | ||
104 | $ssltest -bio_pair -no_dhe $extra || exit 1 | ||
105 | fi | ||
106 | |||
107 | echo test sslv2/sslv3 with 1024bit DHE via BIO pair | ||
108 | $ssltest -bio_pair -dhe1024dsa -v $extra || exit 1 | ||
109 | |||
110 | echo test sslv2/sslv3 with server authentication | ||
111 | $ssltest -bio_pair -server_auth $CA $extra || exit 1 | ||
112 | |||
113 | echo test sslv2/sslv3 with client authentication via BIO pair | ||
114 | $ssltest -bio_pair -client_auth $CA $extra || exit 1 | ||
115 | |||
116 | echo test sslv2/sslv3 with both client and server authentication via BIO pair | ||
117 | $ssltest -bio_pair -server_auth -client_auth $CA $extra || exit 1 | ||
118 | |||
119 | echo test sslv2/sslv3 with both client and server authentication via BIO pair and app verify | ||
120 | $ssltest -bio_pair -server_auth -client_auth -app_verify $CA $extra || exit 1 | ||
121 | |||
122 | ############################################################################# | ||
123 | |||
124 | if ../util/shlib_wrap.sh ../apps/openssl no-dh; then | ||
125 | echo skipping anonymous DH tests | ||
126 | else | ||
127 | echo test tls1 with 1024bit anonymous DH, multiple handshakes | ||
128 | $ssltest -v -bio_pair -tls1 -cipher ADH -dhe1024dsa -num 10 -f -time $extra || exit 1 | ||
129 | fi | ||
130 | |||
131 | if ../util/shlib_wrap.sh ../apps/openssl no-rsa; then | ||
132 | echo skipping RSA tests | ||
133 | else | ||
134 | echo test tls1 with 1024bit RSA, no DHE, multiple handshakes | ||
135 | ../util/shlib_wrap.sh ./ssltest -v -bio_pair -tls1 -cert ../apps/server2.pem -no_dhe -num 10 -f -time $extra || exit 1 | ||
136 | |||
137 | if ../util/shlib_wrap.sh ../apps/openssl no-dh; then | ||
138 | echo skipping RSA+DHE tests | ||
139 | else | ||
140 | echo test tls1 with 1024bit RSA, 1024bit DHE, multiple handshakes | ||
141 | ../util/shlib_wrap.sh ./ssltest -v -bio_pair -tls1 -cert ../apps/server2.pem -dhe1024dsa -num 10 -f -time $extra || exit 1 | ||
142 | fi | ||
143 | fi | ||
144 | |||
145 | exit 0 | ||
diff --git a/src/lib/libssl/test/testssl.com b/src/lib/libssl/test/testssl.com new file mode 100644 index 0000000000..26308f7715 --- /dev/null +++ b/src/lib/libssl/test/testssl.com | |||
@@ -0,0 +1,204 @@ | |||
1 | $! TESTSSL.COM | ||
2 | $ | ||
3 | $ __arch := VAX | ||
4 | $ if f$getsyi("cpu") .ge. 128 then __arch := AXP | ||
5 | $ texe_dir := sys$disk:[-.'__arch'.exe.test] | ||
6 | $ exe_dir := sys$disk:[-.'__arch'.exe.apps] | ||
7 | $ | ||
8 | $ if p1 .eqs. "" | ||
9 | $ then | ||
10 | $ key="[-.apps]server.pem" | ||
11 | $ else | ||
12 | $ key=p1 | ||
13 | $ endif | ||
14 | $ if p2 .eqs. "" | ||
15 | $ then | ||
16 | $ cert="[-.apps]server.pem" | ||
17 | $ else | ||
18 | $ cert=p2 | ||
19 | $ endif | ||
20 | $ ssltest := mcr 'texe_dir'ssltest -key 'key' -cert 'cert' -c_key 'key' -c_cert 'cert' | ||
21 | $ | ||
22 | $ define/user sys$output testssl-x509-output. | ||
23 | $ define/user sys$error nla0: | ||
24 | $ mcr 'exe_dir'openssl x509 -in 'cert' -text -noout | ||
25 | $ set noon | ||
26 | $ define/user sys$error nla0: | ||
27 | $ search/output=nla0: testssl-x509-output. "DSA Public Key"/exact | ||
28 | $ if $severity .eq. 1 | ||
29 | $ then | ||
30 | $ dsa_cert := YES | ||
31 | $ else | ||
32 | $ dsa_cert := NO | ||
33 | $ endif | ||
34 | $ set on | ||
35 | $ delete testssl-x509-output.;* | ||
36 | $ | ||
37 | $ if p3 .eqs. "" | ||
38 | $ then | ||
39 | $ copy/concatenate [-.certs]*.pem certs.tmp | ||
40 | $ CA = """-CAfile"" certs.tmp" | ||
41 | $ else | ||
42 | $ CA = """-CAfile"" "+p3 | ||
43 | $ endif | ||
44 | $ | ||
45 | $!########################################################################### | ||
46 | $ | ||
47 | $ write sys$output "test sslv2" | ||
48 | $ 'ssltest' -ssl2 | ||
49 | $ if $severity .ne. 1 then goto exit3 | ||
50 | $ | ||
51 | $ write sys$output "test sslv2 with server authentication" | ||
52 | $ 'ssltest' -ssl2 -server_auth 'CA' | ||
53 | $ if $severity .ne. 1 then goto exit3 | ||
54 | $ | ||
55 | $ if .not. dsa_cert | ||
56 | $ then | ||
57 | $ write sys$output "test sslv2 with client authentication" | ||
58 | $ 'ssltest' -ssl2 -client_auth 'CA' | ||
59 | $ if $severity .ne. 1 then goto exit3 | ||
60 | $ | ||
61 | $ write sys$output "test sslv2 with both client and server authentication" | ||
62 | $ 'ssltest' -ssl2 -server_auth -client_auth 'CA' | ||
63 | $ if $severity .ne. 1 then goto exit3 | ||
64 | $ endif | ||
65 | $ | ||
66 | $ write sys$output "test sslv3" | ||
67 | $ 'ssltest' -ssl3 | ||
68 | $ if $severity .ne. 1 then goto exit3 | ||
69 | $ | ||
70 | $ write sys$output "test sslv3 with server authentication" | ||
71 | $ 'ssltest' -ssl3 -server_auth 'CA' | ||
72 | $ if $severity .ne. 1 then goto exit3 | ||
73 | $ | ||
74 | $ write sys$output "test sslv3 with client authentication" | ||
75 | $ 'ssltest' -ssl3 -client_auth 'CA' | ||
76 | $ if $severity .ne. 1 then goto exit3 | ||
77 | $ | ||
78 | $ write sys$output "test sslv3 with both client and server authentication" | ||
79 | $ 'ssltest' -ssl3 -server_auth -client_auth 'CA' | ||
80 | $ if $severity .ne. 1 then goto exit3 | ||
81 | $ | ||
82 | $ write sys$output "test sslv2/sslv3" | ||
83 | $ 'ssltest' | ||
84 | $ if $severity .ne. 1 then goto exit3 | ||
85 | $ | ||
86 | $ write sys$output "test sslv2/sslv3 with server authentication" | ||
87 | $ 'ssltest' -server_auth 'CA' | ||
88 | $ if $severity .ne. 1 then goto exit3 | ||
89 | $ | ||
90 | $ write sys$output "test sslv2/sslv3 with client authentication" | ||
91 | $ 'ssltest' -client_auth 'CA' | ||
92 | $ if $severity .ne. 1 then goto exit3 | ||
93 | $ | ||
94 | $ write sys$output "test sslv2/sslv3 with both client and server authentication" | ||
95 | $ 'ssltest' -server_auth -client_auth 'CA' | ||
96 | $ if $severity .ne. 1 then goto exit3 | ||
97 | $ | ||
98 | $ write sys$output "test sslv2 via BIO pair" | ||
99 | $ 'ssltest' -bio_pair -ssl2 | ||
100 | $ if $severity .ne. 1 then goto exit3 | ||
101 | $ | ||
102 | $ write sys$output "test sslv2 with server authentication via BIO pair" | ||
103 | $ 'ssltest' -bio_pair -ssl2 -server_auth 'CA' | ||
104 | $ if $severity .ne. 1 then goto exit3 | ||
105 | $ | ||
106 | $ if .not. dsa_cert | ||
107 | $ then | ||
108 | $ write sys$output "test sslv2 with client authentication via BIO pair" | ||
109 | $ 'ssltest' -bio_pair -ssl2 -client_auth 'CA' | ||
110 | $ if $severity .ne. 1 then goto exit3 | ||
111 | $ | ||
112 | $ write sys$output "test sslv2 with both client and server authentication via BIO pair" | ||
113 | $ 'ssltest' -bio_pair -ssl2 -server_auth -client_auth 'CA' | ||
114 | $ if $severity .ne. 1 then goto exit3 | ||
115 | $ endif | ||
116 | $ | ||
117 | $ write sys$output "test sslv3 via BIO pair" | ||
118 | $ 'ssltest' -bio_pair -ssl3 | ||
119 | $ if $severity .ne. 1 then goto exit3 | ||
120 | $ | ||
121 | $ write sys$output "test sslv3 with server authentication via BIO pair" | ||
122 | $ 'ssltest' -bio_pair -ssl3 -server_auth 'CA' | ||
123 | $ if $severity .ne. 1 then goto exit3 | ||
124 | $ | ||
125 | $ write sys$output "test sslv3 with client authentication via BIO pair" | ||
126 | $ 'ssltest' -bio_pair -ssl3 -client_auth 'CA' | ||
127 | $ if $severity .ne. 1 then goto exit3 | ||
128 | |||
129 | $ write sys$output "test sslv3 with both client and server authentication via BIO pair" | ||
130 | $ 'ssltest' -bio_pair -ssl3 -server_auth -client_auth 'CA' | ||
131 | $ if $severity .ne. 1 then goto exit3 | ||
132 | $ | ||
133 | $ write sys$output "test sslv2/sslv3 via BIO pair" | ||
134 | $ 'ssltest' | ||
135 | $ if $severity .ne. 1 then goto exit3 | ||
136 | $ | ||
137 | $ if .not. dsa_cert | ||
138 | $ then | ||
139 | $ write sys$output "test sslv2/sslv3 w/o DHE via BIO pair" | ||
140 | $ 'ssltest' -bio_pair -no_dhe | ||
141 | $ if $severity .ne. 1 then goto exit3 | ||
142 | $ endif | ||
143 | $ | ||
144 | $ write sys$output "test sslv2/sslv3 with 1024 bit DHE via BIO pair" | ||
145 | $ 'ssltest' -bio_pair -dhe1024dsa -v | ||
146 | $ if $severity .ne. 1 then goto exit3 | ||
147 | $ | ||
148 | $ write sys$output "test sslv2/sslv3 with server authentication" | ||
149 | $ 'ssltest' -bio_pair -server_auth 'CA' | ||
150 | $ if $severity .ne. 1 then goto exit3 | ||
151 | $ | ||
152 | $ write sys$output "test sslv2/sslv3 with client authentication via BIO pair" | ||
153 | $ 'ssltest' -bio_pair -client_auth 'CA' | ||
154 | $ if $severity .ne. 1 then goto exit3 | ||
155 | $ | ||
156 | $ write sys$output "test sslv2/sslv3 with both client and server authentication via BIO pair" | ||
157 | $ 'ssltest' -bio_pair -server_auth -client_auth 'CA' | ||
158 | $ if $severity .ne. 1 then goto exit3 | ||
159 | $ | ||
160 | $!########################################################################### | ||
161 | $ | ||
162 | $ set noon | ||
163 | $ define/user sys$output nla0: | ||
164 | $ mcr 'exe_dir'openssl no-rsa | ||
165 | $ no_rsa=$SEVERITY | ||
166 | $ define/user sys$output nla0: | ||
167 | $ mcr 'exe_dir'openssl no-dh | ||
168 | $ no_dh=$SEVERITY | ||
169 | $ set on | ||
170 | $ | ||
171 | $ if no_dh | ||
172 | $ then | ||
173 | $ write sys$output "skipping anonymous DH tests" | ||
174 | $ else | ||
175 | $ write sys$output "test tls1 with 1024bit anonymous DH, multiple handshakes" | ||
176 | $ 'ssltest' -v -bio_pair -tls1 -cipher "ADH" -dhe1024dsa -num 10 -f -time | ||
177 | $ if $severity .ne. 1 then goto exit3 | ||
178 | $ endif | ||
179 | $ | ||
180 | $ if no_rsa | ||
181 | $ then | ||
182 | $ write sys$output "skipping RSA tests" | ||
183 | $ else | ||
184 | $ write sys$output "test tls1 with 1024bit RSA, no DHE, multiple handshakes" | ||
185 | $ mcr 'texe_dir'ssltest -v -bio_pair -tls1 -cert [-.apps]server2.pem -no_dhe -num 10 -f -time | ||
186 | $ if $severity .ne. 1 then goto exit3 | ||
187 | $ | ||
188 | $ if no_dh | ||
189 | $ then | ||
190 | $ write sys$output "skipping RSA+DHE tests" | ||
191 | $ else | ||
192 | $ write sys$output "test tls1 with 1024bit RSA, 1024bit DHE, multiple handshakes" | ||
193 | $ mcr 'texe_dir'ssltest -v -bio_pair -tls1 -cert [-.apps]server2.pem -dhe1024dsa -num 10 -f -time | ||
194 | $ if $severity .ne. 1 then goto exit3 | ||
195 | $ endif | ||
196 | $ endif | ||
197 | $ | ||
198 | $ RET = 1 | ||
199 | $ goto exit | ||
200 | $ exit3: | ||
201 | $ RET = 3 | ||
202 | $ exit: | ||
203 | $ if p3 .eqs. "" then delete certs.tmp;* | ||
204 | $ exit 'RET' | ||
diff --git a/src/lib/libssl/test/testsslproxy b/src/lib/libssl/test/testsslproxy new file mode 100644 index 0000000000..58bbda8ab7 --- /dev/null +++ b/src/lib/libssl/test/testsslproxy | |||
@@ -0,0 +1,10 @@ | |||
1 | #! /bin/sh | ||
2 | |||
3 | echo 'Testing a lot of proxy conditions.' | ||
4 | echo 'Some of them may turn out being invalid, which is fine.' | ||
5 | for auth in A B C BC; do | ||
6 | for cond in A B C 'A|B&!C'; do | ||
7 | sh ./testssl $1 $2 $3 "-proxy -proxy_auth $auth -proxy_cond $cond" | ||
8 | if [ $? = 3 ]; then exit 1; fi | ||
9 | done | ||
10 | done | ||
diff --git a/src/lib/libssl/test/testx509.pem b/src/lib/libssl/test/testx509.pem new file mode 100644 index 0000000000..8a85d14964 --- /dev/null +++ b/src/lib/libssl/test/testx509.pem | |||
@@ -0,0 +1,10 @@ | |||
1 | -----BEGIN CERTIFICATE----- | ||
2 | MIIBWzCCAQYCARgwDQYJKoZIhvcNAQEEBQAwODELMAkGA1UEBhMCQVUxDDAKBgNV | ||
3 | BAgTA1FMRDEbMBkGA1UEAxMSU1NMZWF5L3JzYSB0ZXN0IENBMB4XDTk1MDYxOTIz | ||
4 | MzMxMloXDTk1MDcxNzIzMzMxMlowOjELMAkGA1UEBhMCQVUxDDAKBgNVBAgTA1FM | ||
5 | RDEdMBsGA1UEAxMUU1NMZWF5L3JzYSB0ZXN0IGNlcnQwXDANBgkqhkiG9w0BAQEF | ||
6 | AANLADBIAkEAqtt6qS5GTxVxGZYWa0/4u+IwHf7p2LNZbcPBp9/OfIcYAXBQn8hO | ||
7 | /Re1uwLKXdCjIoaGs4DLdG88rkzfyK5dPQIDAQABMAwGCCqGSIb3DQIFBQADQQAE | ||
8 | Wc7EcF8po2/ZO6kNCwK/ICH6DobgLekA5lSLr5EvuioZniZp5lFzAw4+YzPQ7XKJ | ||
9 | zl9HYIMxATFyqSiD9jsx | ||
10 | -----END CERTIFICATE----- | ||
diff --git a/src/lib/libssl/test/times b/src/lib/libssl/test/times new file mode 100644 index 0000000000..738d569b8f --- /dev/null +++ b/src/lib/libssl/test/times | |||
@@ -0,0 +1,113 @@ | |||
1 | |||
2 | More number for the questions about SSL overheads.... | ||
3 | |||
4 | The following numbers were generated on a pentium pro 200, running linux. | ||
5 | They give an indication of the SSL protocol and encryption overheads. | ||
6 | |||
7 | The program that generated them is an unreleased version of ssl/ssltest.c | ||
8 | which is the SSLeay ssl protocol testing program. It is a single process that | ||
9 | talks both sides of the SSL protocol via a non-blocking memory buffer | ||
10 | interface. | ||
11 | |||
12 | How do I read this? The protocol and cipher are reasonable obvious. | ||
13 | The next number is the number of connections being made. The next is the | ||
14 | number of bytes exchanged bewteen the client and server side of the protocol. | ||
15 | This is the number of bytes that the client sends to the server, and then | ||
16 | the server sends back. Because this is all happening in one process, | ||
17 | the data is being encrypted, decrypted, encrypted and then decrypted again. | ||
18 | It is a round trip of that many bytes. Because the one process performs | ||
19 | both the client and server sides of the protocol and it sends this many bytes | ||
20 | each direction, multiply this number by 4 to generate the number | ||
21 | of bytes encrypted/decrypted/MACed. The first time value is how many seconds | ||
22 | elapsed doing a full SSL handshake, the second is the cost of one | ||
23 | full handshake and the rest being session-id reuse. | ||
24 | |||
25 | SSLv2 RC4-MD5 1000 x 1 12.83s 0.70s | ||
26 | SSLv3 NULL-MD5 1000 x 1 14.35s 1.47s | ||
27 | SSLv3 RC4-MD5 1000 x 1 14.46s 1.56s | ||
28 | SSLv3 RC4-MD5 1000 x 1 51.93s 1.62s 1024bit RSA | ||
29 | SSLv3 RC4-SHA 1000 x 1 14.61s 1.83s | ||
30 | SSLv3 DES-CBC-SHA 1000 x 1 14.70s 1.89s | ||
31 | SSLv3 DES-CBC3-SHA 1000 x 1 15.16s 2.16s | ||
32 | |||
33 | SSLv2 RC4-MD5 1000 x 1024 13.72s 1.27s | ||
34 | SSLv3 NULL-MD5 1000 x 1024 14.79s 1.92s | ||
35 | SSLv3 RC4-MD5 1000 x 1024 52.58s 2.29s 1024bit RSA | ||
36 | SSLv3 RC4-SHA 1000 x 1024 15.39s 2.67s | ||
37 | SSLv3 DES-CBC-SHA 1000 x 1024 16.45s 3.55s | ||
38 | SSLv3 DES-CBC3-SHA 1000 x 1024 18.21s 5.38s | ||
39 | |||
40 | SSLv2 RC4-MD5 1000 x 10240 18.97s 6.52s | ||
41 | SSLv3 NULL-MD5 1000 x 10240 17.79s 5.11s | ||
42 | SSLv3 RC4-MD5 1000 x 10240 20.25s 7.90s | ||
43 | SSLv3 RC4-MD5 1000 x 10240 58.26s 8.08s 1024bit RSA | ||
44 | SSLv3 RC4-SHA 1000 x 10240 22.96s 11.44s | ||
45 | SSLv3 DES-CBC-SHA 1000 x 10240 30.65s 18.41s | ||
46 | SSLv3 DES-CBC3-SHA 1000 x 10240 47.04s 34.53s | ||
47 | |||
48 | SSLv2 RC4-MD5 1000 x 102400 70.22s 57.74s | ||
49 | SSLv3 NULL-MD5 1000 x 102400 43.73s 31.03s | ||
50 | SSLv3 RC4-MD5 1000 x 102400 71.32s 58.83s | ||
51 | SSLv3 RC4-MD5 1000 x 102400 109.66s 59.20s 1024bit RSA | ||
52 | SSLv3 RC4-SHA 1000 x 102400 95.88s 82.21s | ||
53 | SSLv3 DES-CBC-SHA 1000 x 102400 173.22s 160.55s | ||
54 | SSLv3 DES-CBC3-SHA 1000 x 102400 336.61s 323.82s | ||
55 | |||
56 | What does this all mean? Well for a server, with no session-id reuse, with | ||
57 | a transfer size of 10240 bytes, using RC4-MD5 and a 512bit server key, | ||
58 | a pentium pro 200 running linux can handle the SSLv3 protocol overheads of | ||
59 | about 49 connections a second. Reality will be quite different :-). | ||
60 | |||
61 | Remeber the first number is 1000 full ssl handshakes, the second is | ||
62 | 1 full and 999 with session-id reuse. The RSA overheads for each exchange | ||
63 | would be one public and one private operation, but the protocol/MAC/cipher | ||
64 | cost would be quite similar in both the client and server. | ||
65 | |||
66 | eric (adding numbers to speculation) | ||
67 | |||
68 | --- Appendix --- | ||
69 | - The time measured is user time but these number a very rough. | ||
70 | - Remember this is the cost of both client and server sides of the protocol. | ||
71 | - The TCP/kernel overhead of connection establishment is normally the | ||
72 | killer in SSL. Often delays in the TCP protocol will make session-id | ||
73 | reuse look slower that new sessions, but this would not be the case on | ||
74 | a loaded server. | ||
75 | - The TCP round trip latencies, while slowing indervidual connections, | ||
76 | would have minimal impact on throughput. | ||
77 | - Instead of sending one 102400 byte buffer, one 8k buffer is sent until | ||
78 | - the required number of bytes are processed. | ||
79 | - The SSLv3 connections were actually SSLv2 compatable SSLv3 headers. | ||
80 | - A 512bit server key was being used except where noted. | ||
81 | - No server key verification was being performed on the client side of the | ||
82 | protocol. This would slow things down very little. | ||
83 | - The library being used is SSLeay 0.8.x. | ||
84 | - The normal mesauring system was commands of the form | ||
85 | time ./ssltest -num 1000 -bytes 102400 -cipher DES-CBC-SHA -reuse | ||
86 | This modified version of ssltest should be in the next public release of | ||
87 | SSLeay. | ||
88 | |||
89 | The general cipher performace number for this platform are | ||
90 | |||
91 | SSLeay 0.8.2a 04-Sep-1997 | ||
92 | built on Fri Sep 5 17:37:05 EST 1997 | ||
93 | options:bn(64,32) md2(int) rc4(idx,int) des(ptr,risc1,16,long) idea(int) blowfish(ptr2) | ||
94 | C flags:gcc -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized | ||
95 | The 'numbers' are in 1000s of bytes per second processed. | ||
96 | type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes | ||
97 | md2 131.02k 368.41k 500.57k 549.21k 566.09k | ||
98 | mdc2 535.60k 589.10k 595.88k 595.97k 594.54k | ||
99 | md5 1801.53k 9674.77k 17484.03k 21849.43k 23592.96k | ||
100 | sha 1261.63k 5533.25k 9285.63k 11187.88k 11913.90k | ||
101 | sha1 1103.13k 4782.53k 7933.78k 9472.34k 10070.70k | ||
102 | rc4 10722.53k 14443.93k 15215.79k 15299.24k 15219.59k | ||
103 | des cbc 3286.57k 3827.73k 3913.39k 3931.82k 3926.70k | ||
104 | des ede3 1443.50k 1549.08k 1561.17k 1566.38k 1564.67k | ||
105 | idea cbc 2203.64k 2508.16k 2538.33k 2543.62k 2547.71k | ||
106 | rc2 cbc 1430.94k 1511.59k 1524.82k 1527.13k 1523.33k | ||
107 | blowfish cbc 4716.07k 5965.82k 6190.17k 6243.67k 6234.11k | ||
108 | sign verify | ||
109 | rsa 512 bits 0.0100s 0.0011s | ||
110 | rsa 1024 bits 0.0451s 0.0012s | ||
111 | rsa 2048 bits 0.2605s 0.0086s | ||
112 | rsa 4096 bits 1.6883s 0.0302s | ||
113 | |||
diff --git a/src/lib/libssl/test/tpkcs7 b/src/lib/libssl/test/tpkcs7 new file mode 100644 index 0000000000..79bb6e0edf --- /dev/null +++ b/src/lib/libssl/test/tpkcs7 | |||
@@ -0,0 +1,55 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | if test "$OSTYPE" = msdosdjgpp; then | ||
4 | PATH=../apps\;$PATH | ||
5 | else | ||
6 | PATH=../apps:$PATH | ||
7 | fi | ||
8 | export PATH | ||
9 | |||
10 | cmd='../util/shlib_wrap.sh ../apps/openssl pkcs7' | ||
11 | |||
12 | if [ "$1"x != "x" ]; then | ||
13 | t=$1 | ||
14 | else | ||
15 | t=testp7.pem | ||
16 | fi | ||
17 | |||
18 | echo testing pkcs7 conversions | ||
19 | cp $t fff.p | ||
20 | |||
21 | echo "p -> d" | ||
22 | $cmd -in fff.p -inform p -outform d >f.d | ||
23 | if [ $? != 0 ]; then exit 1; fi | ||
24 | echo "p -> p" | ||
25 | $cmd -in fff.p -inform p -outform p >f.p | ||
26 | if [ $? != 0 ]; then exit 1; fi | ||
27 | |||
28 | echo "d -> d" | ||
29 | $cmd -in f.d -inform d -outform d >ff.d1 | ||
30 | if [ $? != 0 ]; then exit 1; fi | ||
31 | echo "p -> d" | ||
32 | $cmd -in f.p -inform p -outform d >ff.d3 | ||
33 | if [ $? != 0 ]; then exit 1; fi | ||
34 | |||
35 | echo "d -> p" | ||
36 | $cmd -in f.d -inform d -outform p >ff.p1 | ||
37 | if [ $? != 0 ]; then exit 1; fi | ||
38 | echo "p -> p" | ||
39 | $cmd -in f.p -inform p -outform p >ff.p3 | ||
40 | if [ $? != 0 ]; then exit 1; fi | ||
41 | |||
42 | cmp fff.p f.p | ||
43 | if [ $? != 0 ]; then exit 1; fi | ||
44 | cmp fff.p ff.p1 | ||
45 | if [ $? != 0 ]; then exit 1; fi | ||
46 | cmp fff.p ff.p3 | ||
47 | if [ $? != 0 ]; then exit 1; fi | ||
48 | |||
49 | cmp f.p ff.p1 | ||
50 | if [ $? != 0 ]; then exit 1; fi | ||
51 | cmp f.p ff.p3 | ||
52 | if [ $? != 0 ]; then exit 1; fi | ||
53 | |||
54 | /bin/rm -f f.* ff.* fff.* | ||
55 | exit 0 | ||
diff --git a/src/lib/libssl/test/tpkcs7.com b/src/lib/libssl/test/tpkcs7.com new file mode 100644 index 0000000000..047834fba4 --- /dev/null +++ b/src/lib/libssl/test/tpkcs7.com | |||
@@ -0,0 +1,54 @@ | |||
1 | $! TPKCS7.COM -- Tests pkcs7 keys | ||
2 | $ | ||
3 | $ __arch := VAX | ||
4 | $ if f$getsyi("cpu") .ge. 128 then __arch := AXP | ||
5 | $ exe_dir := sys$disk:[-.'__arch'.exe.apps] | ||
6 | $ | ||
7 | $ cmd := mcr 'exe_dir'openssl pkcs7 | ||
8 | $ | ||
9 | $ t := testp7.pem | ||
10 | $ if p1 .nes. "" then t = p1 | ||
11 | $ | ||
12 | $ write sys$output "testing PKCS7 conversions" | ||
13 | $ if f$search("fff.*") .nes "" then delete fff.*;* | ||
14 | $ if f$search("ff.*") .nes "" then delete ff.*;* | ||
15 | $ if f$search("f.*") .nes "" then delete f.*;* | ||
16 | $ convert/fdl=sys$input: 't' fff.p | ||
17 | RECORD | ||
18 | FORMAT STREAM_LF | ||
19 | $ | ||
20 | $ write sys$output "p -> d" | ||
21 | $ 'cmd' -in fff.p -inform p -outform d -out f.d | ||
22 | $ if $severity .ne. 1 then exit 3 | ||
23 | $ write sys$output "p -> p" | ||
24 | $ 'cmd' -in fff.p -inform p -outform p -out f.p | ||
25 | $ if $severity .ne. 1 then exit 3 | ||
26 | $ | ||
27 | $ write sys$output "d -> d" | ||
28 | $ 'cmd' -in f.d -inform d -outform d -out ff.d1 | ||
29 | $ if $severity .ne. 1 then exit 3 | ||
30 | $ write sys$output "p -> d" | ||
31 | $ 'cmd' -in f.p -inform p -outform d -out ff.d3 | ||
32 | $ if $severity .ne. 1 then exit 3 | ||
33 | $ | ||
34 | $ | ||
35 | $ write sys$output "d -> p" | ||
36 | $ 'cmd' -in f.d -inform d -outform p -out ff.p1 | ||
37 | $ if $severity .ne. 1 then exit 3 | ||
38 | $ write sys$output "p -> p" | ||
39 | $ 'cmd' -in f.p -inform p -outform p -out ff.p3 | ||
40 | $ if $severity .ne. 1 then exit 3 | ||
41 | $ | ||
42 | $ backup/compare fff.p f.p | ||
43 | $ if $severity .ne. 1 then exit 3 | ||
44 | $ backup/compare fff.p ff.p1 | ||
45 | $ if $severity .ne. 1 then exit 3 | ||
46 | $ backup/compare fff.p ff.p3 | ||
47 | $ if $severity .ne. 1 then exit 3 | ||
48 | $ | ||
49 | $ backup/compare f.p ff.p1 | ||
50 | $ if $severity .ne. 1 then exit 3 | ||
51 | $ backup/compare f.p ff.p3 | ||
52 | $ if $severity .ne. 1 then exit 3 | ||
53 | $ | ||
54 | $ delete f.*;*,ff.*;*,fff.*;* | ||
diff --git a/src/lib/libssl/test/tpkcs7d b/src/lib/libssl/test/tpkcs7d new file mode 100644 index 0000000000..20394b34c4 --- /dev/null +++ b/src/lib/libssl/test/tpkcs7d | |||
@@ -0,0 +1,48 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | if test "$OSTYPE" = msdosdjgpp; then | ||
4 | PATH=../apps\;$PATH | ||
5 | else | ||
6 | PATH=../apps:$PATH | ||
7 | fi | ||
8 | export PATH | ||
9 | |||
10 | cmd='../util/shlib_wrap.sh ../apps/openssl pkcs7' | ||
11 | |||
12 | if [ "$1"x != "x" ]; then | ||
13 | t=$1 | ||
14 | else | ||
15 | t=pkcs7-1.pem | ||
16 | fi | ||
17 | |||
18 | echo "testing pkcs7 conversions (2)" | ||
19 | cp $t fff.p | ||
20 | |||
21 | echo "p -> d" | ||
22 | $cmd -in fff.p -inform p -outform d >f.d | ||
23 | if [ $? != 0 ]; then exit 1; fi | ||
24 | echo "p -> p" | ||
25 | $cmd -in fff.p -inform p -outform p >f.p | ||
26 | if [ $? != 0 ]; then exit 1; fi | ||
27 | |||
28 | echo "d -> d" | ||
29 | $cmd -in f.d -inform d -outform d >ff.d1 | ||
30 | if [ $? != 0 ]; then exit 1; fi | ||
31 | echo "p -> d" | ||
32 | $cmd -in f.p -inform p -outform d >ff.d3 | ||
33 | if [ $? != 0 ]; then exit 1; fi | ||
34 | |||
35 | echo "d -> p" | ||
36 | $cmd -in f.d -inform d -outform p >ff.p1 | ||
37 | if [ $? != 0 ]; then exit 1; fi | ||
38 | echo "p -> p" | ||
39 | $cmd -in f.p -inform p -outform p >ff.p3 | ||
40 | if [ $? != 0 ]; then exit 1; fi | ||
41 | |||
42 | cmp f.p ff.p1 | ||
43 | if [ $? != 0 ]; then exit 1; fi | ||
44 | cmp f.p ff.p3 | ||
45 | if [ $? != 0 ]; then exit 1; fi | ||
46 | |||
47 | /bin/rm -f f.* ff.* fff.* | ||
48 | exit 0 | ||
diff --git a/src/lib/libssl/test/tpkcs7d.com b/src/lib/libssl/test/tpkcs7d.com new file mode 100644 index 0000000000..193bb72137 --- /dev/null +++ b/src/lib/libssl/test/tpkcs7d.com | |||
@@ -0,0 +1,47 @@ | |||
1 | $! TPKCS7.COM -- Tests pkcs7 keys | ||
2 | $ | ||
3 | $ __arch := VAX | ||
4 | $ if f$getsyi("cpu") .ge. 128 then __arch := AXP | ||
5 | $ exe_dir := sys$disk:[-.'__arch'.exe.apps] | ||
6 | $ | ||
7 | $ cmd := mcr 'exe_dir'openssl pkcs7 | ||
8 | $ | ||
9 | $ t := pkcs7-1.pem | ||
10 | $ if p1 .nes. "" then t = p1 | ||
11 | $ | ||
12 | $ write sys$output "testing PKCS7 conversions (2)" | ||
13 | $ if f$search("fff.*") .nes "" then delete fff.*;* | ||
14 | $ if f$search("ff.*") .nes "" then delete ff.*;* | ||
15 | $ if f$search("f.*") .nes "" then delete f.*;* | ||
16 | $ convert/fdl=sys$input: 't' fff.p | ||
17 | RECORD | ||
18 | FORMAT STREAM_LF | ||
19 | $ | ||
20 | $ write sys$output "p -> d" | ||
21 | $ 'cmd' -in fff.p -inform p -outform d -out f.d | ||
22 | $ if $severity .ne. 1 then exit 3 | ||
23 | $ write sys$output "p -> p" | ||
24 | $ 'cmd' -in fff.p -inform p -outform p -out f.p | ||
25 | $ if $severity .ne. 1 then exit 3 | ||
26 | $ | ||
27 | $ write sys$output "d -> d" | ||
28 | $ 'cmd' -in f.d -inform d -outform d -out ff.d1 | ||
29 | $ if $severity .ne. 1 then exit 3 | ||
30 | $ write sys$output "p -> d" | ||
31 | $ 'cmd' -in f.p -inform p -outform d -out ff.d3 | ||
32 | $ if $severity .ne. 1 then exit 3 | ||
33 | $ | ||
34 | $ | ||
35 | $ write sys$output "d -> p" | ||
36 | $ 'cmd' -in f.d -inform d -outform p -out ff.p1 | ||
37 | $ if $severity .ne. 1 then exit 3 | ||
38 | $ write sys$output "p -> p" | ||
39 | $ 'cmd' -in f.p -inform p -outform p -out ff.p3 | ||
40 | $ if $severity .ne. 1 then exit 3 | ||
41 | $ | ||
42 | $ backup/compare f.p ff.p1 | ||
43 | $ if $severity .ne. 1 then exit 3 | ||
44 | $ backup/compare f.p ff.p3 | ||
45 | $ if $severity .ne. 1 then exit 3 | ||
46 | $ | ||
47 | $ delete f.*;*,ff.*;*,fff.*;* | ||
diff --git a/src/lib/libssl/test/treq b/src/lib/libssl/test/treq new file mode 100644 index 0000000000..7e020210a5 --- /dev/null +++ b/src/lib/libssl/test/treq | |||
@@ -0,0 +1,90 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | if test "$OSTYPE" = msdosdjgpp; then | ||
4 | PATH=../apps\;$PATH | ||
5 | else | ||
6 | PATH=../apps:$PATH | ||
7 | fi | ||
8 | export PATH | ||
9 | |||
10 | cmd='../util/shlib_wrap.sh ../apps/openssl req -config ../apps/openssl.cnf' | ||
11 | |||
12 | if [ "$1"x != "x" ]; then | ||
13 | t=$1 | ||
14 | else | ||
15 | t=testreq.pem | ||
16 | fi | ||
17 | |||
18 | if $cmd -in $t -inform p -noout -text | fgrep 'Unknown Public Key'; then | ||
19 | echo "skipping req conversion test for $t" | ||
20 | exit 0 | ||
21 | fi | ||
22 | |||
23 | echo testing req conversions | ||
24 | cp $t fff.p | ||
25 | |||
26 | echo "p -> d" | ||
27 | $cmd -in fff.p -inform p -outform d >f.d | ||
28 | if [ $? != 0 ]; then exit 1; fi | ||
29 | #echo "p -> t" | ||
30 | #$cmd -in fff.p -inform p -outform t >f.t | ||
31 | #if [ $? != 0 ]; then exit 1; fi | ||
32 | echo "p -> p" | ||
33 | $cmd -in fff.p -inform p -outform p >f.p | ||
34 | if [ $? != 0 ]; then exit 1; fi | ||
35 | |||
36 | echo "d -> d" | ||
37 | $cmd -verify -in f.d -inform d -outform d >ff.d1 | ||
38 | if [ $? != 0 ]; then exit 1; fi | ||
39 | #echo "t -> d" | ||
40 | #$cmd -in f.t -inform t -outform d >ff.d2 | ||
41 | #if [ $? != 0 ]; then exit 1; fi | ||
42 | echo "p -> d" | ||
43 | $cmd -verify -in f.p -inform p -outform d >ff.d3 | ||
44 | if [ $? != 0 ]; then exit 1; fi | ||
45 | |||
46 | #echo "d -> t" | ||
47 | #$cmd -in f.d -inform d -outform t >ff.t1 | ||
48 | #if [ $? != 0 ]; then exit 1; fi | ||
49 | #echo "t -> t" | ||
50 | #$cmd -in f.t -inform t -outform t >ff.t2 | ||
51 | #if [ $? != 0 ]; then exit 1; fi | ||
52 | #echo "p -> t" | ||
53 | #$cmd -in f.p -inform p -outform t >ff.t3 | ||
54 | #if [ $? != 0 ]; then exit 1; fi | ||
55 | |||
56 | echo "d -> p" | ||
57 | $cmd -in f.d -inform d -outform p >ff.p1 | ||
58 | if [ $? != 0 ]; then exit 1; fi | ||
59 | #echo "t -> p" | ||
60 | #$cmd -in f.t -inform t -outform p >ff.p2 | ||
61 | #if [ $? != 0 ]; then exit 1; fi | ||
62 | echo "p -> p" | ||
63 | $cmd -in f.p -inform p -outform p >ff.p3 | ||
64 | if [ $? != 0 ]; then exit 1; fi | ||
65 | |||
66 | cmp fff.p f.p | ||
67 | if [ $? != 0 ]; then exit 1; fi | ||
68 | cmp fff.p ff.p1 | ||
69 | if [ $? != 0 ]; then exit 1; fi | ||
70 | #cmp fff.p ff.p2 | ||
71 | #if [ $? != 0 ]; then exit 1; fi | ||
72 | cmp fff.p ff.p3 | ||
73 | if [ $? != 0 ]; then exit 1; fi | ||
74 | |||
75 | #cmp f.t ff.t1 | ||
76 | #if [ $? != 0 ]; then exit 1; fi | ||
77 | #cmp f.t ff.t2 | ||
78 | #if [ $? != 0 ]; then exit 1; fi | ||
79 | #cmp f.t ff.t3 | ||
80 | #if [ $? != 0 ]; then exit 1; fi | ||
81 | |||
82 | cmp f.p ff.p1 | ||
83 | if [ $? != 0 ]; then exit 1; fi | ||
84 | #cmp f.p ff.p2 | ||
85 | #if [ $? != 0 ]; then exit 1; fi | ||
86 | cmp f.p ff.p3 | ||
87 | if [ $? != 0 ]; then exit 1; fi | ||
88 | |||
89 | /bin/rm -f f.* ff.* fff.* | ||
90 | exit 0 | ||
diff --git a/src/lib/libssl/test/treq.com b/src/lib/libssl/test/treq.com new file mode 100644 index 0000000000..5524e485ba --- /dev/null +++ b/src/lib/libssl/test/treq.com | |||
@@ -0,0 +1,83 @@ | |||
1 | $! TREQ.COM -- Tests req keys | ||
2 | $ | ||
3 | $ __arch := VAX | ||
4 | $ if f$getsyi("cpu") .ge. 128 then __arch := AXP | ||
5 | $ exe_dir := sys$disk:[-.'__arch'.exe.apps] | ||
6 | $ | ||
7 | $ cmd := mcr 'exe_dir'openssl req -config [-.apps]openssl-vms.cnf | ||
8 | $ | ||
9 | $ t := testreq.pem | ||
10 | $ if p1 .nes. "" then t = p1 | ||
11 | $ | ||
12 | $ write sys$output "testing req conversions" | ||
13 | $ if f$search("fff.*") .nes "" then delete fff.*;* | ||
14 | $ if f$search("ff.*") .nes "" then delete ff.*;* | ||
15 | $ if f$search("f.*") .nes "" then delete f.*;* | ||
16 | $ convert/fdl=sys$input: 't' fff.p | ||
17 | RECORD | ||
18 | FORMAT STREAM_LF | ||
19 | $ | ||
20 | $ write sys$output "p -> d" | ||
21 | $ 'cmd' -in fff.p -inform p -outform d -out f.d | ||
22 | $ if $severity .ne. 1 then exit 3 | ||
23 | $! write sys$output "p -> t" | ||
24 | $! 'cmd' -in fff.p -inform p -outform t -out f.t | ||
25 | $! if $severity .ne. 1 then exit 3 | ||
26 | $ write sys$output "p -> p" | ||
27 | $ 'cmd' -in fff.p -inform p -outform p -out f.p | ||
28 | $ if $severity .ne. 1 then exit 3 | ||
29 | $ | ||
30 | $ write sys$output "d -> d" | ||
31 | $ 'cmd' -verify -in f.d -inform d -outform d -out ff.d1 | ||
32 | $ if $severity .ne. 1 then exit 3 | ||
33 | $! write sys$output "t -> d" | ||
34 | $! 'cmd' -verify -in f.t -inform t -outform d -out ff.d2 | ||
35 | $! if $severity .ne. 1 then exit 3 | ||
36 | $ write sys$output "p -> d" | ||
37 | $ 'cmd' -verify -in f.p -inform p -outform d -out ff.d3 | ||
38 | $ if $severity .ne. 1 then exit 3 | ||
39 | $ | ||
40 | $! write sys$output "d -> t" | ||
41 | $! 'cmd' -in f.d -inform d -outform t -out ff.t1 | ||
42 | $! if $severity .ne. 1 then exit 3 | ||
43 | $! write sys$output "t -> t" | ||
44 | $! 'cmd' -in f.t -inform t -outform t -out ff.t2 | ||
45 | $! if $severity .ne. 1 then exit 3 | ||
46 | $! write sys$output "p -> t" | ||
47 | $! 'cmd' -in f.p -inform p -outform t -out ff.t3 | ||
48 | $! if $severity .ne. 1 then exit 3 | ||
49 | $ | ||
50 | $ write sys$output "d -> p" | ||
51 | $ 'cmd' -in f.d -inform d -outform p -out ff.p1 | ||
52 | $ if $severity .ne. 1 then exit 3 | ||
53 | $! write sys$output "t -> p" | ||
54 | $! 'cmd' -in f.t -inform t -outform p -out ff.p2 | ||
55 | $! if $severity .ne. 1 then exit 3 | ||
56 | $ write sys$output "p -> p" | ||
57 | $ 'cmd' -in f.p -inform p -outform p -out ff.p3 | ||
58 | $ if $severity .ne. 1 then exit 3 | ||
59 | $ | ||
60 | $ backup/compare fff.p f.p | ||
61 | $ if $severity .ne. 1 then exit 3 | ||
62 | $ backup/compare fff.p ff.p1 | ||
63 | $ if $severity .ne. 1 then exit 3 | ||
64 | $! backup/compare fff.p ff.p2 | ||
65 | $! if $severity .ne. 1 then exit 3 | ||
66 | $ backup/compare fff.p ff.p3 | ||
67 | $ if $severity .ne. 1 then exit 3 | ||
68 | $ | ||
69 | $! backup/compare f.t ff.t1 | ||
70 | $! if $severity .ne. 1 then exit 3 | ||
71 | $! backup/compare f.t ff.t2 | ||
72 | $! if $severity .ne. 1 then exit 3 | ||
73 | $! backup/compare f.t ff.t3 | ||
74 | $! if $severity .ne. 1 then exit 3 | ||
75 | $ | ||
76 | $ backup/compare f.p ff.p1 | ||
77 | $ if $severity .ne. 1 then exit 3 | ||
78 | $! backup/compare f.p ff.p2 | ||
79 | $! if $severity .ne. 1 then exit 3 | ||
80 | $ backup/compare f.p ff.p3 | ||
81 | $ if $severity .ne. 1 then exit 3 | ||
82 | $ | ||
83 | $ delete f.*;*,ff.*;*,fff.*;* | ||
diff --git a/src/lib/libssl/test/trsa b/src/lib/libssl/test/trsa new file mode 100644 index 0000000000..67b4a98841 --- /dev/null +++ b/src/lib/libssl/test/trsa | |||
@@ -0,0 +1,90 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | if test "$OSTYPE" = msdosdjgpp; then | ||
4 | PATH=../apps\;$PATH | ||
5 | else | ||
6 | PATH=../apps:$PATH | ||
7 | fi | ||
8 | export PATH | ||
9 | |||
10 | if ../util/shlib_wrap.sh ../apps/openssl no-rsa; then | ||
11 | echo skipping rsa conversion test | ||
12 | exit 0 | ||
13 | fi | ||
14 | |||
15 | cmd='../util/shlib_wrap.sh ../apps/openssl rsa' | ||
16 | |||
17 | if [ "$1"x != "x" ]; then | ||
18 | t=$1 | ||
19 | else | ||
20 | t=testrsa.pem | ||
21 | fi | ||
22 | |||
23 | echo testing rsa conversions | ||
24 | cp $t fff.p | ||
25 | |||
26 | echo "p -> d" | ||
27 | $cmd -in fff.p -inform p -outform d >f.d | ||
28 | if [ $? != 0 ]; then exit 1; fi | ||
29 | #echo "p -> t" | ||
30 | #$cmd -in fff.p -inform p -outform t >f.t | ||
31 | #if [ $? != 0 ]; then exit 1; fi | ||
32 | echo "p -> p" | ||
33 | $cmd -in fff.p -inform p -outform p >f.p | ||
34 | if [ $? != 0 ]; then exit 1; fi | ||
35 | |||
36 | echo "d -> d" | ||
37 | $cmd -in f.d -inform d -outform d >ff.d1 | ||
38 | if [ $? != 0 ]; then exit 1; fi | ||
39 | #echo "t -> d" | ||
40 | #$cmd -in f.t -inform t -outform d >ff.d2 | ||
41 | #if [ $? != 0 ]; then exit 1; fi | ||
42 | echo "p -> d" | ||
43 | $cmd -in f.p -inform p -outform d >ff.d3 | ||
44 | if [ $? != 0 ]; then exit 1; fi | ||
45 | |||
46 | #echo "d -> t" | ||
47 | #$cmd -in f.d -inform d -outform t >ff.t1 | ||
48 | #if [ $? != 0 ]; then exit 1; fi | ||
49 | #echo "t -> t" | ||
50 | #$cmd -in f.t -inform t -outform t >ff.t2 | ||
51 | #if [ $? != 0 ]; then exit 1; fi | ||
52 | #echo "p -> t" | ||
53 | #$cmd -in f.p -inform p -outform t >ff.t3 | ||
54 | #if [ $? != 0 ]; then exit 1; fi | ||
55 | |||
56 | echo "d -> p" | ||
57 | $cmd -in f.d -inform d -outform p >ff.p1 | ||
58 | if [ $? != 0 ]; then exit 1; fi | ||
59 | #echo "t -> p" | ||
60 | #$cmd -in f.t -inform t -outform p >ff.p2 | ||
61 | #if [ $? != 0 ]; then exit 1; fi | ||
62 | echo "p -> p" | ||
63 | $cmd -in f.p -inform p -outform p >ff.p3 | ||
64 | if [ $? != 0 ]; then exit 1; fi | ||
65 | |||
66 | cmp fff.p f.p | ||
67 | if [ $? != 0 ]; then exit 1; fi | ||
68 | cmp fff.p ff.p1 | ||
69 | if [ $? != 0 ]; then exit 1; fi | ||
70 | #cmp fff.p ff.p2 | ||
71 | #if [ $? != 0 ]; then exit 1; fi | ||
72 | cmp fff.p ff.p3 | ||
73 | if [ $? != 0 ]; then exit 1; fi | ||
74 | |||
75 | #cmp f.t ff.t1 | ||
76 | #if [ $? != 0 ]; then exit 1; fi | ||
77 | #cmp f.t ff.t2 | ||
78 | #if [ $? != 0 ]; then exit 1; fi | ||
79 | #cmp f.t ff.t3 | ||
80 | #if [ $? != 0 ]; then exit 1; fi | ||
81 | |||
82 | cmp f.p ff.p1 | ||
83 | if [ $? != 0 ]; then exit 1; fi | ||
84 | #cmp f.p ff.p2 | ||
85 | #if [ $? != 0 ]; then exit 1; fi | ||
86 | cmp f.p ff.p3 | ||
87 | if [ $? != 0 ]; then exit 1; fi | ||
88 | |||
89 | /bin/rm -f f.* ff.* fff.* | ||
90 | exit 0 | ||
diff --git a/src/lib/libssl/test/trsa.com b/src/lib/libssl/test/trsa.com new file mode 100644 index 0000000000..6dbe59ef64 --- /dev/null +++ b/src/lib/libssl/test/trsa.com | |||
@@ -0,0 +1,94 @@ | |||
1 | $! TRSA.COM -- Tests rsa keys | ||
2 | $ | ||
3 | $ __arch := VAX | ||
4 | $ if f$getsyi("cpu") .ge. 128 then __arch := AXP | ||
5 | $ exe_dir := sys$disk:[-.'__arch'.exe.apps] | ||
6 | $ | ||
7 | $ set noon | ||
8 | $ define/user sys$output nla0: | ||
9 | $ mcr 'exe_dir'openssl no-rsa | ||
10 | $ save_severity=$SEVERITY | ||
11 | $ set on | ||
12 | $ if save_severity | ||
13 | $ then | ||
14 | $ write sys$output "skipping RSA conversion test" | ||
15 | $ exit | ||
16 | $ endif | ||
17 | $ | ||
18 | $ cmd := mcr 'exe_dir'openssl rsa | ||
19 | $ | ||
20 | $ t := testrsa.pem | ||
21 | $ if p1 .nes. "" then t = p1 | ||
22 | $ | ||
23 | $ write sys$output "testing RSA conversions" | ||
24 | $ if f$search("fff.*") .nes "" then delete fff.*;* | ||
25 | $ if f$search("ff.*") .nes "" then delete ff.*;* | ||
26 | $ if f$search("f.*") .nes "" then delete f.*;* | ||
27 | $ convert/fdl=sys$input: 't' fff.p | ||
28 | RECORD | ||
29 | FORMAT STREAM_LF | ||
30 | $ | ||
31 | $ write sys$output "p -> d" | ||
32 | $ 'cmd' -in fff.p -inform p -outform d -out f.d | ||
33 | $ if $severity .ne. 1 then exit 3 | ||
34 | $! write sys$output "p -> t" | ||
35 | $! 'cmd' -in fff.p -inform p -outform t -out f.t | ||
36 | $! if $severity .ne. 1 then exit 3 | ||
37 | $ write sys$output "p -> p" | ||
38 | $ 'cmd' -in fff.p -inform p -outform p -out f.p | ||
39 | $ if $severity .ne. 1 then exit 3 | ||
40 | $ | ||
41 | $ write sys$output "d -> d" | ||
42 | $ 'cmd' -in f.d -inform d -outform d -out ff.d1 | ||
43 | $ if $severity .ne. 1 then exit 3 | ||
44 | $! write sys$output "t -> d" | ||
45 | $! 'cmd' -in f.t -inform t -outform d -out ff.d2 | ||
46 | $! if $severity .ne. 1 then exit 3 | ||
47 | $ write sys$output "p -> d" | ||
48 | $ 'cmd' -in f.p -inform p -outform d -out ff.d3 | ||
49 | $ if $severity .ne. 1 then exit 3 | ||
50 | $ | ||
51 | $! write sys$output "d -> t" | ||
52 | $! 'cmd' -in f.d -inform d -outform t -out ff.t1 | ||
53 | $! if $severity .ne. 1 then exit 3 | ||
54 | $! write sys$output "t -> t" | ||
55 | $! 'cmd' -in f.t -inform t -outform t -out ff.t2 | ||
56 | $! if $severity .ne. 1 then exit 3 | ||
57 | $! write sys$output "p -> t" | ||
58 | $! 'cmd' -in f.p -inform p -outform t -out ff.t3 | ||
59 | $! if $severity .ne. 1 then exit 3 | ||
60 | $ | ||
61 | $ write sys$output "d -> p" | ||
62 | $ 'cmd' -in f.d -inform d -outform p -out ff.p1 | ||
63 | $ if $severity .ne. 1 then exit 3 | ||
64 | $! write sys$output "t -> p" | ||
65 | $! 'cmd' -in f.t -inform t -outform p -out ff.p2 | ||
66 | $! if $severity .ne. 1 then exit 3 | ||
67 | $ write sys$output "p -> p" | ||
68 | $ 'cmd' -in f.p -inform p -outform p -out ff.p3 | ||
69 | $ if $severity .ne. 1 then exit 3 | ||
70 | $ | ||
71 | $ backup/compare fff.p f.p | ||
72 | $ if $severity .ne. 1 then exit 3 | ||
73 | $ backup/compare fff.p ff.p1 | ||
74 | $ if $severity .ne. 1 then exit 3 | ||
75 | $! backup/compare fff.p ff.p2 | ||
76 | $! if $severity .ne. 1 then exit 3 | ||
77 | $ backup/compare fff.p ff.p3 | ||
78 | $ if $severity .ne. 1 then exit 3 | ||
79 | $ | ||
80 | $! backup/compare f.t ff.t1 | ||
81 | $! if $severity .ne. 1 then exit 3 | ||
82 | $! backup/compare f.t ff.t2 | ||
83 | $! if $severity .ne. 1 then exit 3 | ||
84 | $! backup/compare f.t ff.t3 | ||
85 | $! if $severity .ne. 1 then exit 3 | ||
86 | $ | ||
87 | $ backup/compare f.p ff.p1 | ||
88 | $ if $severity .ne. 1 then exit 3 | ||
89 | $! backup/compare f.p ff.p2 | ||
90 | $! if $severity .ne. 1 then exit 3 | ||
91 | $ backup/compare f.p ff.p3 | ||
92 | $ if $severity .ne. 1 then exit 3 | ||
93 | $ | ||
94 | $ delete f.*;*,ff.*;*,fff.*;* | ||
diff --git a/src/lib/libssl/test/tsid b/src/lib/libssl/test/tsid new file mode 100644 index 0000000000..fb4a7213b9 --- /dev/null +++ b/src/lib/libssl/test/tsid | |||
@@ -0,0 +1,85 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | if test "$OSTYPE" = msdosdjgpp; then | ||
4 | PATH=../apps\;$PATH | ||
5 | else | ||
6 | PATH=../apps:$PATH | ||
7 | fi | ||
8 | export PATH | ||
9 | |||
10 | cmd='../util/shlib_wrap.sh ../apps/openssl sess_id' | ||
11 | |||
12 | if [ "$1"x != "x" ]; then | ||
13 | t=$1 | ||
14 | else | ||
15 | t=testsid.pem | ||
16 | fi | ||
17 | |||
18 | echo testing session-id conversions | ||
19 | cp $t fff.p | ||
20 | |||
21 | echo "p -> d" | ||
22 | $cmd -in fff.p -inform p -outform d >f.d | ||
23 | if [ $? != 0 ]; then exit 1; fi | ||
24 | #echo "p -> t" | ||
25 | #$cmd -in fff.p -inform p -outform t >f.t | ||
26 | #if [ $? != 0 ]; then exit 1; fi | ||
27 | echo "p -> p" | ||
28 | $cmd -in fff.p -inform p -outform p >f.p | ||
29 | if [ $? != 0 ]; then exit 1; fi | ||
30 | |||
31 | echo "d -> d" | ||
32 | $cmd -in f.d -inform d -outform d >ff.d1 | ||
33 | if [ $? != 0 ]; then exit 1; fi | ||
34 | #echo "t -> d" | ||
35 | #$cmd -in f.t -inform t -outform d >ff.d2 | ||
36 | #if [ $? != 0 ]; then exit 1; fi | ||
37 | echo "p -> d" | ||
38 | $cmd -in f.p -inform p -outform d >ff.d3 | ||
39 | if [ $? != 0 ]; then exit 1; fi | ||
40 | |||
41 | #echo "d -> t" | ||
42 | #$cmd -in f.d -inform d -outform t >ff.t1 | ||
43 | #if [ $? != 0 ]; then exit 1; fi | ||
44 | #echo "t -> t" | ||
45 | #$cmd -in f.t -inform t -outform t >ff.t2 | ||
46 | #if [ $? != 0 ]; then exit 1; fi | ||
47 | #echo "p -> t" | ||
48 | #$cmd -in f.p -inform p -outform t >ff.t3 | ||
49 | #if [ $? != 0 ]; then exit 1; fi | ||
50 | |||
51 | echo "d -> p" | ||
52 | $cmd -in f.d -inform d -outform p >ff.p1 | ||
53 | if [ $? != 0 ]; then exit 1; fi | ||
54 | #echo "t -> p" | ||
55 | #$cmd -in f.t -inform t -outform p >ff.p2 | ||
56 | #if [ $? != 0 ]; then exit 1; fi | ||
57 | echo "p -> p" | ||
58 | $cmd -in f.p -inform p -outform p >ff.p3 | ||
59 | if [ $? != 0 ]; then exit 1; fi | ||
60 | |||
61 | cmp fff.p f.p | ||
62 | if [ $? != 0 ]; then exit 1; fi | ||
63 | cmp fff.p ff.p1 | ||
64 | if [ $? != 0 ]; then exit 1; fi | ||
65 | #cmp fff.p ff.p2 | ||
66 | #if [ $? != 0 ]; then exit 1; fi | ||
67 | cmp fff.p ff.p3 | ||
68 | if [ $? != 0 ]; then exit 1; fi | ||
69 | |||
70 | #cmp f.t ff.t1 | ||
71 | #if [ $? != 0 ]; then exit 1; fi | ||
72 | #cmp f.t ff.t2 | ||
73 | #if [ $? != 0 ]; then exit 1; fi | ||
74 | #cmp f.t ff.t3 | ||
75 | #if [ $? != 0 ]; then exit 1; fi | ||
76 | |||
77 | cmp f.p ff.p1 | ||
78 | if [ $? != 0 ]; then exit 1; fi | ||
79 | #cmp f.p ff.p2 | ||
80 | #if [ $? != 0 ]; then exit 1; fi | ||
81 | cmp f.p ff.p3 | ||
82 | if [ $? != 0 ]; then exit 1; fi | ||
83 | |||
84 | /bin/rm -f f.* ff.* fff.* | ||
85 | exit 0 | ||
diff --git a/src/lib/libssl/test/tsid.com b/src/lib/libssl/test/tsid.com new file mode 100644 index 0000000000..abd1d4d737 --- /dev/null +++ b/src/lib/libssl/test/tsid.com | |||
@@ -0,0 +1,83 @@ | |||
1 | $! TSID.COM -- Tests sid keys | ||
2 | $ | ||
3 | $ __arch := VAX | ||
4 | $ if f$getsyi("cpu") .ge. 128 then __arch := AXP | ||
5 | $ exe_dir := sys$disk:[-.'__arch'.exe.apps] | ||
6 | $ | ||
7 | $ cmd := mcr 'exe_dir'openssl sess_id | ||
8 | $ | ||
9 | $ t := testsid.pem | ||
10 | $ if p1 .nes. "" then t = p1 | ||
11 | $ | ||
12 | $ write sys$output "testing session-id conversions" | ||
13 | $ if f$search("fff.*") .nes "" then delete fff.*;* | ||
14 | $ if f$search("ff.*") .nes "" then delete ff.*;* | ||
15 | $ if f$search("f.*") .nes "" then delete f.*;* | ||
16 | $ convert/fdl=sys$input: 't' fff.p | ||
17 | RECORD | ||
18 | FORMAT STREAM_LF | ||
19 | $ | ||
20 | $ write sys$output "p -> d" | ||
21 | $ 'cmd' -in fff.p -inform p -outform d -out f.d | ||
22 | $ if $severity .ne. 1 then exit 3 | ||
23 | $! write sys$output "p -> t" | ||
24 | $! 'cmd' -in fff.p -inform p -outform t -out f.t | ||
25 | $! if $severity .ne. 1 then exit 3 | ||
26 | $ write sys$output "p -> p" | ||
27 | $ 'cmd' -in fff.p -inform p -outform p -out f.p | ||
28 | $ if $severity .ne. 1 then exit 3 | ||
29 | $ | ||
30 | $ write sys$output "d -> d" | ||
31 | $ 'cmd' -in f.d -inform d -outform d -out ff.d1 | ||
32 | $ if $severity .ne. 1 then exit 3 | ||
33 | $! write sys$output "t -> d" | ||
34 | $! 'cmd' -in f.t -inform t -outform d -out ff.d2 | ||
35 | $! if $severity .ne. 1 then exit 3 | ||
36 | $ write sys$output "p -> d" | ||
37 | $ 'cmd' -in f.p -inform p -outform d -out ff.d3 | ||
38 | $ if $severity .ne. 1 then exit 3 | ||
39 | $ | ||
40 | $! write sys$output "d -> t" | ||
41 | $! 'cmd' -in f.d -inform d -outform t -out ff.t1 | ||
42 | $! if $severity .ne. 1 then exit 3 | ||
43 | $! write sys$output "t -> t" | ||
44 | $! 'cmd' -in f.t -inform t -outform t -out ff.t2 | ||
45 | $! if $severity .ne. 1 then exit 3 | ||
46 | $! write sys$output "p -> t" | ||
47 | $! 'cmd' -in f.p -inform p -outform t -out ff.t3 | ||
48 | $! if $severity .ne. 1 then exit 3 | ||
49 | $ | ||
50 | $ write sys$output "d -> p" | ||
51 | $ 'cmd' -in f.d -inform d -outform p -out ff.p1 | ||
52 | $ if $severity .ne. 1 then exit 3 | ||
53 | $! write sys$output "t -> p" | ||
54 | $! 'cmd' -in f.t -inform t -outform p -out ff.p2 | ||
55 | $! if $severity .ne. 1 then exit 3 | ||
56 | $ write sys$output "p -> p" | ||
57 | $ 'cmd' -in f.p -inform p -outform p -out ff.p3 | ||
58 | $ if $severity .ne. 1 then exit 3 | ||
59 | $ | ||
60 | $ backup/compare fff.p f.p | ||
61 | $ if $severity .ne. 1 then exit 3 | ||
62 | $ backup/compare fff.p ff.p1 | ||
63 | $ if $severity .ne. 1 then exit 3 | ||
64 | $! backup/compare fff.p ff.p2 | ||
65 | $! if $severity .ne. 1 then exit 3 | ||
66 | $ backup/compare fff.p ff.p3 | ||
67 | $ if $severity .ne. 1 then exit 3 | ||
68 | $ | ||
69 | $! backup/compare f.t ff.t1 | ||
70 | $! if $severity .ne. 1 then exit 3 | ||
71 | $! backup/compare f.t ff.t2 | ||
72 | $! if $severity .ne. 1 then exit 3 | ||
73 | $! backup/compare f.t ff.t3 | ||
74 | $! if $severity .ne. 1 then exit 3 | ||
75 | $ | ||
76 | $ backup/compare f.p ff.p1 | ||
77 | $ if $severity .ne. 1 then exit 3 | ||
78 | $! backup/compare f.p ff.p2 | ||
79 | $! if $severity .ne. 1 then exit 3 | ||
80 | $ backup/compare f.p ff.p3 | ||
81 | $ if $severity .ne. 1 then exit 3 | ||
82 | $ | ||
83 | $ delete f.*;*,ff.*;*,fff.*;* | ||
diff --git a/src/lib/libssl/test/tverify.com b/src/lib/libssl/test/tverify.com new file mode 100644 index 0000000000..2060184d1e --- /dev/null +++ b/src/lib/libssl/test/tverify.com | |||
@@ -0,0 +1,29 @@ | |||
1 | $! TVERIFY.COM | ||
2 | $ | ||
3 | $ __arch := VAX | ||
4 | $ if f$getsyi("cpu") .ge. 128 then __arch := AXP | ||
5 | $ exe_dir := sys$disk:[-.'__arch'.exe.apps] | ||
6 | $ | ||
7 | $ copy/concatenate [-.certs]*.pem certs.tmp | ||
8 | $ | ||
9 | $ old_f := | ||
10 | $ loop_certs: | ||
11 | $ c := NO | ||
12 | $ certs := | ||
13 | $ loop_certs2: | ||
14 | $ f = f$search("[-.certs]*.pem") | ||
15 | $ if f .nes. "" .and. f .nes. old_f | ||
16 | $ then | ||
17 | $ certs = certs + " [-.certs]" + f$parse(f,,,"NAME") + ".pem" | ||
18 | $ c := YES | ||
19 | $ if f$length(certs) .lt. 180 then goto loop_certs2 | ||
20 | $ endif | ||
21 | $ certs = certs - " " | ||
22 | $ | ||
23 | $ if c | ||
24 | $ then | ||
25 | $ mcr 'exe_dir'openssl verify "-CAfile" certs.tmp 'certs' | ||
26 | $ goto loop_certs | ||
27 | $ endif | ||
28 | $ | ||
29 | $ delete certs.tmp;* | ||
diff --git a/src/lib/libssl/test/tx509 b/src/lib/libssl/test/tx509 new file mode 100644 index 0000000000..1b9c8661f3 --- /dev/null +++ b/src/lib/libssl/test/tx509 | |||
@@ -0,0 +1,85 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | if test "$OSTYPE" = msdosdjgpp; then | ||
4 | PATH=../apps\;$PATH | ||
5 | else | ||
6 | PATH=../apps:$PATH | ||
7 | fi | ||
8 | export PATH | ||
9 | |||
10 | cmd='../util/shlib_wrap.sh ../apps/openssl x509' | ||
11 | |||
12 | if [ "$1"x != "x" ]; then | ||
13 | t=$1 | ||
14 | else | ||
15 | t=testx509.pem | ||
16 | fi | ||
17 | |||
18 | echo testing X509 conversions | ||
19 | cp $t fff.p | ||
20 | |||
21 | echo "p -> d" | ||
22 | $cmd -in fff.p -inform p -outform d >f.d | ||
23 | if [ $? != 0 ]; then exit 1; fi | ||
24 | echo "p -> n" | ||
25 | $cmd -in fff.p -inform p -outform n >f.n | ||
26 | if [ $? != 0 ]; then exit 1; fi | ||
27 | echo "p -> p" | ||
28 | $cmd -in fff.p -inform p -outform p >f.p | ||
29 | if [ $? != 0 ]; then exit 1; fi | ||
30 | |||
31 | echo "d -> d" | ||
32 | $cmd -in f.d -inform d -outform d >ff.d1 | ||
33 | if [ $? != 0 ]; then exit 1; fi | ||
34 | echo "n -> d" | ||
35 | $cmd -in f.n -inform n -outform d >ff.d2 | ||
36 | if [ $? != 0 ]; then exit 1; fi | ||
37 | echo "p -> d" | ||
38 | $cmd -in f.p -inform p -outform d >ff.d3 | ||
39 | if [ $? != 0 ]; then exit 1; fi | ||
40 | |||
41 | echo "d -> n" | ||
42 | $cmd -in f.d -inform d -outform n >ff.n1 | ||
43 | if [ $? != 0 ]; then exit 1; fi | ||
44 | echo "n -> n" | ||
45 | $cmd -in f.n -inform n -outform n >ff.n2 | ||
46 | if [ $? != 0 ]; then exit 1; fi | ||
47 | echo "p -> n" | ||
48 | $cmd -in f.p -inform p -outform n >ff.n3 | ||
49 | if [ $? != 0 ]; then exit 1; fi | ||
50 | |||
51 | echo "d -> p" | ||
52 | $cmd -in f.d -inform d -outform p >ff.p1 | ||
53 | if [ $? != 0 ]; then exit 1; fi | ||
54 | echo "n -> p" | ||
55 | $cmd -in f.n -inform n -outform p >ff.p2 | ||
56 | if [ $? != 0 ]; then exit 1; fi | ||
57 | echo "p -> p" | ||
58 | $cmd -in f.p -inform p -outform p >ff.p3 | ||
59 | if [ $? != 0 ]; then exit 1; fi | ||
60 | |||
61 | cmp fff.p f.p | ||
62 | if [ $? != 0 ]; then exit 1; fi | ||
63 | cmp fff.p ff.p1 | ||
64 | if [ $? != 0 ]; then exit 1; fi | ||
65 | cmp fff.p ff.p2 | ||
66 | if [ $? != 0 ]; then exit 1; fi | ||
67 | cmp fff.p ff.p3 | ||
68 | if [ $? != 0 ]; then exit 1; fi | ||
69 | |||
70 | cmp f.n ff.n1 | ||
71 | if [ $? != 0 ]; then exit 1; fi | ||
72 | cmp f.n ff.n2 | ||
73 | if [ $? != 0 ]; then exit 1; fi | ||
74 | cmp f.n ff.n3 | ||
75 | if [ $? != 0 ]; then exit 1; fi | ||
76 | |||
77 | cmp f.p ff.p1 | ||
78 | if [ $? != 0 ]; then exit 1; fi | ||
79 | cmp f.p ff.p2 | ||
80 | if [ $? != 0 ]; then exit 1; fi | ||
81 | cmp f.p ff.p3 | ||
82 | if [ $? != 0 ]; then exit 1; fi | ||
83 | |||
84 | /bin/rm -f f.* ff.* fff.* | ||
85 | exit 0 | ||
diff --git a/src/lib/libssl/test/tx509.com b/src/lib/libssl/test/tx509.com new file mode 100644 index 0000000000..7b2592f773 --- /dev/null +++ b/src/lib/libssl/test/tx509.com | |||
@@ -0,0 +1,83 @@ | |||
1 | $! TX509.COM -- Tests x509 certificates | ||
2 | $ | ||
3 | $ __arch := VAX | ||
4 | $ if f$getsyi("cpu") .ge. 128 then __arch := AXP | ||
5 | $ exe_dir := sys$disk:[-.'__arch'.exe.apps] | ||
6 | $ | ||
7 | $ cmd := mcr 'exe_dir'openssl x509 | ||
8 | $ | ||
9 | $ t := testx509.pem | ||
10 | $ if p1 .nes. "" then t = p1 | ||
11 | $ | ||
12 | $ write sys$output "testing X509 conversions" | ||
13 | $ if f$search("fff.*") .nes "" then delete fff.*;* | ||
14 | $ if f$search("ff.*") .nes "" then delete ff.*;* | ||
15 | $ if f$search("f.*") .nes "" then delete f.*;* | ||
16 | $ convert/fdl=sys$input: 't' fff.p | ||
17 | RECORD | ||
18 | FORMAT STREAM_LF | ||
19 | $ | ||
20 | $ write sys$output "p -> d" | ||
21 | $ 'cmd' -in fff.p -inform p -outform d -out f.d | ||
22 | $ if $severity .ne. 1 then exit 3 | ||
23 | $ write sys$output "p -> n" | ||
24 | $ 'cmd' -in fff.p -inform p -outform n -out f.n | ||
25 | $ if $severity .ne. 1 then exit 3 | ||
26 | $ write sys$output "p -> p" | ||
27 | $ 'cmd' -in fff.p -inform p -outform p -out f.p | ||
28 | $ if $severity .ne. 1 then exit 3 | ||
29 | $ | ||
30 | $ write sys$output "d -> d" | ||
31 | $ 'cmd' -in f.d -inform d -outform d -out ff.d1 | ||
32 | $ if $severity .ne. 1 then exit 3 | ||
33 | $ write sys$output "n -> d" | ||
34 | $ 'cmd' -in f.n -inform n -outform d -out ff.d2 | ||
35 | $ if $severity .ne. 1 then exit 3 | ||
36 | $ write sys$output "p -> d" | ||
37 | $ 'cmd' -in f.p -inform p -outform d -out ff.d3 | ||
38 | $ if $severity .ne. 1 then exit 3 | ||
39 | $ | ||
40 | $ write sys$output "d -> n" | ||
41 | $ 'cmd' -in f.d -inform d -outform n -out ff.n1 | ||
42 | $ if $severity .ne. 1 then exit 3 | ||
43 | $ write sys$output "n -> n" | ||
44 | $ 'cmd' -in f.n -inform n -outform n -out ff.n2 | ||
45 | $ if $severity .ne. 1 then exit 3 | ||
46 | $ write sys$output "p -> n" | ||
47 | $ 'cmd' -in f.p -inform p -outform n -out ff.n3 | ||
48 | $ if $severity .ne. 1 then exit 3 | ||
49 | $ | ||
50 | $ write sys$output "d -> p" | ||
51 | $ 'cmd' -in f.d -inform d -outform p -out ff.p1 | ||
52 | $ if $severity .ne. 1 then exit 3 | ||
53 | $ write sys$output "n -> p" | ||
54 | $ 'cmd' -in f.n -inform n -outform p -out ff.p2 | ||
55 | $ if $severity .ne. 1 then exit 3 | ||
56 | $ write sys$output "p -> p" | ||
57 | $ 'cmd' -in f.p -inform p -outform p -out ff.p3 | ||
58 | $ if $severity .ne. 1 then exit 3 | ||
59 | $ | ||
60 | $ backup/compare fff.p f.p | ||
61 | $ if $severity .ne. 1 then exit 3 | ||
62 | $ backup/compare fff.p ff.p1 | ||
63 | $ if $severity .ne. 1 then exit 3 | ||
64 | $ backup/compare fff.p ff.p2 | ||
65 | $ if $severity .ne. 1 then exit 3 | ||
66 | $ backup/compare fff.p ff.p3 | ||
67 | $ if $severity .ne. 1 then exit 3 | ||
68 | $ | ||
69 | $ backup/compare f.n ff.n1 | ||
70 | $ if $severity .ne. 1 then exit 3 | ||
71 | $ backup/compare f.n ff.n2 | ||
72 | $ if $severity .ne. 1 then exit 3 | ||
73 | $ backup/compare f.n ff.n3 | ||
74 | $ if $severity .ne. 1 then exit 3 | ||
75 | $ | ||
76 | $ backup/compare f.p ff.p1 | ||
77 | $ if $severity .ne. 1 then exit 3 | ||
78 | $ backup/compare f.p ff.p2 | ||
79 | $ if $severity .ne. 1 then exit 3 | ||
80 | $ backup/compare f.p ff.p3 | ||
81 | $ if $severity .ne. 1 then exit 3 | ||
82 | $ | ||
83 | $ delete f.*;*,ff.*;*,fff.*;* | ||
diff --git a/src/lib/libssl/test/v3-cert1.pem b/src/lib/libssl/test/v3-cert1.pem new file mode 100644 index 0000000000..0da253d5c3 --- /dev/null +++ b/src/lib/libssl/test/v3-cert1.pem | |||
@@ -0,0 +1,16 @@ | |||
1 | -----BEGIN CERTIFICATE----- | ||
2 | MIICjTCCAfigAwIBAgIEMaYgRzALBgkqhkiG9w0BAQQwRTELMAkGA1UEBhMCVVMx | ||
3 | NjA0BgNVBAoTLU5hdGlvbmFsIEFlcm9uYXV0aWNzIGFuZCBTcGFjZSBBZG1pbmlz | ||
4 | dHJhdGlvbjAmFxE5NjA1MjgxMzQ5MDUrMDgwMBcROTgwNTI4MTM0OTA1KzA4MDAw | ||
5 | ZzELMAkGA1UEBhMCVVMxNjA0BgNVBAoTLU5hdGlvbmFsIEFlcm9uYXV0aWNzIGFu | ||
6 | ZCBTcGFjZSBBZG1pbmlzdHJhdGlvbjEgMAkGA1UEBRMCMTYwEwYDVQQDEwxTdGV2 | ||
7 | ZSBTY2hvY2gwWDALBgkqhkiG9w0BAQEDSQAwRgJBALrAwyYdgxmzNP/ts0Uyf6Bp | ||
8 | miJYktU/w4NG67ULaN4B5CnEz7k57s9o3YY3LecETgQ5iQHmkwlYDTL2fTgVfw0C | ||
9 | AQOjgaswgagwZAYDVR0ZAQH/BFowWDBWMFQxCzAJBgNVBAYTAlVTMTYwNAYDVQQK | ||
10 | Ey1OYXRpb25hbCBBZXJvbmF1dGljcyBhbmQgU3BhY2UgQWRtaW5pc3RyYXRpb24x | ||
11 | DTALBgNVBAMTBENSTDEwFwYDVR0BAQH/BA0wC4AJODMyOTcwODEwMBgGA1UdAgQR | ||
12 | MA8ECTgzMjk3MDgyM4ACBSAwDQYDVR0KBAYwBAMCBkAwCwYJKoZIhvcNAQEEA4GB | ||
13 | AH2y1VCEw/A4zaXzSYZJTTUi3uawbbFiS2yxHvgf28+8Js0OHXk1H1w2d6qOHH21 | ||
14 | X82tZXd/0JtG0g1T9usFFBDvYK8O0ebgz/P5ELJnBL2+atObEuJy1ZZ0pBDWINR3 | ||
15 | WkDNLCGiTkCKp0F5EWIrVDwh54NNevkCQRZita+z4IBO | ||
16 | -----END CERTIFICATE----- | ||
diff --git a/src/lib/libssl/test/v3-cert2.pem b/src/lib/libssl/test/v3-cert2.pem new file mode 100644 index 0000000000..de0723ff8d --- /dev/null +++ b/src/lib/libssl/test/v3-cert2.pem | |||
@@ -0,0 +1,16 @@ | |||
1 | -----BEGIN CERTIFICATE----- | ||
2 | MIICiTCCAfKgAwIBAgIEMeZfHzANBgkqhkiG9w0BAQQFADB9MQswCQYDVQQGEwJD | ||
3 | YTEPMA0GA1UEBxMGTmVwZWFuMR4wHAYDVQQLExVObyBMaWFiaWxpdHkgQWNjZXB0 | ||
4 | ZWQxHzAdBgNVBAoTFkZvciBEZW1vIFB1cnBvc2VzIE9ubHkxHDAaBgNVBAMTE0Vu | ||
5 | dHJ1c3QgRGVtbyBXZWIgQ0EwHhcNOTYwNzEyMTQyMDE1WhcNOTYxMDEyMTQyMDE1 | ||
6 | WjB0MSQwIgYJKoZIhvcNAQkBExVjb29rZUBpc3NsLmF0bC5ocC5jb20xCzAJBgNV | ||
7 | BAYTAlVTMScwJQYDVQQLEx5IZXdsZXR0IFBhY2thcmQgQ29tcGFueSAoSVNTTCkx | ||
8 | FjAUBgNVBAMTDVBhdWwgQS4gQ29va2UwXDANBgkqhkiG9w0BAQEFAANLADBIAkEA | ||
9 | 6ceSq9a9AU6g+zBwaL/yVmW1/9EE8s5you1mgjHnj0wAILuoB3L6rm6jmFRy7QZT | ||
10 | G43IhVZdDua4e+5/n1ZslwIDAQABo2MwYTARBglghkgBhvhCAQEEBAMCB4AwTAYJ | ||
11 | YIZIAYb4QgENBD8WPVRoaXMgY2VydGlmaWNhdGUgaXMgb25seSBpbnRlbmRlZCBm | ||
12 | b3IgZGVtb25zdHJhdGlvbiBwdXJwb3Nlcy4wDQYJKoZIhvcNAQEEBQADgYEAi8qc | ||
13 | F3zfFqy1sV8NhjwLVwOKuSfhR/Z8mbIEUeSTlnH3QbYt3HWZQ+vXI8mvtZoBc2Fz | ||
14 | lexKeIkAZXCesqGbs6z6nCt16P6tmdfbZF3I3AWzLquPcOXjPf4HgstkyvVBn0Ap | ||
15 | jAFN418KF/Cx4qyHB4cjdvLrRjjQLnb2+ibo7QU= | ||
16 | -----END CERTIFICATE----- | ||