diff options
Diffstat (limited to 'src/lib/libssl/test')
-rw-r--r-- | src/lib/libssl/test/CAss.cnf | 2 | ||||
-rw-r--r-- | src/lib/libssl/test/Makefile | 698 | ||||
-rw-r--r-- | src/lib/libssl/test/Uss.cnf | 2 | ||||
-rw-r--r-- | src/lib/libssl/test/dummytest.c | 48 | ||||
-rw-r--r-- | src/lib/libssl/test/evptests.txt | 321 | ||||
-rw-r--r-- | src/lib/libssl/test/igetest.c | 503 | ||||
-rw-r--r-- | src/lib/libssl/test/maketests.com | 926 | ||||
-rw-r--r-- | src/lib/libssl/test/tcrl.com | 85 | ||||
-rw-r--r-- | src/lib/libssl/test/test_aesni | 69 | ||||
-rw-r--r-- | src/lib/libssl/test/testca.com | 50 | ||||
-rw-r--r-- | src/lib/libssl/test/testenc.com | 63 | ||||
-rw-r--r-- | src/lib/libssl/test/testgen.com | 54 | ||||
-rw-r--r-- | src/lib/libssl/test/tests.com | 299 | ||||
-rw-r--r-- | src/lib/libssl/test/testss.com | 120 | ||||
-rw-r--r-- | src/lib/libssl/test/testssl.com | 206 | ||||
-rw-r--r-- | src/lib/libssl/test/testtsa.com | 248 | ||||
-rw-r--r-- | src/lib/libssl/test/tpkcs7.com | 56 | ||||
-rw-r--r-- | src/lib/libssl/test/tpkcs7d.com | 49 | ||||
-rw-r--r-- | src/lib/libssl/test/treq.com | 85 | ||||
-rw-r--r-- | src/lib/libssl/test/trsa.com | 96 | ||||
-rw-r--r-- | src/lib/libssl/test/tsid.com | 85 | ||||
-rw-r--r-- | src/lib/libssl/test/tverify.com | 63 | ||||
-rw-r--r-- | src/lib/libssl/test/tx509.com | 85 |
23 files changed, 4211 insertions, 2 deletions
diff --git a/src/lib/libssl/test/CAss.cnf b/src/lib/libssl/test/CAss.cnf index 20f8f05e3d..546e660626 100644 --- a/src/lib/libssl/test/CAss.cnf +++ b/src/lib/libssl/test/CAss.cnf | |||
@@ -7,7 +7,7 @@ RANDFILE = ./.rnd | |||
7 | 7 | ||
8 | #################################################################### | 8 | #################################################################### |
9 | [ req ] | 9 | [ req ] |
10 | default_bits = 512 | 10 | default_bits = 1024 |
11 | default_keyfile = keySS.pem | 11 | default_keyfile = keySS.pem |
12 | distinguished_name = req_distinguished_name | 12 | distinguished_name = req_distinguished_name |
13 | encrypt_rsa_key = no | 13 | encrypt_rsa_key = no |
diff --git a/src/lib/libssl/test/Makefile b/src/lib/libssl/test/Makefile new file mode 100644 index 0000000000..3912f82427 --- /dev/null +++ b/src/lib/libssl/test/Makefile | |||
@@ -0,0 +1,698 @@ | |||
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 | MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG) | ||
11 | PERL= perl | ||
12 | # KRB5 stuff | ||
13 | KRB5_INCLUDES= | ||
14 | LIBKRB5= | ||
15 | |||
16 | PEX_LIBS= | ||
17 | EX_LIBS= #-lnsl -lsocket | ||
18 | |||
19 | CFLAGS= $(INCLUDES) $(CFLAG) | ||
20 | |||
21 | GENERAL=Makefile maketests.com \ | ||
22 | tests.com testenc.com tx509.com trsa.com tcrl.com tsid.com treq.com \ | ||
23 | tpkcs7.com tpkcs7d.com tverify.com testgen.com testss.com testssl.com \ | ||
24 | testca.com VMSca-response.1 VMSca-response.2 | ||
25 | |||
26 | DLIBCRYPTO= ../libcrypto.a | ||
27 | DLIBSSL= ../libssl.a | ||
28 | LIBCRYPTO= -L.. -lcrypto | ||
29 | LIBSSL= -L.. -lssl | ||
30 | |||
31 | BNTEST= bntest | ||
32 | ECTEST= ectest | ||
33 | ECDSATEST= ecdsatest | ||
34 | ECDHTEST= ecdhtest | ||
35 | EXPTEST= exptest | ||
36 | IDEATEST= ideatest | ||
37 | SHATEST= shatest | ||
38 | SHA1TEST= sha1test | ||
39 | SHA256TEST= sha256t | ||
40 | SHA512TEST= sha512t | ||
41 | MDC2TEST= mdc2test | ||
42 | RMDTEST= rmdtest | ||
43 | MD2TEST= md2test | ||
44 | MD4TEST= md4test | ||
45 | MD5TEST= md5test | ||
46 | HMACTEST= hmactest | ||
47 | WPTEST= wp_test | ||
48 | RC2TEST= rc2test | ||
49 | RC4TEST= rc4test | ||
50 | RC5TEST= rc5test | ||
51 | BFTEST= bftest | ||
52 | CASTTEST= casttest | ||
53 | DESTEST= destest | ||
54 | RANDTEST= randtest | ||
55 | DHTEST= dhtest | ||
56 | DSATEST= dsatest | ||
57 | METHTEST= methtest | ||
58 | SSLTEST= ssltest | ||
59 | RSATEST= rsa_test | ||
60 | ENGINETEST= enginetest | ||
61 | EVPTEST= evp_test | ||
62 | IGETEST= igetest | ||
63 | JPAKETEST= jpaketest | ||
64 | ASN1TEST= asn1test | ||
65 | |||
66 | TESTS= alltests | ||
67 | |||
68 | EXE= $(BNTEST)$(EXE_EXT) $(ECTEST)$(EXE_EXT) $(ECDSATEST)$(EXE_EXT) $(ECDHTEST)$(EXE_EXT) $(IDEATEST)$(EXE_EXT) \ | ||
69 | $(MD2TEST)$(EXE_EXT) $(MD4TEST)$(EXE_EXT) $(MD5TEST)$(EXE_EXT) $(HMACTEST)$(EXE_EXT) $(WPTEST)$(EXE_EXT) \ | ||
70 | $(RC2TEST)$(EXE_EXT) $(RC4TEST)$(EXE_EXT) $(RC5TEST)$(EXE_EXT) \ | ||
71 | $(DESTEST)$(EXE_EXT) $(SHATEST)$(EXE_EXT) $(SHA1TEST)$(EXE_EXT) $(SHA256TEST)$(EXE_EXT) $(SHA512TEST)$(EXE_EXT) \ | ||
72 | $(MDC2TEST)$(EXE_EXT) $(RMDTEST)$(EXE_EXT) \ | ||
73 | $(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) $(RSATEST)$(EXE_EXT) \ | ||
75 | $(EVPTEST)$(EXE_EXT) $(IGETEST)$(EXE_EXT) $(JPAKETEST)$(EXE_EXT) \ | ||
76 | $(ASN1TEST)$(EXE_EXT) | ||
77 | |||
78 | # $(METHTEST)$(EXE_EXT) | ||
79 | |||
80 | OBJ= $(BNTEST).o $(ECTEST).o $(ECDSATEST).o $(ECDHTEST).o $(IDEATEST).o \ | ||
81 | $(MD2TEST).o $(MD4TEST).o $(MD5TEST).o \ | ||
82 | $(HMACTEST).o $(WPTEST).o \ | ||
83 | $(RC2TEST).o $(RC4TEST).o $(RC5TEST).o \ | ||
84 | $(DESTEST).o $(SHATEST).o $(SHA1TEST).o $(SHA256TEST).o $(SHA512TEST).o \ | ||
85 | $(MDC2TEST).o $(RMDTEST).o \ | ||
86 | $(RANDTEST).o $(DHTEST).o $(ENGINETEST).o $(CASTTEST).o \ | ||
87 | $(BFTEST).o $(SSLTEST).o $(DSATEST).o $(EXPTEST).o $(RSATEST).o \ | ||
88 | $(EVPTEST).o $(IGETEST).o $(JPAKETEST).o $(ASN1TEST).o | ||
89 | SRC= $(BNTEST).c $(ECTEST).c $(ECDSATEST).c $(ECDHTEST).c $(IDEATEST).c \ | ||
90 | $(MD2TEST).c $(MD4TEST).c $(MD5TEST).c \ | ||
91 | $(HMACTEST).c $(WPTEST).c \ | ||
92 | $(RC2TEST).c $(RC4TEST).c $(RC5TEST).c \ | ||
93 | $(DESTEST).c $(SHATEST).c $(SHA1TEST).c $(MDC2TEST).c $(RMDTEST).c \ | ||
94 | $(RANDTEST).c $(DHTEST).c $(ENGINETEST).c $(CASTTEST).c \ | ||
95 | $(BFTEST).c $(SSLTEST).c $(DSATEST).c $(EXPTEST).c $(RSATEST).c \ | ||
96 | $(EVPTEST).c $(IGETEST).c $(JPAKETEST).c $(ASN1TEST).c | ||
97 | |||
98 | EXHEADER= | ||
99 | HEADER= $(EXHEADER) | ||
100 | |||
101 | ALL= $(GENERAL) $(SRC) $(HEADER) | ||
102 | |||
103 | top: | ||
104 | (cd ..; $(MAKE) DIRS=$(DIR) TESTS=$(TESTS) all) | ||
105 | |||
106 | all: exe | ||
107 | |||
108 | exe: $(EXE) dummytest$(EXE_EXT) | ||
109 | |||
110 | files: | ||
111 | $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO | ||
112 | |||
113 | links: | ||
114 | |||
115 | generate: $(SRC) | ||
116 | $(SRC): | ||
117 | @sh $(TOP)/util/point.sh dummytest.c $@ | ||
118 | |||
119 | errors: | ||
120 | |||
121 | install: | ||
122 | |||
123 | tags: | ||
124 | ctags $(SRC) | ||
125 | |||
126 | tests: exe apps $(TESTS) | ||
127 | |||
128 | apps: | ||
129 | @(cd ..; $(MAKE) DIRS=apps all) | ||
130 | |||
131 | alltests: \ | ||
132 | test_des test_idea test_sha test_md4 test_md5 test_hmac \ | ||
133 | test_md2 test_mdc2 test_wp \ | ||
134 | test_rmd test_rc2 test_rc4 test_rc5 test_bf test_cast test_aes \ | ||
135 | test_rand test_bn test_ec test_ecdsa test_ecdh \ | ||
136 | test_enc test_x509 test_rsa test_crl test_sid \ | ||
137 | test_gen test_req test_pkcs7 test_verify test_dh test_dsa \ | ||
138 | test_ss test_ca test_engine test_evp test_ssl test_tsa test_ige \ | ||
139 | test_jpake test_cms | ||
140 | |||
141 | test_evp: | ||
142 | ../util/shlib_wrap.sh ./$(EVPTEST) evptests.txt | ||
143 | |||
144 | test_des: | ||
145 | ../util/shlib_wrap.sh ./$(DESTEST) | ||
146 | |||
147 | test_idea: | ||
148 | ../util/shlib_wrap.sh ./$(IDEATEST) | ||
149 | |||
150 | test_sha: | ||
151 | ../util/shlib_wrap.sh ./$(SHATEST) | ||
152 | ../util/shlib_wrap.sh ./$(SHA1TEST) | ||
153 | ../util/shlib_wrap.sh ./$(SHA256TEST) | ||
154 | ../util/shlib_wrap.sh ./$(SHA512TEST) | ||
155 | |||
156 | test_mdc2: | ||
157 | ../util/shlib_wrap.sh ./$(MDC2TEST) | ||
158 | |||
159 | test_md5: | ||
160 | ../util/shlib_wrap.sh ./$(MD5TEST) | ||
161 | |||
162 | test_md4: | ||
163 | ../util/shlib_wrap.sh ./$(MD4TEST) | ||
164 | |||
165 | test_hmac: | ||
166 | ../util/shlib_wrap.sh ./$(HMACTEST) | ||
167 | |||
168 | test_wp: | ||
169 | ../util/shlib_wrap.sh ./$(WPTEST) | ||
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 | |||
195 | test_enc: | ||
196 | @sh ./testenc | ||
197 | |||
198 | test_x509: | ||
199 | echo test normal x509v1 certificate | ||
200 | sh ./tx509 2>/dev/null | ||
201 | echo test first x509v3 certificate | ||
202 | sh ./tx509 v3-cert1.pem 2>/dev/null | ||
203 | echo test second x509v3 certificate | ||
204 | sh ./tx509 v3-cert2.pem 2>/dev/null | ||
205 | |||
206 | test_rsa: $(RSATEST)$(EXE_EXT) | ||
207 | @sh ./trsa 2>/dev/null | ||
208 | ../util/shlib_wrap.sh ./$(RSATEST) | ||
209 | |||
210 | test_crl: | ||
211 | @sh ./tcrl 2>/dev/null | ||
212 | |||
213 | test_sid: | ||
214 | @sh ./tsid 2>/dev/null | ||
215 | |||
216 | test_req: | ||
217 | @sh ./treq 2>/dev/null | ||
218 | @sh ./treq testreq2.pem 2>/dev/null | ||
219 | |||
220 | test_pkcs7: | ||
221 | @sh ./tpkcs7 2>/dev/null | ||
222 | @sh ./tpkcs7d 2>/dev/null | ||
223 | |||
224 | test_bn: | ||
225 | @echo starting big number library test, could take a while... | ||
226 | @../util/shlib_wrap.sh ./$(BNTEST) >tmp.bntest | ||
227 | @echo quit >>tmp.bntest | ||
228 | @echo "running bc" | ||
229 | @<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"' | ||
230 | @echo 'test a^b%c implementations' | ||
231 | ../util/shlib_wrap.sh ./$(EXPTEST) | ||
232 | |||
233 | test_ec: | ||
234 | @echo 'test elliptic curves' | ||
235 | ../util/shlib_wrap.sh ./$(ECTEST) | ||
236 | |||
237 | test_ecdsa: | ||
238 | @echo 'test ecdsa' | ||
239 | ../util/shlib_wrap.sh ./$(ECDSATEST) | ||
240 | |||
241 | test_ecdh: | ||
242 | @echo 'test ecdh' | ||
243 | ../util/shlib_wrap.sh ./$(ECDHTEST) | ||
244 | |||
245 | test_verify: | ||
246 | @echo "The following command should have some OK's and some failures" | ||
247 | @echo "There are definitly a few expired certificates" | ||
248 | ../util/shlib_wrap.sh ../apps/openssl verify -CApath ../certs ../certs/*.pem | ||
249 | |||
250 | test_dh: | ||
251 | @echo "Generate a set of DH parameters" | ||
252 | ../util/shlib_wrap.sh ./$(DHTEST) | ||
253 | |||
254 | test_dsa: | ||
255 | @echo "Generate a set of DSA parameters" | ||
256 | ../util/shlib_wrap.sh ./$(DSATEST) | ||
257 | ../util/shlib_wrap.sh ./$(DSATEST) -app2_1 | ||
258 | |||
259 | test_gen: | ||
260 | @echo "Generate and verify a certificate request" | ||
261 | @sh ./testgen | ||
262 | |||
263 | test_ss keyU.ss certU.ss certCA.ss certP1.ss keyP1.ss certP2.ss keyP2.ss \ | ||
264 | intP1.ss intP2.ss: testss | ||
265 | @echo "Generate and certify a test certificate" | ||
266 | @sh ./testss | ||
267 | @cat certCA.ss certU.ss > intP1.ss | ||
268 | @cat certCA.ss certU.ss certP1.ss > intP2.ss | ||
269 | |||
270 | test_engine: | ||
271 | @echo "Manipulate the ENGINE structures" | ||
272 | ../util/shlib_wrap.sh ./$(ENGINETEST) | ||
273 | |||
274 | test_ssl: keyU.ss certU.ss certCA.ss certP1.ss keyP1.ss certP2.ss keyP2.ss \ | ||
275 | intP1.ss intP2.ss | ||
276 | @echo "test SSL protocol" | ||
277 | ../util/shlib_wrap.sh ./$(SSLTEST) -test_cipherlist | ||
278 | @sh ./testssl keyU.ss certU.ss certCA.ss | ||
279 | @sh ./testsslproxy keyP1.ss certP1.ss intP1.ss | ||
280 | @sh ./testsslproxy keyP2.ss certP2.ss intP2.ss | ||
281 | |||
282 | test_ca: | ||
283 | @if ../util/shlib_wrap.sh ../apps/openssl no-rsa; then \ | ||
284 | echo "skipping CA.sh test -- requires RSA"; \ | ||
285 | else \ | ||
286 | echo "Generate and certify a test certificate via the 'ca' program"; \ | ||
287 | sh ./testca; \ | ||
288 | fi | ||
289 | |||
290 | test_aes: #$(AESTEST) | ||
291 | # @echo "test Rijndael" | ||
292 | # ../util/shlib_wrap.sh ./$(AESTEST) | ||
293 | |||
294 | test_tsa: | ||
295 | @if ../util/shlib_wrap.sh ../apps/openssl no-rsa; then \ | ||
296 | echo "skipping testtsa test -- requires RSA"; \ | ||
297 | else \ | ||
298 | sh ./testtsa; \ | ||
299 | fi | ||
300 | |||
301 | test_ige: $(IGETEST)$(EXE_EXT) | ||
302 | @echo "Test IGE mode" | ||
303 | ../util/shlib_wrap.sh ./$(IGETEST) | ||
304 | |||
305 | test_jpake: $(JPAKETEST)$(EXE_EXT) | ||
306 | @echo "Test JPAKE" | ||
307 | ../util/shlib_wrap.sh ./$(JPAKETEST) | ||
308 | |||
309 | test_cms: | ||
310 | @echo "CMS consistency test" | ||
311 | $(PERL) cms-test.pl | ||
312 | |||
313 | lint: | ||
314 | lint -DLINT $(INCLUDES) $(SRC)>fluff | ||
315 | |||
316 | depend: | ||
317 | @if [ -z "$(THIS)" ]; then \ | ||
318 | $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; \ | ||
319 | else \ | ||
320 | $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(SRC); \ | ||
321 | fi | ||
322 | |||
323 | dclean: | ||
324 | $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new | ||
325 | mv -f Makefile.new $(MAKEFILE) | ||
326 | rm -f $(SRC) $(SHA256TEST).c $(SHA512TEST).c evptests.txt newkey.pem testkey.pem \ | ||
327 | testreq.pem | ||
328 | |||
329 | clean: | ||
330 | rm -f .rnd tmp.bntest tmp.bctest *.o *.obj *.dll lib tags core .pure .nfs* *.old *.bak fluff $(EXE) *.ss *.srl log dummytest | ||
331 | |||
332 | $(DLIBSSL): | ||
333 | (cd ..; $(MAKE) DIRS=ssl all) | ||
334 | |||
335 | $(DLIBCRYPTO): | ||
336 | (cd ..; $(MAKE) DIRS=crypto all) | ||
337 | |||
338 | BUILD_CMD=shlib_target=; if [ -n "$(SHARED_LIBS)" ]; then \ | ||
339 | shlib_target="$(SHLIB_TARGET)"; \ | ||
340 | fi; \ | ||
341 | LIBRARIES="$(LIBSSL) $(LIBCRYPTO) $(LIBKRB5)"; \ | ||
342 | $(MAKE) -f $(TOP)/Makefile.shared -e \ | ||
343 | APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o" \ | ||
344 | LIBDEPS="$(PEX_LIBS) $$LIBRARIES $(EX_LIBS)" \ | ||
345 | link_app.$${shlib_target} | ||
346 | |||
347 | $(RSATEST)$(EXE_EXT): $(RSATEST).o $(DLIBCRYPTO) | ||
348 | @target=$(RSATEST); $(BUILD_CMD) | ||
349 | |||
350 | $(BNTEST)$(EXE_EXT): $(BNTEST).o $(DLIBCRYPTO) | ||
351 | @target=$(BNTEST); $(BUILD_CMD) | ||
352 | |||
353 | $(ECTEST)$(EXE_EXT): $(ECTEST).o $(DLIBCRYPTO) | ||
354 | @target=$(ECTEST); $(BUILD_CMD) | ||
355 | |||
356 | $(EXPTEST)$(EXE_EXT): $(EXPTEST).o $(DLIBCRYPTO) | ||
357 | @target=$(EXPTEST); $(BUILD_CMD) | ||
358 | |||
359 | $(IDEATEST)$(EXE_EXT): $(IDEATEST).o $(DLIBCRYPTO) | ||
360 | @target=$(IDEATEST); $(BUILD_CMD) | ||
361 | |||
362 | $(MD2TEST)$(EXE_EXT): $(MD2TEST).o $(DLIBCRYPTO) | ||
363 | @target=$(MD2TEST); $(BUILD_CMD) | ||
364 | |||
365 | $(SHATEST)$(EXE_EXT): $(SHATEST).o $(DLIBCRYPTO) | ||
366 | @target=$(SHATEST); $(BUILD_CMD) | ||
367 | |||
368 | $(SHA1TEST)$(EXE_EXT): $(SHA1TEST).o $(DLIBCRYPTO) | ||
369 | @target=$(SHA1TEST); $(BUILD_CMD) | ||
370 | |||
371 | $(SHA256TEST)$(EXE_EXT): $(SHA256TEST).o $(DLIBCRYPTO) | ||
372 | @target=$(SHA256TEST); $(BUILD_CMD) | ||
373 | |||
374 | $(SHA512TEST)$(EXE_EXT): $(SHA512TEST).o $(DLIBCRYPTO) | ||
375 | @target=$(SHA512TEST); $(BUILD_CMD) | ||
376 | |||
377 | $(RMDTEST)$(EXE_EXT): $(RMDTEST).o $(DLIBCRYPTO) | ||
378 | @target=$(RMDTEST); $(BUILD_CMD) | ||
379 | |||
380 | $(MDC2TEST)$(EXE_EXT): $(MDC2TEST).o $(DLIBCRYPTO) | ||
381 | @target=$(MDC2TEST); $(BUILD_CMD) | ||
382 | |||
383 | $(MD4TEST)$(EXE_EXT): $(MD4TEST).o $(DLIBCRYPTO) | ||
384 | @target=$(MD4TEST); $(BUILD_CMD) | ||
385 | |||
386 | $(MD5TEST)$(EXE_EXT): $(MD5TEST).o $(DLIBCRYPTO) | ||
387 | @target=$(MD5TEST); $(BUILD_CMD) | ||
388 | |||
389 | $(HMACTEST)$(EXE_EXT): $(HMACTEST).o $(DLIBCRYPTO) | ||
390 | @target=$(HMACTEST); $(BUILD_CMD) | ||
391 | |||
392 | $(WPTEST)$(EXE_EXT): $(WPTEST).o $(DLIBCRYPTO) | ||
393 | @target=$(WPTEST); $(BUILD_CMD) | ||
394 | |||
395 | $(RC2TEST)$(EXE_EXT): $(RC2TEST).o $(DLIBCRYPTO) | ||
396 | @target=$(RC2TEST); $(BUILD_CMD) | ||
397 | |||
398 | $(BFTEST)$(EXE_EXT): $(BFTEST).o $(DLIBCRYPTO) | ||
399 | @target=$(BFTEST); $(BUILD_CMD) | ||
400 | |||
401 | $(CASTTEST)$(EXE_EXT): $(CASTTEST).o $(DLIBCRYPTO) | ||
402 | @target=$(CASTTEST); $(BUILD_CMD) | ||
403 | |||
404 | $(RC4TEST)$(EXE_EXT): $(RC4TEST).o $(DLIBCRYPTO) | ||
405 | @target=$(RC4TEST); $(BUILD_CMD) | ||
406 | |||
407 | $(RC5TEST)$(EXE_EXT): $(RC5TEST).o $(DLIBCRYPTO) | ||
408 | @target=$(RC5TEST); $(BUILD_CMD) | ||
409 | |||
410 | $(DESTEST)$(EXE_EXT): $(DESTEST).o $(DLIBCRYPTO) | ||
411 | @target=$(DESTEST); $(BUILD_CMD) | ||
412 | |||
413 | $(RANDTEST)$(EXE_EXT): $(RANDTEST).o $(DLIBCRYPTO) | ||
414 | @target=$(RANDTEST); $(BUILD_CMD) | ||
415 | |||
416 | $(DHTEST)$(EXE_EXT): $(DHTEST).o $(DLIBCRYPTO) | ||
417 | @target=$(DHTEST); $(BUILD_CMD) | ||
418 | |||
419 | $(DSATEST)$(EXE_EXT): $(DSATEST).o $(DLIBCRYPTO) | ||
420 | @target=$(DSATEST); $(BUILD_CMD) | ||
421 | |||
422 | $(METHTEST)$(EXE_EXT): $(METHTEST).o $(DLIBCRYPTO) | ||
423 | @target=$(METHTEST); $(BUILD_CMD) | ||
424 | |||
425 | $(SSLTEST)$(EXE_EXT): $(SSLTEST).o $(DLIBSSL) $(DLIBCRYPTO) | ||
426 | @target=$(SSLTEST); $(BUILD_CMD) | ||
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 | $(ECDSATEST)$(EXE_EXT): $(ECDSATEST).o $(DLIBCRYPTO) | ||
435 | @target=$(ECDSATEST); $(BUILD_CMD) | ||
436 | |||
437 | $(ECDHTEST)$(EXE_EXT): $(ECDHTEST).o $(DLIBCRYPTO) | ||
438 | @target=$(ECDHTEST); $(BUILD_CMD) | ||
439 | |||
440 | $(IGETEST)$(EXE_EXT): $(IGETEST).o $(DLIBCRYPTO) | ||
441 | @target=$(IGETEST); $(BUILD_CMD) | ||
442 | |||
443 | $(JPAKETEST)$(EXE_EXT): $(JPAKETEST).o $(DLIBCRYPTO) | ||
444 | @target=$(JPAKETEST); $(BUILD_CMD) | ||
445 | |||
446 | $(ASN1TEST)$(EXE_EXT): $(ASN1TEST).o $(DLIBCRYPTO) | ||
447 | @target=$(ASN1TEST); $(BUILD_CMD) | ||
448 | |||
449 | #$(AESTEST).o: $(AESTEST).c | ||
450 | # $(CC) -c $(CFLAGS) -DINTERMEDIATE_VALUE_KAT -DTRACE_KAT_MCT $(AESTEST).c | ||
451 | |||
452 | #$(AESTEST)$(EXE_EXT): $(AESTEST).o $(DLIBCRYPTO) | ||
453 | # if [ "$(SHLIB_TARGET)" = "hpux-shared" -o "$(SHLIB_TARGET)" = "darwin-shared" ] ; then \ | ||
454 | # $(CC) -o $(AESTEST)$(EXE_EXT) $(CFLAGS) $(AESTEST).o $(PEX_LIBS) $(DLIBCRYPTO) $(EX_LIBS) ; \ | ||
455 | # else \ | ||
456 | # $(CC) -o $(AESTEST)$(EXE_EXT) $(CFLAGS) $(AESTEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) ; \ | ||
457 | # fi | ||
458 | |||
459 | dummytest$(EXE_EXT): dummytest.o $(DLIBCRYPTO) | ||
460 | @target=dummytest; $(BUILD_CMD) | ||
461 | |||
462 | # DO NOT DELETE THIS LINE -- make depend depends on it. | ||
463 | |||
464 | asn1test.o: ../include/openssl/asn1.h ../include/openssl/asn1_mac.h | ||
465 | asn1test.o: ../include/openssl/bio.h ../include/openssl/buffer.h | ||
466 | asn1test.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h | ||
467 | asn1test.o: ../include/openssl/ec.h ../include/openssl/ecdh.h | ||
468 | asn1test.o: ../include/openssl/ecdsa.h ../include/openssl/evp.h | ||
469 | asn1test.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h | ||
470 | asn1test.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h | ||
471 | asn1test.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | ||
472 | asn1test.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h | ||
473 | asn1test.o: ../include/openssl/sha.h ../include/openssl/stack.h | ||
474 | asn1test.o: ../include/openssl/symhacks.h ../include/openssl/x509.h | ||
475 | asn1test.o: ../include/openssl/x509_vfy.h asn1test.c | ||
476 | bftest.o: ../e_os.h ../include/openssl/blowfish.h ../include/openssl/e_os2.h | ||
477 | bftest.o: ../include/openssl/opensslconf.h bftest.c | ||
478 | bntest.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | ||
479 | bntest.o: ../include/openssl/bn.h ../include/openssl/buffer.h | ||
480 | bntest.o: ../include/openssl/crypto.h ../include/openssl/dh.h | ||
481 | bntest.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h | ||
482 | bntest.o: ../include/openssl/ec.h ../include/openssl/ecdh.h | ||
483 | bntest.o: ../include/openssl/ecdsa.h ../include/openssl/err.h | ||
484 | bntest.o: ../include/openssl/evp.h ../include/openssl/lhash.h | ||
485 | bntest.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h | ||
486 | bntest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
487 | bntest.o: ../include/openssl/ossl_typ.h ../include/openssl/pkcs7.h | ||
488 | bntest.o: ../include/openssl/rand.h ../include/openssl/rsa.h | ||
489 | bntest.o: ../include/openssl/safestack.h ../include/openssl/sha.h | ||
490 | bntest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | ||
491 | bntest.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h bntest.c | ||
492 | casttest.o: ../e_os.h ../include/openssl/cast.h ../include/openssl/e_os2.h | ||
493 | casttest.o: ../include/openssl/opensslconf.h casttest.c | ||
494 | destest.o: ../include/openssl/des.h ../include/openssl/des_old.h | ||
495 | destest.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h | ||
496 | destest.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h | ||
497 | destest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | ||
498 | destest.o: ../include/openssl/ui.h ../include/openssl/ui_compat.h destest.c | ||
499 | dhtest.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/bn.h | ||
500 | dhtest.o: ../include/openssl/crypto.h ../include/openssl/dh.h | ||
501 | dhtest.o: ../include/openssl/e_os2.h ../include/openssl/err.h | ||
502 | dhtest.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h | ||
503 | dhtest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | ||
504 | dhtest.o: ../include/openssl/rand.h ../include/openssl/safestack.h | ||
505 | dhtest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h dhtest.c | ||
506 | dsatest.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/bn.h | ||
507 | dsatest.o: ../include/openssl/crypto.h ../include/openssl/dh.h | ||
508 | dsatest.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h | ||
509 | dsatest.o: ../include/openssl/err.h ../include/openssl/lhash.h | ||
510 | dsatest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
511 | dsatest.o: ../include/openssl/ossl_typ.h ../include/openssl/rand.h | ||
512 | dsatest.o: ../include/openssl/safestack.h ../include/openssl/stack.h | ||
513 | dsatest.o: ../include/openssl/symhacks.h dsatest.c | ||
514 | ecdhtest.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | ||
515 | ecdhtest.o: ../include/openssl/bn.h ../include/openssl/crypto.h | ||
516 | ecdhtest.o: ../include/openssl/e_os2.h ../include/openssl/ec.h | ||
517 | ecdhtest.o: ../include/openssl/ecdh.h ../include/openssl/err.h | ||
518 | ecdhtest.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h | ||
519 | ecdhtest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h | ||
520 | ecdhtest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | ||
521 | ecdhtest.o: ../include/openssl/rand.h ../include/openssl/safestack.h | ||
522 | ecdhtest.o: ../include/openssl/sha.h ../include/openssl/stack.h | ||
523 | ecdhtest.o: ../include/openssl/symhacks.h ecdhtest.c | ||
524 | ecdsatest.o: ../include/openssl/asn1.h ../include/openssl/bio.h | ||
525 | ecdsatest.o: ../include/openssl/bn.h ../include/openssl/buffer.h | ||
526 | ecdsatest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h | ||
527 | ecdsatest.o: ../include/openssl/ec.h ../include/openssl/ecdh.h | ||
528 | ecdsatest.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h | ||
529 | ecdsatest.o: ../include/openssl/err.h ../include/openssl/evp.h | ||
530 | ecdsatest.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h | ||
531 | ecdsatest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h | ||
532 | ecdsatest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | ||
533 | ecdsatest.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h | ||
534 | ecdsatest.o: ../include/openssl/safestack.h ../include/openssl/sha.h | ||
535 | ecdsatest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | ||
536 | ecdsatest.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h | ||
537 | ecdsatest.o: ecdsatest.c | ||
538 | ectest.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | ||
539 | ectest.o: ../include/openssl/bn.h ../include/openssl/buffer.h | ||
540 | ectest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h | ||
541 | ectest.o: ../include/openssl/ec.h ../include/openssl/ecdh.h | ||
542 | ectest.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h | ||
543 | ectest.o: ../include/openssl/err.h ../include/openssl/evp.h | ||
544 | ectest.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h | ||
545 | ectest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h | ||
546 | ectest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | ||
547 | ectest.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h | ||
548 | ectest.o: ../include/openssl/safestack.h ../include/openssl/sha.h | ||
549 | ectest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | ||
550 | ectest.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h ectest.c | ||
551 | enginetest.o: ../include/openssl/asn1.h ../include/openssl/bio.h | ||
552 | enginetest.o: ../include/openssl/buffer.h ../include/openssl/crypto.h | ||
553 | enginetest.o: ../include/openssl/e_os2.h ../include/openssl/ec.h | ||
554 | enginetest.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h | ||
555 | enginetest.o: ../include/openssl/engine.h ../include/openssl/err.h | ||
556 | enginetest.o: ../include/openssl/evp.h ../include/openssl/lhash.h | ||
557 | enginetest.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h | ||
558 | enginetest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
559 | enginetest.o: ../include/openssl/ossl_typ.h ../include/openssl/pkcs7.h | ||
560 | enginetest.o: ../include/openssl/safestack.h ../include/openssl/sha.h | ||
561 | enginetest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | ||
562 | enginetest.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h | ||
563 | enginetest.o: enginetest.c | ||
564 | evp_test.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | ||
565 | evp_test.o: ../include/openssl/buffer.h ../include/openssl/conf.h | ||
566 | evp_test.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h | ||
567 | evp_test.o: ../include/openssl/ec.h ../include/openssl/ecdh.h | ||
568 | evp_test.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h | ||
569 | evp_test.o: ../include/openssl/err.h ../include/openssl/evp.h | ||
570 | evp_test.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h | ||
571 | evp_test.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h | ||
572 | evp_test.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | ||
573 | evp_test.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h | ||
574 | evp_test.o: ../include/openssl/sha.h ../include/openssl/stack.h | ||
575 | evp_test.o: ../include/openssl/symhacks.h ../include/openssl/x509.h | ||
576 | evp_test.o: ../include/openssl/x509_vfy.h evp_test.c | ||
577 | exptest.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/bn.h | ||
578 | exptest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h | ||
579 | exptest.o: ../include/openssl/err.h ../include/openssl/lhash.h | ||
580 | exptest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
581 | exptest.o: ../include/openssl/ossl_typ.h ../include/openssl/rand.h | ||
582 | exptest.o: ../include/openssl/safestack.h ../include/openssl/stack.h | ||
583 | exptest.o: ../include/openssl/symhacks.h exptest.c | ||
584 | hmactest.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | ||
585 | hmactest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h | ||
586 | hmactest.o: ../include/openssl/evp.h ../include/openssl/hmac.h | ||
587 | hmactest.o: ../include/openssl/md5.h ../include/openssl/obj_mac.h | ||
588 | hmactest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h | ||
589 | hmactest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | ||
590 | hmactest.o: ../include/openssl/safestack.h ../include/openssl/stack.h | ||
591 | hmactest.o: ../include/openssl/symhacks.h hmactest.c | ||
592 | ideatest.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/idea.h | ||
593 | ideatest.o: ../include/openssl/opensslconf.h ideatest.c | ||
594 | igetest.o: ../include/openssl/aes.h ../include/openssl/e_os2.h | ||
595 | igetest.o: ../include/openssl/opensslconf.h ../include/openssl/ossl_typ.h | ||
596 | igetest.o: ../include/openssl/rand.h igetest.c | ||
597 | jpaketest.o: ../include/openssl/buffer.h ../include/openssl/crypto.h | ||
598 | jpaketest.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h | ||
599 | jpaketest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | ||
600 | jpaketest.o: ../include/openssl/safestack.h ../include/openssl/stack.h | ||
601 | jpaketest.o: ../include/openssl/symhacks.h jpaketest.c | ||
602 | md2test.o: ../include/openssl/buffer.h ../include/openssl/crypto.h | ||
603 | md2test.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h | ||
604 | md2test.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | ||
605 | md2test.o: ../include/openssl/safestack.h ../include/openssl/stack.h | ||
606 | md2test.o: ../include/openssl/symhacks.h md2test.c | ||
607 | md4test.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | ||
608 | md4test.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h | ||
609 | md4test.o: ../include/openssl/evp.h ../include/openssl/md4.h | ||
610 | md4test.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h | ||
611 | md4test.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
612 | md4test.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h | ||
613 | md4test.o: ../include/openssl/stack.h ../include/openssl/symhacks.h md4test.c | ||
614 | md5test.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | ||
615 | md5test.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h | ||
616 | md5test.o: ../include/openssl/evp.h ../include/openssl/md5.h | ||
617 | md5test.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h | ||
618 | md5test.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
619 | md5test.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h | ||
620 | md5test.o: ../include/openssl/stack.h ../include/openssl/symhacks.h md5test.c | ||
621 | mdc2test.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | ||
622 | mdc2test.o: ../include/openssl/crypto.h ../include/openssl/des.h | ||
623 | mdc2test.o: ../include/openssl/des_old.h ../include/openssl/e_os2.h | ||
624 | mdc2test.o: ../include/openssl/evp.h ../include/openssl/mdc2.h | ||
625 | mdc2test.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h | ||
626 | mdc2test.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
627 | mdc2test.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h | ||
628 | mdc2test.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | ||
629 | mdc2test.o: ../include/openssl/ui.h ../include/openssl/ui_compat.h mdc2test.c | ||
630 | randtest.o: ../e_os.h ../include/openssl/e_os2.h | ||
631 | randtest.o: ../include/openssl/opensslconf.h ../include/openssl/ossl_typ.h | ||
632 | randtest.o: ../include/openssl/rand.h randtest.c | ||
633 | rc2test.o: ../e_os.h ../include/openssl/e_os2.h | ||
634 | rc2test.o: ../include/openssl/opensslconf.h ../include/openssl/rc2.h rc2test.c | ||
635 | rc4test.o: ../e_os.h ../include/openssl/e_os2.h | ||
636 | rc4test.o: ../include/openssl/opensslconf.h ../include/openssl/rc4.h | ||
637 | rc4test.o: ../include/openssl/sha.h rc4test.c | ||
638 | rc5test.o: ../include/openssl/buffer.h ../include/openssl/crypto.h | ||
639 | rc5test.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h | ||
640 | rc5test.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | ||
641 | rc5test.o: ../include/openssl/safestack.h ../include/openssl/stack.h | ||
642 | rc5test.o: ../include/openssl/symhacks.h rc5test.c | ||
643 | rmdtest.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | ||
644 | rmdtest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h | ||
645 | rmdtest.o: ../include/openssl/evp.h ../include/openssl/obj_mac.h | ||
646 | rmdtest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h | ||
647 | rmdtest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | ||
648 | rmdtest.o: ../include/openssl/ripemd.h ../include/openssl/safestack.h | ||
649 | rmdtest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h rmdtest.c | ||
650 | rsa_test.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | ||
651 | rsa_test.o: ../include/openssl/bn.h ../include/openssl/crypto.h | ||
652 | rsa_test.o: ../include/openssl/e_os2.h ../include/openssl/err.h | ||
653 | rsa_test.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h | ||
654 | rsa_test.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | ||
655 | rsa_test.o: ../include/openssl/rand.h ../include/openssl/rsa.h | ||
656 | rsa_test.o: ../include/openssl/safestack.h ../include/openssl/stack.h | ||
657 | rsa_test.o: ../include/openssl/symhacks.h rsa_test.c | ||
658 | sha1test.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | ||
659 | sha1test.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h | ||
660 | sha1test.o: ../include/openssl/evp.h ../include/openssl/obj_mac.h | ||
661 | sha1test.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h | ||
662 | sha1test.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | ||
663 | sha1test.o: ../include/openssl/safestack.h ../include/openssl/sha.h | ||
664 | sha1test.o: ../include/openssl/stack.h ../include/openssl/symhacks.h sha1test.c | ||
665 | shatest.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | ||
666 | shatest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h | ||
667 | shatest.o: ../include/openssl/evp.h ../include/openssl/obj_mac.h | ||
668 | shatest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h | ||
669 | shatest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | ||
670 | shatest.o: ../include/openssl/safestack.h ../include/openssl/sha.h | ||
671 | shatest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h shatest.c | ||
672 | ssltest.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | ||
673 | ssltest.o: ../include/openssl/bn.h ../include/openssl/buffer.h | ||
674 | ssltest.o: ../include/openssl/comp.h ../include/openssl/conf.h | ||
675 | ssltest.o: ../include/openssl/crypto.h ../include/openssl/dh.h | ||
676 | ssltest.o: ../include/openssl/dsa.h ../include/openssl/dtls1.h | ||
677 | ssltest.o: ../include/openssl/e_os2.h ../include/openssl/ec.h | ||
678 | ssltest.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h | ||
679 | ssltest.o: ../include/openssl/engine.h ../include/openssl/err.h | ||
680 | ssltest.o: ../include/openssl/evp.h ../include/openssl/hmac.h | ||
681 | ssltest.o: ../include/openssl/kssl.h ../include/openssl/lhash.h | ||
682 | ssltest.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h | ||
683 | ssltest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
684 | ssltest.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | ||
685 | ssltest.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | ||
686 | ssltest.o: ../include/openssl/pqueue.h ../include/openssl/rand.h | ||
687 | ssltest.o: ../include/openssl/rsa.h ../include/openssl/safestack.h | ||
688 | ssltest.o: ../include/openssl/sha.h ../include/openssl/ssl.h | ||
689 | ssltest.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h | ||
690 | ssltest.o: ../include/openssl/ssl3.h ../include/openssl/stack.h | ||
691 | ssltest.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h | ||
692 | ssltest.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h | ||
693 | ssltest.o: ../include/openssl/x509v3.h ssltest.c | ||
694 | wp_test.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h | ||
695 | wp_test.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
696 | wp_test.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h | ||
697 | wp_test.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | ||
698 | wp_test.o: ../include/openssl/whrlpool.h wp_test.c | ||
diff --git a/src/lib/libssl/test/Uss.cnf b/src/lib/libssl/test/Uss.cnf index 0c0ebb5f67..98b2e054b7 100644 --- a/src/lib/libssl/test/Uss.cnf +++ b/src/lib/libssl/test/Uss.cnf | |||
@@ -7,7 +7,7 @@ RANDFILE = ./.rnd | |||
7 | 7 | ||
8 | #################################################################### | 8 | #################################################################### |
9 | [ req ] | 9 | [ req ] |
10 | default_bits = 512 | 10 | default_bits = 1024 |
11 | default_keyfile = keySS.pem | 11 | default_keyfile = keySS.pem |
12 | distinguished_name = req_distinguished_name | 12 | distinguished_name = req_distinguished_name |
13 | encrypt_rsa_key = no | 13 | encrypt_rsa_key = no |
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/evptests.txt b/src/lib/libssl/test/evptests.txt new file mode 100644 index 0000000000..beb12144b6 --- /dev/null +++ b/src/lib/libssl/test/evptests.txt | |||
@@ -0,0 +1,321 @@ | |||
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 | # We don't support CFB{1,8}-AESxxx.{En,De}crypt | ||
96 | # For all CFB128 encrypts and decrypts, the transformed sequence is | ||
97 | # AES-bits-CFB:key:IV/ciphertext':plaintext:ciphertext:encdec | ||
98 | # CFB128-AES128.Encrypt | ||
99 | AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:3B3FD92EB72DAD20333449F8E83CFB4A:1 | ||
100 | AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:3B3FD92EB72DAD20333449F8E83CFB4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:C8A64537A0B3A93FCDE3CDAD9F1CE58B:1 | ||
101 | AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:C8A64537A0B3A93FCDE3CDAD9F1CE58B:30C81C46A35CE411E5FBC1191A0A52EF:26751F67A3CBB140B1808CF187A4F4DF:1 | ||
102 | AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:26751F67A3CBB140B1808CF187A4F4DF:F69F2445DF4F9B17AD2B417BE66C3710:C04B05357C5D1C0EEAC4C66F9FF7F2E6:1 | ||
103 | # CFB128-AES128.Decrypt | ||
104 | AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:3B3FD92EB72DAD20333449F8E83CFB4A:0 | ||
105 | AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:3B3FD92EB72DAD20333449F8E83CFB4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:C8A64537A0B3A93FCDE3CDAD9F1CE58B:0 | ||
106 | AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:C8A64537A0B3A93FCDE3CDAD9F1CE58B:30C81C46A35CE411E5FBC1191A0A52EF:26751F67A3CBB140B1808CF187A4F4DF:0 | ||
107 | AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:26751F67A3CBB140B1808CF187A4F4DF:F69F2445DF4F9B17AD2B417BE66C3710:C04B05357C5D1C0EEAC4C66F9FF7F2E6:0 | ||
108 | # CFB128-AES192.Encrypt | ||
109 | AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CDC80D6FDDF18CAB34C25909C99A4174:1 | ||
110 | AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:CDC80D6FDDF18CAB34C25909C99A4174:AE2D8A571E03AC9C9EB76FAC45AF8E51:67CE7F7F81173621961A2B70171D3D7A:1 | ||
111 | AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:67CE7F7F81173621961A2B70171D3D7A:30C81C46A35CE411E5FBC1191A0A52EF:2E1E8A1DD59B88B1C8E60FED1EFAC4C9:1 | ||
112 | AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:2E1E8A1DD59B88B1C8E60FED1EFAC4C9:F69F2445DF4F9B17AD2B417BE66C3710:C05F9F9CA9834FA042AE8FBA584B09FF:1 | ||
113 | # CFB128-AES192.Decrypt | ||
114 | AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CDC80D6FDDF18CAB34C25909C99A4174:0 | ||
115 | AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:CDC80D6FDDF18CAB34C25909C99A4174:AE2D8A571E03AC9C9EB76FAC45AF8E51:67CE7F7F81173621961A2B70171D3D7A:0 | ||
116 | AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:67CE7F7F81173621961A2B70171D3D7A:30C81C46A35CE411E5FBC1191A0A52EF:2E1E8A1DD59B88B1C8E60FED1EFAC4C9:0 | ||
117 | AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:2E1E8A1DD59B88B1C8E60FED1EFAC4C9:F69F2445DF4F9B17AD2B417BE66C3710:C05F9F9CA9834FA042AE8FBA584B09FF:0 | ||
118 | # CFB128-AES256.Encrypt | ||
119 | AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:DC7E84BFDA79164B7ECD8486985D3860:1 | ||
120 | AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:DC7E84BFDA79164B7ECD8486985D3860:AE2D8A571E03AC9C9EB76FAC45AF8E51:39FFED143B28B1C832113C6331E5407B:1 | ||
121 | AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:39FFED143B28B1C832113C6331E5407B:30C81C46A35CE411E5FBC1191A0A52EF:DF10132415E54B92A13ED0A8267AE2F9:1 | ||
122 | AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:DF10132415E54B92A13ED0A8267AE2F9:F69F2445DF4F9B17AD2B417BE66C3710:75A385741AB9CEF82031623D55B1E471:1 | ||
123 | # CFB128-AES256.Decrypt | ||
124 | AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:DC7E84BFDA79164B7ECD8486985D3860:0 | ||
125 | AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:DC7E84BFDA79164B7ECD8486985D3860:AE2D8A571E03AC9C9EB76FAC45AF8E51:39FFED143B28B1C832113C6331E5407B:0 | ||
126 | AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:39FFED143B28B1C832113C6331E5407B:30C81C46A35CE411E5FBC1191A0A52EF:DF10132415E54B92A13ED0A8267AE2F9:0 | ||
127 | AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:DF10132415E54B92A13ED0A8267AE2F9:F69F2445DF4F9B17AD2B417BE66C3710:75A385741AB9CEF82031623D55B1E471:0 | ||
128 | # For all OFB encrypts and decrypts, the transformed sequence is | ||
129 | # AES-bits-CFB:key:IV/output':plaintext:ciphertext:encdec | ||
130 | # OFB-AES128.Encrypt | ||
131 | AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:3B3FD92EB72DAD20333449F8E83CFB4A:1 | ||
132 | AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:50FE67CC996D32B6DA0937E99BAFEC60:AE2D8A571E03AC9C9EB76FAC45AF8E51:7789508D16918F03F53C52DAC54ED825:1 | ||
133 | AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:D9A4DADA0892239F6B8B3D7680E15674:30C81C46A35CE411E5FBC1191A0A52EF:9740051E9C5FECF64344F7A82260EDCC:1 | ||
134 | AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:A78819583F0308E7A6BF36B1386ABF23:F69F2445DF4F9B17AD2B417BE66C3710:304C6528F659C77866A510D9C1D6AE5E:1 | ||
135 | # OFB-AES128.Decrypt | ||
136 | AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:3B3FD92EB72DAD20333449F8E83CFB4A:0 | ||
137 | AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:50FE67CC996D32B6DA0937E99BAFEC60:AE2D8A571E03AC9C9EB76FAC45AF8E51:7789508D16918F03F53C52DAC54ED825:0 | ||
138 | AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:D9A4DADA0892239F6B8B3D7680E15674:30C81C46A35CE411E5FBC1191A0A52EF:9740051E9C5FECF64344F7A82260EDCC:0 | ||
139 | AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:A78819583F0308E7A6BF36B1386ABF23:F69F2445DF4F9B17AD2B417BE66C3710:304C6528F659C77866A510D9C1D6AE5E:0 | ||
140 | # OFB-AES192.Encrypt | ||
141 | AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CDC80D6FDDF18CAB34C25909C99A4174:1 | ||
142 | AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:A609B38DF3B1133DDDFF2718BA09565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:FCC28B8D4C63837C09E81700C1100401:1 | ||
143 | AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:52EF01DA52602FE0975F78AC84BF8A50:30C81C46A35CE411E5FBC1191A0A52EF:8D9A9AEAC0F6596F559C6D4DAF59A5F2:1 | ||
144 | AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:BD5286AC63AABD7EB067AC54B553F71D:F69F2445DF4F9B17AD2B417BE66C3710:6D9F200857CA6C3E9CAC524BD9ACC92A:1 | ||
145 | # OFB-AES192.Decrypt | ||
146 | AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CDC80D6FDDF18CAB34C25909C99A4174:0 | ||
147 | AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:A609B38DF3B1133DDDFF2718BA09565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:FCC28B8D4C63837C09E81700C1100401:0 | ||
148 | AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:52EF01DA52602FE0975F78AC84BF8A50:30C81C46A35CE411E5FBC1191A0A52EF:8D9A9AEAC0F6596F559C6D4DAF59A5F2:0 | ||
149 | AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:BD5286AC63AABD7EB067AC54B553F71D:F69F2445DF4F9B17AD2B417BE66C3710:6D9F200857CA6C3E9CAC524BD9ACC92A:0 | ||
150 | # OFB-AES256.Encrypt | ||
151 | AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:DC7E84BFDA79164B7ECD8486985D3860:1 | ||
152 | AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:B7BF3A5DF43989DD97F0FA97EBCE2F4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:4FEBDC6740D20B3AC88F6AD82A4FB08D:1 | ||
153 | AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E1C656305ED1A7A6563805746FE03EDC:30C81C46A35CE411E5FBC1191A0A52EF:71AB47A086E86EEDF39D1C5BBA97C408:1 | ||
154 | AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:41635BE625B48AFC1666DD42A09D96E7:F69F2445DF4F9B17AD2B417BE66C3710:0126141D67F37BE8538F5A8BE740E484:1 | ||
155 | # OFB-AES256.Decrypt | ||
156 | AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:DC7E84BFDA79164B7ECD8486985D3860:0 | ||
157 | AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:B7BF3A5DF43989DD97F0FA97EBCE2F4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:4FEBDC6740D20B3AC88F6AD82A4FB08D:0 | ||
158 | AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E1C656305ED1A7A6563805746FE03EDC:30C81C46A35CE411E5FBC1191A0A52EF:71AB47A086E86EEDF39D1C5BBA97C408:0 | ||
159 | AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:41635BE625B48AFC1666DD42A09D96E7:F69F2445DF4F9B17AD2B417BE66C3710:0126141D67F37BE8538F5A8BE740E484:0 | ||
160 | |||
161 | # DES ECB tests (from destest) | ||
162 | |||
163 | DES-ECB:0000000000000000::0000000000000000:8CA64DE9C1B123A7 | ||
164 | DES-ECB:FFFFFFFFFFFFFFFF::FFFFFFFFFFFFFFFF:7359B2163E4EDC58 | ||
165 | DES-ECB:3000000000000000::1000000000000001:958E6E627A05557B | ||
166 | DES-ECB:1111111111111111::1111111111111111:F40379AB9E0EC533 | ||
167 | DES-ECB:0123456789ABCDEF::1111111111111111:17668DFC7292532D | ||
168 | DES-ECB:1111111111111111::0123456789ABCDEF:8A5AE1F81AB8F2DD | ||
169 | DES-ECB:FEDCBA9876543210::0123456789ABCDEF:ED39D950FA74BCC4 | ||
170 | |||
171 | # DESX-CBC tests (from destest) | ||
172 | DESX-CBC:0123456789abcdeff1e0d3c2b5a49786fedcba9876543210:fedcba9876543210:37363534333231204E6F77206973207468652074696D6520666F722000000000:846B2914851E9A2954732F8AA0A611C115CDC2D7951B1053A63C5E03B21AA3C4 | ||
173 | |||
174 | # DES EDE3 CBC tests (from destest) | ||
175 | DES-EDE3-CBC:0123456789abcdeff1e0d3c2b5a49786fedcba9876543210:fedcba9876543210:37363534333231204E6F77206973207468652074696D6520666F722000000000:3FE301C962AC01D02213763C1CBD4CDC799657C064ECF5D41C673812CFDE9675 | ||
176 | |||
177 | # RC4 tests (from rc4test) | ||
178 | RC4:0123456789abcdef0123456789abcdef::0123456789abcdef:75b7878099e0c596 | ||
179 | RC4:0123456789abcdef0123456789abcdef::0000000000000000:7494c2e7104b0879 | ||
180 | RC4:00000000000000000000000000000000::0000000000000000:de188941a3375d3a | ||
181 | RC4:ef012345ef012345ef012345ef012345::0000000000000000000000000000000000000000:d6a141a7ec3c38dfbd615a1162e1c7ba36b67858 | ||
182 | RC4:0123456789abcdef0123456789abcdef::123456789ABCDEF0123456789ABCDEF0123456789ABCDEF012345678:66a0949f8af7d6891f7f832ba833c00c892ebe30143ce28740011ecf | ||
183 | RC4:ef012345ef012345ef012345ef012345::00000000000000000000:d6a141a7ec3c38dfbd61 | ||
184 | |||
185 | |||
186 | # Camellia tests from RFC3713 | ||
187 | # For all ECB encrypts and decrypts, the transformed sequence is | ||
188 | # CAMELLIA-bits-ECB:key::plaintext:ciphertext:encdec | ||
189 | CAMELLIA-128-ECB:0123456789abcdeffedcba9876543210::0123456789abcdeffedcba9876543210:67673138549669730857065648eabe43 | ||
190 | CAMELLIA-192-ECB:0123456789abcdeffedcba98765432100011223344556677::0123456789abcdeffedcba9876543210:b4993401b3e996f84ee5cee7d79b09b9 | ||
191 | CAMELLIA-256-ECB:0123456789abcdeffedcba987654321000112233445566778899aabbccddeeff::0123456789abcdeffedcba9876543210:9acc237dff16d76c20ef7c919e3a7509 | ||
192 | |||
193 | # ECB-CAMELLIA128.Encrypt | ||
194 | CAMELLIA-128-ECB:000102030405060708090A0B0C0D0E0F::00112233445566778899AABBCCDDEEFF:77CF412067AF8270613529149919546F:1 | ||
195 | CAMELLIA-192-ECB:000102030405060708090A0B0C0D0E0F1011121314151617::00112233445566778899AABBCCDDEEFF:B22F3C36B72D31329EEE8ADDC2906C68:1 | ||
196 | CAMELLIA-256-ECB:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F::00112233445566778899AABBCCDDEEFF:2EDF1F3418D53B88841FC8985FB1ECF2:1 | ||
197 | |||
198 | # ECB-CAMELLIA128.Encrypt and ECB-CAMELLIA128.Decrypt | ||
199 | CAMELLIA-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::6BC1BEE22E409F96E93D7E117393172A:432FC5DCD628115B7C388D770B270C96 | ||
200 | CAMELLIA-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::AE2D8A571E03AC9C9EB76FAC45AF8E51:0BE1F14023782A22E8384C5ABB7FAB2B | ||
201 | CAMELLIA-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::30C81C46A35CE411E5FBC1191A0A52EF:A0A1ABCD1893AB6FE0FE5B65DF5F8636 | ||
202 | CAMELLIA-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::F69F2445DF4F9B17AD2B417BE66C3710:E61925E0D5DFAA9BB29F815B3076E51A | ||
203 | |||
204 | # ECB-CAMELLIA192.Encrypt and ECB-CAMELLIA192.Decrypt | ||
205 | CAMELLIA-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::6BC1BEE22E409F96E93D7E117393172A:CCCC6C4E138B45848514D48D0D3439D3 | ||
206 | CAMELLIA-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::AE2D8A571E03AC9C9EB76FAC45AF8E51:5713C62C14B2EC0F8393B6AFD6F5785A | ||
207 | CAMELLIA-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::30C81C46A35CE411E5FBC1191A0A52EF:B40ED2B60EB54D09D030CF511FEEF366 | ||
208 | CAMELLIA-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::F69F2445DF4F9B17AD2B417BE66C3710:909DBD95799096748CB27357E73E1D26 | ||
209 | |||
210 | # ECB-CAMELLIA256.Encrypt and ECB-CAMELLIA256.Decrypt | ||
211 | CAMELLIA-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::6BC1BEE22E409F96E93D7E117393172A:BEFD219B112FA00098919CD101C9CCFA | ||
212 | CAMELLIA-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::AE2D8A571E03AC9C9EB76FAC45AF8E51:C91D3A8F1AEA08A9386CF4B66C0169EA | ||
213 | CAMELLIA-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::30C81C46A35CE411E5FBC1191A0A52EF:A623D711DC5F25A51BB8A80D56397D28 | ||
214 | CAMELLIA-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::F69F2445DF4F9B17AD2B417BE66C3710:7960109FB6DC42947FCFE59EA3C5EB6B | ||
215 | |||
216 | # For all CBC encrypts and decrypts, the transformed sequence is | ||
217 | # CAMELLIA-bits-CBC:key:IV/ciphertext':plaintext:ciphertext:encdec | ||
218 | # CBC-CAMELLIA128.Encrypt and CBC-CAMELLIA128.Decrypt | ||
219 | CAMELLIA-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:1607CF494B36BBF00DAEB0B503C831AB | ||
220 | CAMELLIA-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:1607CF494B36BBF00DAEB0B503C831AB:AE2D8A571E03AC9C9EB76FAC45AF8E51:A2F2CF671629EF7840C5A5DFB5074887 | ||
221 | CAMELLIA-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:A2F2CF671629EF7840C5A5DFB5074887:30C81C46A35CE411E5FBC1191A0A52EF:0F06165008CF8B8B5A63586362543E54 | ||
222 | CAMELLIA-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:36A84CDAFD5F9A85ADA0F0A993D6D577:F69F2445DF4F9B17AD2B417BE66C3710:74C64268CDB8B8FAF5B34E8AF3732980 | ||
223 | |||
224 | # CBC-CAMELLIA192.Encrypt and CBC-CAMELLIA192.Decrypt | ||
225 | CAMELLIA-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:2A4830AB5AC4A1A2405955FD2195CF93 | ||
226 | CAMELLIA-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:2A4830AB5AC4A1A2405955FD2195CF93:AE2D8A571E03AC9C9EB76FAC45AF8E51:5D5A869BD14CE54264F892A6DD2EC3D5 | ||
227 | CAMELLIA-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:5D5A869BD14CE54264F892A6DD2EC3D5:30C81C46A35CE411E5FBC1191A0A52EF:37D359C3349836D884E310ADDF68C449 | ||
228 | CAMELLIA-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:37D359C3349836D884E310ADDF68C449:F69F2445DF4F9B17AD2B417BE66C3710:01FAAA930B4AB9916E9668E1428C6B08 | ||
229 | |||
230 | # CBC-CAMELLIA256.Encrypt and CBC-CAMELLIA256.Decrypt | ||
231 | CAMELLIA-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:E6CFA35FC02B134A4D2C0B6737AC3EDA | ||
232 | CAMELLIA-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E6CFA35FC02B134A4D2C0B6737AC3EDA:AE2D8A571E03AC9C9EB76FAC45AF8E51:36CBEB73BD504B4070B1B7DE2B21EB50 | ||
233 | CAMELLIA-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:36CBEB73BD504B4070B1B7DE2B21EB50:30C81C46A35CE411E5FBC1191A0A52EF:E31A6055297D96CA3330CDF1B1860A83 | ||
234 | CAMELLIA-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E31A6055297D96CA3330CDF1B1860A83:F69F2445DF4F9B17AD2B417BE66C3710:5D563F6D1CCCF236051C0C5C1C58F28F | ||
235 | |||
236 | # We don't support CFB{1,8}-CAMELLIAxxx.{En,De}crypt | ||
237 | # For all CFB128 encrypts and decrypts, the transformed sequence is | ||
238 | # CAMELLIA-bits-CFB:key:IV/ciphertext':plaintext:ciphertext:encdec | ||
239 | # CFB128-CAMELLIA128.Encrypt | ||
240 | CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:14F7646187817EB586599146B82BD719:1 | ||
241 | CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:14F7646187817EB586599146B82BD719:AE2D8A571E03AC9C9EB76FAC45AF8E51:A53D28BB82DF741103EA4F921A44880B:1 | ||
242 | CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:A53D28BB82DF741103EA4F921A44880B:30C81C46A35CE411E5FBC1191A0A52EF:9C2157A664626D1DEF9EA420FDE69B96:1 | ||
243 | CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:9C2157A664626D1DEF9EA420FDE69B96:F69F2445DF4F9B17AD2B417BE66C3710:742A25F0542340C7BAEF24CA8482BB09:1 | ||
244 | |||
245 | # CFB128-CAMELLIA128.Decrypt | ||
246 | CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:14F7646187817EB586599146B82BD719:0 | ||
247 | CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:14F7646187817EB586599146B82BD719:AE2D8A571E03AC9C9EB76FAC45AF8E51:A53D28BB82DF741103EA4F921A44880B:0 | ||
248 | CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:A53D28BB82DF741103EA4F921A44880B:30C81C46A35CE411E5FBC1191A0A52EF:9C2157A664626D1DEF9EA420FDE69B96:0 | ||
249 | CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:9C2157A664626D1DEF9EA420FDE69B96:F69F2445DF4F9B17AD2B417BE66C3710:742A25F0542340C7BAEF24CA8482BB09:0 | ||
250 | |||
251 | # CFB128-CAMELLIA192.Encrypt | ||
252 | CAMELLIA-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:C832BB9780677DAA82D9B6860DCD565E:1 | ||
253 | CAMELLIA-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:C832BB9780677DAA82D9B6860DCD565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:86F8491627906D780C7A6D46EA331F98:1 | ||
254 | CAMELLIA-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:86F8491627906D780C7A6D46EA331F98:30C81C46A35CE411E5FBC1191A0A52EF:69511CCE594CF710CB98BB63D7221F01:1 | ||
255 | CAMELLIA-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:69511CCE594CF710CB98BB63D7221F01:F69F2445DF4F9B17AD2B417BE66C3710:D5B5378A3ABED55803F25565D8907B84:1 | ||
256 | |||
257 | # CFB128-CAMELLIA192.Decrypt | ||
258 | CAMELLIA-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:C832BB9780677DAA82D9B6860DCD565E:0 | ||
259 | CAMELLIA-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:C832BB9780677DAA82D9B6860DCD565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:86F8491627906D780C7A6D46EA331F98:0 | ||
260 | CAMELLIA-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:86F8491627906D780C7A6D46EA331F98:30C81C46A35CE411E5FBC1191A0A52EF:69511CCE594CF710CB98BB63D7221F01:0 | ||
261 | CAMELLIA-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:69511CCE594CF710CB98BB63D7221F01:F69F2445DF4F9B17AD2B417BE66C3710:D5B5378A3ABED55803F25565D8907B84:0 | ||
262 | |||
263 | # CFB128-CAMELLIA256.Encrypt | ||
264 | CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CF6107BB0CEA7D7FB1BD31F5E7B06C93:1 | ||
265 | CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:CF6107BB0CEA7D7FB1BD31F5E7B06C93:AE2D8A571E03AC9C9EB76FAC45AF8E51:89BEDB4CCDD864EA11BA4CBE849B5E2B:1 | ||
266 | CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:89BEDB4CCDD864EA11BA4CBE849B5E2B:30C81C46A35CE411E5FBC1191A0A52EF:555FC3F34BDD2D54C62D9E3BF338C1C4:1 | ||
267 | CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:555FC3F34BDD2D54C62D9E3BF338C1C4:F69F2445DF4F9B17AD2B417BE66C3710:5953ADCE14DB8C7F39F1BD39F359BFFA:1 | ||
268 | |||
269 | # CFB128-CAMELLIA256.Decrypt | ||
270 | CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CF6107BB0CEA7D7FB1BD31F5E7B06C93:0 | ||
271 | CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:CF6107BB0CEA7D7FB1BD31F5E7B06C93:AE2D8A571E03AC9C9EB76FAC45AF8E51:89BEDB4CCDD864EA11BA4CBE849B5E2B:0 | ||
272 | CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:89BEDB4CCDD864EA11BA4CBE849B5E2B:30C81C46A35CE411E5FBC1191A0A52EF:555FC3F34BDD2D54C62D9E3BF338C1C4:0 | ||
273 | CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:555FC3F34BDD2D54C62D9E3BF338C1C4:F69F2445DF4F9B17AD2B417BE66C3710:5953ADCE14DB8C7F39F1BD39F359BFFA:0 | ||
274 | |||
275 | # For all OFB encrypts and decrypts, the transformed sequence is | ||
276 | # CAMELLIA-bits-OFB:key:IV/output':plaintext:ciphertext:encdec | ||
277 | # OFB-CAMELLIA128.Encrypt | ||
278 | CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:14F7646187817EB586599146B82BD719:1 | ||
279 | CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:50FE67CC996D32B6DA0937E99BAFEC60:AE2D8A571E03AC9C9EB76FAC45AF8E51:25623DB569CA51E01482649977E28D84:1 | ||
280 | CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:D9A4DADA0892239F6B8B3D7680E15674:30C81C46A35CE411E5FBC1191A0A52EF:C776634A60729DC657D12B9FCA801E98:1 | ||
281 | CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:A78819583F0308E7A6BF36B1386ABF23:F69F2445DF4F9B17AD2B417BE66C3710:D776379BE0E50825E681DA1A4C980E8E:1 | ||
282 | |||
283 | # OFB-CAMELLIA128.Decrypt | ||
284 | CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:14F7646187817EB586599146B82BD719:0 | ||
285 | CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:50FE67CC996D32B6DA0937E99BAFEC60:AE2D8A571E03AC9C9EB76FAC45AF8E51:25623DB569CA51E01482649977E28D84:0 | ||
286 | CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:D9A4DADA0892239F6B8B3D7680E15674:30C81C46A35CE411E5FBC1191A0A52EF:C776634A60729DC657D12B9FCA801E98:0 | ||
287 | CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:A78819583F0308E7A6BF36B1386ABF23:F69F2445DF4F9B17AD2B417BE66C3710:D776379BE0E50825E681DA1A4C980E8E:0 | ||
288 | |||
289 | # OFB-CAMELLIA192.Encrypt | ||
290 | CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:C832BB9780677DAA82D9B6860DCD565E:1 | ||
291 | CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:A609B38DF3B1133DDDFF2718BA09565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:8ECEB7D0350D72C7F78562AEBDF99339:1 | ||
292 | CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:52EF01DA52602FE0975F78AC84BF8A50:30C81C46A35CE411E5FBC1191A0A52EF:BDD62DBBB9700846C53B507F544696F0:1 | ||
293 | CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:BD5286AC63AABD7EB067AC54B553F71D:F69F2445DF4F9B17AD2B417BE66C3710:E28014E046B802F385C4C2E13EAD4A72:1 | ||
294 | |||
295 | # OFB-CAMELLIA192.Decrypt | ||
296 | CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:C832BB9780677DAA82D9B6860DCD565E:0 | ||
297 | CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:A609B38DF3B1133DDDFF2718BA09565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:8ECEB7D0350D72C7F78562AEBDF99339:0 | ||
298 | CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:52EF01DA52602FE0975F78AC84BF8A50:30C81C46A35CE411E5FBC1191A0A52EF:BDD62DBBB9700846C53B507F544696F0:0 | ||
299 | CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:BD5286AC63AABD7EB067AC54B553F71D:F69F2445DF4F9B17AD2B417BE66C3710:E28014E046B802F385C4C2E13EAD4A72:0 | ||
300 | |||
301 | # OFB-CAMELLIA256.Encrypt | ||
302 | CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CF6107BB0CEA7D7FB1BD31F5E7B06C93:1 | ||
303 | CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:B7BF3A5DF43989DD97F0FA97EBCE2F4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:127AD97E8E3994E4820027D7BA109368:1 | ||
304 | CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E1C656305ED1A7A6563805746FE03EDC:30C81C46A35CE411E5FBC1191A0A52EF:6BFF6265A6A6B7A535BC65A80B17214E:1 | ||
305 | CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:41635BE625B48AFC1666DD42A09D96E7:F69F2445DF4F9B17AD2B417BE66C3710:0A4A0404E26AA78A27CB271E8BF3CF20:1 | ||
306 | |||
307 | # OFB-CAMELLIA256.Decrypt | ||
308 | CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CF6107BB0CEA7D7FB1BD31F5E7B06C93:0 | ||
309 | CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:B7BF3A5DF43989DD97F0FA97EBCE2F4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:127AD97E8E3994E4820027D7BA109368:0 | ||
310 | CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E1C656305ED1A7A6563805746FE03EDC:30C81C46A35CE411E5FBC1191A0A52EF:6BFF6265A6A6B7A535BC65A80B17214E:0 | ||
311 | CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:41635BE625B48AFC1666DD42A09D96E7:F69F2445DF4F9B17AD2B417BE66C3710:0A4A0404E26AA78A27CB271E8BF3CF20:0 | ||
312 | |||
313 | # SEED test vectors from RFC4269 | ||
314 | SEED-ECB:00000000000000000000000000000000::000102030405060708090A0B0C0D0E0F:5EBAC6E0054E166819AFF1CC6D346CDB:0 | ||
315 | SEED-ECB:000102030405060708090A0B0C0D0E0F::00000000000000000000000000000000:C11F22F20140505084483597E4370F43:0 | ||
316 | SEED-ECB:4706480851E61BE85D74BFB3FD956185::83A2F8A288641FB9A4E9A5CC2F131C7D:EE54D13EBCAE706D226BC3142CD40D4A:0 | ||
317 | SEED-ECB:28DBC3BC49FFD87DCFA509B11D422BE7::B41E6BE2EBA84A148E2EED84593C5EC7:9B9B7BFCD1813CB95D0B3618F40F5122:0 | ||
318 | SEED-ECB:00000000000000000000000000000000::000102030405060708090A0B0C0D0E0F:5EBAC6E0054E166819AFF1CC6D346CDB:1 | ||
319 | SEED-ECB:000102030405060708090A0B0C0D0E0F::00000000000000000000000000000000:C11F22F20140505084483597E4370F43:1 | ||
320 | SEED-ECB:4706480851E61BE85D74BFB3FD956185::83A2F8A288641FB9A4E9A5CC2F131C7D:EE54D13EBCAE706D226BC3142CD40D4A:1 | ||
321 | SEED-ECB:28DBC3BC49FFD87DCFA509B11D422BE7::B41E6BE2EBA84A148E2EED84593C5EC7:9B9B7BFCD1813CB95D0B3618F40F5122:1 | ||
diff --git a/src/lib/libssl/test/igetest.c b/src/lib/libssl/test/igetest.c new file mode 100644 index 0000000000..1ba900244d --- /dev/null +++ b/src/lib/libssl/test/igetest.c | |||
@@ -0,0 +1,503 @@ | |||
1 | /* test/igetest.c -*- mode:C; c-file-style: "eay" -*- */ | ||
2 | /* ==================================================================== | ||
3 | * Copyright (c) 2006 The OpenSSL Project. All rights reserved. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions | ||
7 | * are met: | ||
8 | * | ||
9 | * 1. Redistributions of source code must retain the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer. | ||
11 | * | ||
12 | * 2. Redistributions in binary form must reproduce the above copyright | ||
13 | * notice, this list of conditions and the following disclaimer in | ||
14 | * the documentation and/or other materials provided with the | ||
15 | * distribution. | ||
16 | * | ||
17 | * 3. All advertising materials mentioning features or use of this | ||
18 | * software must display the following acknowledgment: | ||
19 | * "This product includes software developed by the OpenSSL Project | ||
20 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
21 | * | ||
22 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
23 | * endorse or promote products derived from this software without | ||
24 | * prior written permission. For written permission, please contact | ||
25 | * openssl-core@openssl.org. | ||
26 | * | ||
27 | * 5. Products derived from this software may not be called "OpenSSL" | ||
28 | * nor may "OpenSSL" appear in their names without prior written | ||
29 | * permission of the OpenSSL Project. | ||
30 | * | ||
31 | * 6. Redistributions of any form whatsoever must retain the following | ||
32 | * acknowledgment: | ||
33 | * "This product includes software developed by the OpenSSL Project | ||
34 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
35 | * | ||
36 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
37 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
38 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
39 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
40 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
41 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
42 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
43 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
44 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
45 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
46 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
47 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
48 | * ==================================================================== | ||
49 | * | ||
50 | */ | ||
51 | |||
52 | #include <openssl/aes.h> | ||
53 | #include <openssl/rand.h> | ||
54 | #include <stdio.h> | ||
55 | #include <string.h> | ||
56 | #include <assert.h> | ||
57 | |||
58 | #define TEST_SIZE 128 | ||
59 | #define BIG_TEST_SIZE 10240 | ||
60 | |||
61 | static void hexdump(FILE *f,const char *title,const unsigned char *s,int l) | ||
62 | { | ||
63 | int n=0; | ||
64 | |||
65 | fprintf(f,"%s",title); | ||
66 | for( ; n < l ; ++n) | ||
67 | { | ||
68 | if((n%16) == 0) | ||
69 | fprintf(f,"\n%04x",n); | ||
70 | fprintf(f," %02x",s[n]); | ||
71 | } | ||
72 | fprintf(f,"\n"); | ||
73 | } | ||
74 | |||
75 | #define MAX_VECTOR_SIZE 64 | ||
76 | |||
77 | struct ige_test | ||
78 | { | ||
79 | const unsigned char key[16]; | ||
80 | const unsigned char iv[32]; | ||
81 | const unsigned char in[MAX_VECTOR_SIZE]; | ||
82 | const unsigned char out[MAX_VECTOR_SIZE]; | ||
83 | const size_t length; | ||
84 | const int encrypt; | ||
85 | }; | ||
86 | |||
87 | static struct ige_test const ige_test_vectors[] = { | ||
88 | { { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, | ||
89 | 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, /* key */ | ||
90 | { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, | ||
91 | 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, | ||
92 | 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, | ||
93 | 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f }, /* iv */ | ||
94 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
95 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
96 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
97 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, /* in */ | ||
98 | { 0x1a, 0x85, 0x19, 0xa6, 0x55, 0x7b, 0xe6, 0x52, | ||
99 | 0xe9, 0xda, 0x8e, 0x43, 0xda, 0x4e, 0xf4, 0x45, | ||
100 | 0x3c, 0xf4, 0x56, 0xb4, 0xca, 0x48, 0x8a, 0xa3, | ||
101 | 0x83, 0xc7, 0x9c, 0x98, 0xb3, 0x47, 0x97, 0xcb }, /* out */ | ||
102 | 32, AES_ENCRYPT }, /* test vector 0 */ | ||
103 | |||
104 | { { 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, | ||
105 | 0x61, 0x6e, 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x65 }, /* key */ | ||
106 | { 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, | ||
107 | 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x49, 0x47, 0x45, | ||
108 | 0x20, 0x6d, 0x6f, 0x64, 0x65, 0x20, 0x66, 0x6f, | ||
109 | 0x72, 0x20, 0x4f, 0x70, 0x65, 0x6e, 0x53, 0x53 }, /* iv */ | ||
110 | { 0x4c, 0x2e, 0x20, 0x4c, 0x65, 0x74, 0x27, 0x73, | ||
111 | 0x20, 0x68, 0x6f, 0x70, 0x65, 0x20, 0x42, 0x65, | ||
112 | 0x6e, 0x20, 0x67, 0x6f, 0x74, 0x20, 0x69, 0x74, | ||
113 | 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x21, 0x0a }, /* in */ | ||
114 | { 0x99, 0x70, 0x64, 0x87, 0xa1, 0xcd, 0xe6, 0x13, | ||
115 | 0xbc, 0x6d, 0xe0, 0xb6, 0xf2, 0x4b, 0x1c, 0x7a, | ||
116 | 0xa4, 0x48, 0xc8, 0xb9, 0xc3, 0x40, 0x3e, 0x34, | ||
117 | 0x67, 0xa8, 0xca, 0xd8, 0x93, 0x40, 0xf5, 0x3b }, /* out */ | ||
118 | 32, AES_DECRYPT }, /* test vector 1 */ | ||
119 | }; | ||
120 | |||
121 | struct bi_ige_test | ||
122 | { | ||
123 | const unsigned char key1[32]; | ||
124 | const unsigned char key2[32]; | ||
125 | const unsigned char iv[64]; | ||
126 | const unsigned char in[MAX_VECTOR_SIZE]; | ||
127 | const unsigned char out[MAX_VECTOR_SIZE]; | ||
128 | const size_t keysize; | ||
129 | const size_t length; | ||
130 | const int encrypt; | ||
131 | }; | ||
132 | |||
133 | static struct bi_ige_test const bi_ige_test_vectors[] = { | ||
134 | { { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, | ||
135 | 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, /* key1 */ | ||
136 | { 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, | ||
137 | 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f }, /* key2 */ | ||
138 | { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, | ||
139 | 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, | ||
140 | 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, | ||
141 | 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, | ||
142 | 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, | ||
143 | 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, | ||
144 | 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, | ||
145 | 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f }, /* iv */ | ||
146 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
147 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
148 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
149 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, /* in */ | ||
150 | { 0x14, 0x40, 0x6f, 0xae, 0xa2, 0x79, 0xf2, 0x56, | ||
151 | 0x1f, 0x86, 0xeb, 0x3b, 0x7d, 0xff, 0x53, 0xdc, | ||
152 | 0x4e, 0x27, 0x0c, 0x03, 0xde, 0x7c, 0xe5, 0x16, | ||
153 | 0x6a, 0x9c, 0x20, 0x33, 0x9d, 0x33, 0xfe, 0x12 }, /* out */ | ||
154 | 16, 32, AES_ENCRYPT }, /* test vector 0 */ | ||
155 | { { 0x58, 0x0a, 0x06, 0xe9, 0x97, 0x07, 0x59, 0x5c, | ||
156 | 0x9e, 0x19, 0xd2, 0xa7, 0xbb, 0x40, 0x2b, 0x7a, | ||
157 | 0xc7, 0xd8, 0x11, 0x9e, 0x4c, 0x51, 0x35, 0x75, | ||
158 | 0x64, 0x28, 0x0f, 0x23, 0xad, 0x74, 0xac, 0x37 }, /* key1 */ | ||
159 | { 0xd1, 0x80, 0xa0, 0x31, 0x47, 0xa3, 0x11, 0x13, | ||
160 | 0x86, 0x26, 0x9e, 0x6d, 0xff, 0xaf, 0x72, 0x74, | ||
161 | 0x5b, 0xa2, 0x35, 0x81, 0xd2, 0xa6, 0x3d, 0x21, | ||
162 | 0x67, 0x7b, 0x58, 0xa8, 0x18, 0xf9, 0x72, 0xe4 }, /* key2 */ | ||
163 | { 0x80, 0x3d, 0xbd, 0x4c, 0xe6, 0x7b, 0x06, 0xa9, | ||
164 | 0x53, 0x35, 0xd5, 0x7e, 0x71, 0xc1, 0x70, 0x70, | ||
165 | 0x74, 0x9a, 0x00, 0x28, 0x0c, 0xbf, 0x6c, 0x42, | ||
166 | 0x9b, 0xa4, 0xdd, 0x65, 0x11, 0x77, 0x7c, 0x67, | ||
167 | 0xfe, 0x76, 0x0a, 0xf0, 0xd5, 0xc6, 0x6e, 0x6a, | ||
168 | 0xe7, 0x5e, 0x4c, 0xf2, 0x7e, 0x9e, 0xf9, 0x20, | ||
169 | 0x0e, 0x54, 0x6f, 0x2d, 0x8a, 0x8d, 0x7e, 0xbd, | ||
170 | 0x48, 0x79, 0x37, 0x99, 0xff, 0x27, 0x93, 0xa3 }, /* iv */ | ||
171 | { 0xf1, 0x54, 0x3d, 0xca, 0xfe, 0xb5, 0xef, 0x1c, | ||
172 | 0x4f, 0xa6, 0x43, 0xf6, 0xe6, 0x48, 0x57, 0xf0, | ||
173 | 0xee, 0x15, 0x7f, 0xe3, 0xe7, 0x2f, 0xd0, 0x2f, | ||
174 | 0x11, 0x95, 0x7a, 0x17, 0x00, 0xab, 0xa7, 0x0b, | ||
175 | 0xbe, 0x44, 0x09, 0x9c, 0xcd, 0xac, 0xa8, 0x52, | ||
176 | 0xa1, 0x8e, 0x7b, 0x75, 0xbc, 0xa4, 0x92, 0x5a, | ||
177 | 0xab, 0x46, 0xd3, 0x3a, 0xa0, 0xd5, 0x35, 0x1c, | ||
178 | 0x55, 0xa4, 0xb3, 0xa8, 0x40, 0x81, 0xa5, 0x0b}, /* in */ | ||
179 | { 0x42, 0xe5, 0x28, 0x30, 0x31, 0xc2, 0xa0, 0x23, | ||
180 | 0x68, 0x49, 0x4e, 0xb3, 0x24, 0x59, 0x92, 0x79, | ||
181 | 0xc1, 0xa5, 0xcc, 0xe6, 0x76, 0x53, 0xb1, 0xcf, | ||
182 | 0x20, 0x86, 0x23, 0xe8, 0x72, 0x55, 0x99, 0x92, | ||
183 | 0x0d, 0x16, 0x1c, 0x5a, 0x2f, 0xce, 0xcb, 0x51, | ||
184 | 0xe2, 0x67, 0xfa, 0x10, 0xec, 0xcd, 0x3d, 0x67, | ||
185 | 0xa5, 0xe6, 0xf7, 0x31, 0x26, 0xb0, 0x0d, 0x76, | ||
186 | 0x5e, 0x28, 0xdc, 0x7f, 0x01, 0xc5, 0xa5, 0x4c}, /* out */ | ||
187 | 32, 64, AES_ENCRYPT }, /* test vector 1 */ | ||
188 | |||
189 | }; | ||
190 | |||
191 | static int run_test_vectors(void) | ||
192 | { | ||
193 | unsigned int n; | ||
194 | int errs = 0; | ||
195 | |||
196 | for(n=0 ; n < sizeof(ige_test_vectors)/sizeof(ige_test_vectors[0]) ; ++n) | ||
197 | { | ||
198 | const struct ige_test * const v = &ige_test_vectors[n]; | ||
199 | AES_KEY key; | ||
200 | unsigned char buf[MAX_VECTOR_SIZE]; | ||
201 | unsigned char iv[AES_BLOCK_SIZE*2]; | ||
202 | |||
203 | assert(v->length <= MAX_VECTOR_SIZE); | ||
204 | |||
205 | if(v->encrypt == AES_ENCRYPT) | ||
206 | AES_set_encrypt_key(v->key, 8*sizeof v->key, &key); | ||
207 | else | ||
208 | AES_set_decrypt_key(v->key, 8*sizeof v->key, &key); | ||
209 | memcpy(iv, v->iv, sizeof iv); | ||
210 | AES_ige_encrypt(v->in, buf, v->length, &key, iv, v->encrypt); | ||
211 | |||
212 | if(memcmp(v->out, buf, v->length)) | ||
213 | { | ||
214 | printf("IGE test vector %d failed\n", n); | ||
215 | hexdump(stdout, "key", v->key, sizeof v->key); | ||
216 | hexdump(stdout, "iv", v->iv, sizeof v->iv); | ||
217 | hexdump(stdout, "in", v->in, v->length); | ||
218 | hexdump(stdout, "expected", v->out, v->length); | ||
219 | hexdump(stdout, "got", buf, v->length); | ||
220 | |||
221 | ++errs; | ||
222 | } | ||
223 | |||
224 | /* try with in == out */ | ||
225 | memcpy(iv, v->iv, sizeof iv); | ||
226 | memcpy(buf, v->in, v->length); | ||
227 | AES_ige_encrypt(buf, buf, v->length, &key, iv, v->encrypt); | ||
228 | |||
229 | if(memcmp(v->out, buf, v->length)) | ||
230 | { | ||
231 | printf("IGE test vector %d failed (with in == out)\n", n); | ||
232 | hexdump(stdout, "key", v->key, sizeof v->key); | ||
233 | hexdump(stdout, "iv", v->iv, sizeof v->iv); | ||
234 | hexdump(stdout, "in", v->in, v->length); | ||
235 | hexdump(stdout, "expected", v->out, v->length); | ||
236 | hexdump(stdout, "got", buf, v->length); | ||
237 | |||
238 | ++errs; | ||
239 | } | ||
240 | } | ||
241 | |||
242 | for(n=0 ; n < sizeof(bi_ige_test_vectors)/sizeof(bi_ige_test_vectors[0]) | ||
243 | ; ++n) | ||
244 | { | ||
245 | const struct bi_ige_test * const v = &bi_ige_test_vectors[n]; | ||
246 | AES_KEY key1; | ||
247 | AES_KEY key2; | ||
248 | unsigned char buf[MAX_VECTOR_SIZE]; | ||
249 | |||
250 | assert(v->length <= MAX_VECTOR_SIZE); | ||
251 | |||
252 | if(v->encrypt == AES_ENCRYPT) | ||
253 | { | ||
254 | AES_set_encrypt_key(v->key1, 8*v->keysize, &key1); | ||
255 | AES_set_encrypt_key(v->key2, 8*v->keysize, &key2); | ||
256 | } | ||
257 | else | ||
258 | { | ||
259 | AES_set_decrypt_key(v->key1, 8*v->keysize, &key1); | ||
260 | AES_set_decrypt_key(v->key2, 8*v->keysize, &key2); | ||
261 | } | ||
262 | |||
263 | AES_bi_ige_encrypt(v->in, buf, v->length, &key1, &key2, v->iv, | ||
264 | v->encrypt); | ||
265 | |||
266 | if(memcmp(v->out, buf, v->length)) | ||
267 | { | ||
268 | printf("Bidirectional IGE test vector %d failed\n", n); | ||
269 | hexdump(stdout, "key 1", v->key1, sizeof v->key1); | ||
270 | hexdump(stdout, "key 2", v->key2, sizeof v->key2); | ||
271 | hexdump(stdout, "iv", v->iv, sizeof v->iv); | ||
272 | hexdump(stdout, "in", v->in, v->length); | ||
273 | hexdump(stdout, "expected", v->out, v->length); | ||
274 | hexdump(stdout, "got", buf, v->length); | ||
275 | |||
276 | ++errs; | ||
277 | } | ||
278 | } | ||
279 | |||
280 | return errs; | ||
281 | } | ||
282 | |||
283 | int main(int argc, char **argv) | ||
284 | { | ||
285 | unsigned char rkey[16]; | ||
286 | unsigned char rkey2[16]; | ||
287 | AES_KEY key; | ||
288 | AES_KEY key2; | ||
289 | unsigned char plaintext[BIG_TEST_SIZE]; | ||
290 | unsigned char ciphertext[BIG_TEST_SIZE]; | ||
291 | unsigned char checktext[BIG_TEST_SIZE]; | ||
292 | unsigned char iv[AES_BLOCK_SIZE*4]; | ||
293 | unsigned char saved_iv[AES_BLOCK_SIZE*4]; | ||
294 | int err = 0; | ||
295 | unsigned int n; | ||
296 | unsigned matches; | ||
297 | |||
298 | assert(BIG_TEST_SIZE >= TEST_SIZE); | ||
299 | |||
300 | RAND_pseudo_bytes(rkey, sizeof rkey); | ||
301 | RAND_pseudo_bytes(plaintext, sizeof plaintext); | ||
302 | RAND_pseudo_bytes(iv, sizeof iv); | ||
303 | memcpy(saved_iv, iv, sizeof saved_iv); | ||
304 | |||
305 | /* Forward IGE only... */ | ||
306 | |||
307 | /* Straight encrypt/decrypt */ | ||
308 | AES_set_encrypt_key(rkey, 8*sizeof rkey, &key); | ||
309 | AES_ige_encrypt(plaintext, ciphertext, TEST_SIZE, &key, iv, | ||
310 | AES_ENCRYPT); | ||
311 | |||
312 | AES_set_decrypt_key(rkey, 8*sizeof rkey, &key); | ||
313 | memcpy(iv, saved_iv, sizeof iv); | ||
314 | AES_ige_encrypt(ciphertext, checktext, TEST_SIZE, &key, iv, | ||
315 | AES_DECRYPT); | ||
316 | |||
317 | if(memcmp(checktext, plaintext, TEST_SIZE)) | ||
318 | { | ||
319 | printf("Encrypt+decrypt doesn't match\n"); | ||
320 | hexdump(stdout, "Plaintext", plaintext, TEST_SIZE); | ||
321 | hexdump(stdout, "Checktext", checktext, TEST_SIZE); | ||
322 | ++err; | ||
323 | } | ||
324 | |||
325 | /* Now check encrypt chaining works */ | ||
326 | AES_set_encrypt_key(rkey, 8*sizeof rkey, &key); | ||
327 | memcpy(iv, saved_iv, sizeof iv); | ||
328 | AES_ige_encrypt(plaintext, ciphertext, TEST_SIZE/2, &key, iv, | ||
329 | AES_ENCRYPT); | ||
330 | AES_ige_encrypt(plaintext+TEST_SIZE/2, | ||
331 | ciphertext+TEST_SIZE/2, TEST_SIZE/2, | ||
332 | &key, iv, AES_ENCRYPT); | ||
333 | |||
334 | AES_set_decrypt_key(rkey, 8*sizeof rkey, &key); | ||
335 | memcpy(iv, saved_iv, sizeof iv); | ||
336 | AES_ige_encrypt(ciphertext, checktext, TEST_SIZE, &key, iv, | ||
337 | AES_DECRYPT); | ||
338 | |||
339 | if(memcmp(checktext, plaintext, TEST_SIZE)) | ||
340 | { | ||
341 | printf("Chained encrypt+decrypt doesn't match\n"); | ||
342 | hexdump(stdout, "Plaintext", plaintext, TEST_SIZE); | ||
343 | hexdump(stdout, "Checktext", checktext, TEST_SIZE); | ||
344 | ++err; | ||
345 | } | ||
346 | |||
347 | /* And check decrypt chaining */ | ||
348 | AES_set_encrypt_key(rkey, 8*sizeof rkey, &key); | ||
349 | memcpy(iv, saved_iv, sizeof iv); | ||
350 | AES_ige_encrypt(plaintext, ciphertext, TEST_SIZE/2, &key, iv, | ||
351 | AES_ENCRYPT); | ||
352 | AES_ige_encrypt(plaintext+TEST_SIZE/2, | ||
353 | ciphertext+TEST_SIZE/2, TEST_SIZE/2, | ||
354 | &key, iv, AES_ENCRYPT); | ||
355 | |||
356 | AES_set_decrypt_key(rkey, 8*sizeof rkey, &key); | ||
357 | memcpy(iv, saved_iv, sizeof iv); | ||
358 | AES_ige_encrypt(ciphertext, checktext, TEST_SIZE/2, &key, iv, | ||
359 | AES_DECRYPT); | ||
360 | AES_ige_encrypt(ciphertext+TEST_SIZE/2, | ||
361 | checktext+TEST_SIZE/2, TEST_SIZE/2, &key, iv, | ||
362 | AES_DECRYPT); | ||
363 | |||
364 | if(memcmp(checktext, plaintext, TEST_SIZE)) | ||
365 | { | ||
366 | printf("Chained encrypt+chained decrypt doesn't match\n"); | ||
367 | hexdump(stdout, "Plaintext", plaintext, TEST_SIZE); | ||
368 | hexdump(stdout, "Checktext", checktext, TEST_SIZE); | ||
369 | ++err; | ||
370 | } | ||
371 | |||
372 | /* make sure garble extends forwards only */ | ||
373 | AES_set_encrypt_key(rkey, 8*sizeof rkey, &key); | ||
374 | memcpy(iv, saved_iv, sizeof iv); | ||
375 | AES_ige_encrypt(plaintext, ciphertext, sizeof plaintext, &key, iv, | ||
376 | AES_ENCRYPT); | ||
377 | |||
378 | /* corrupt halfway through */ | ||
379 | ++ciphertext[sizeof ciphertext/2]; | ||
380 | AES_set_decrypt_key(rkey, 8*sizeof rkey, &key); | ||
381 | memcpy(iv, saved_iv, sizeof iv); | ||
382 | AES_ige_encrypt(ciphertext, checktext, sizeof checktext, &key, iv, | ||
383 | AES_DECRYPT); | ||
384 | |||
385 | matches=0; | ||
386 | for(n=0 ; n < sizeof checktext ; ++n) | ||
387 | if(checktext[n] == plaintext[n]) | ||
388 | ++matches; | ||
389 | |||
390 | if(matches > sizeof checktext/2+sizeof checktext/100) | ||
391 | { | ||
392 | printf("More than 51%% matches after garbling\n"); | ||
393 | ++err; | ||
394 | } | ||
395 | |||
396 | if(matches < sizeof checktext/2) | ||
397 | { | ||
398 | printf("Garble extends backwards!\n"); | ||
399 | ++err; | ||
400 | } | ||
401 | |||
402 | /* Bi-directional IGE */ | ||
403 | |||
404 | /* Note that we don't have to recover the IV, because chaining isn't */ | ||
405 | /* possible with biIGE, so the IV is not updated. */ | ||
406 | |||
407 | RAND_pseudo_bytes(rkey2, sizeof rkey2); | ||
408 | |||
409 | /* Straight encrypt/decrypt */ | ||
410 | AES_set_encrypt_key(rkey, 8*sizeof rkey, &key); | ||
411 | AES_set_encrypt_key(rkey2, 8*sizeof rkey2, &key2); | ||
412 | AES_bi_ige_encrypt(plaintext, ciphertext, TEST_SIZE, &key, &key2, iv, | ||
413 | AES_ENCRYPT); | ||
414 | |||
415 | AES_set_decrypt_key(rkey, 8*sizeof rkey, &key); | ||
416 | AES_set_decrypt_key(rkey2, 8*sizeof rkey2, &key2); | ||
417 | AES_bi_ige_encrypt(ciphertext, checktext, TEST_SIZE, &key, &key2, iv, | ||
418 | AES_DECRYPT); | ||
419 | |||
420 | if(memcmp(checktext, plaintext, TEST_SIZE)) | ||
421 | { | ||
422 | printf("Encrypt+decrypt doesn't match\n"); | ||
423 | hexdump(stdout, "Plaintext", plaintext, TEST_SIZE); | ||
424 | hexdump(stdout, "Checktext", checktext, TEST_SIZE); | ||
425 | ++err; | ||
426 | } | ||
427 | |||
428 | /* make sure garble extends both ways */ | ||
429 | AES_set_encrypt_key(rkey, 8*sizeof rkey, &key); | ||
430 | AES_set_encrypt_key(rkey2, 8*sizeof rkey2, &key2); | ||
431 | AES_ige_encrypt(plaintext, ciphertext, sizeof plaintext, &key, iv, | ||
432 | AES_ENCRYPT); | ||
433 | |||
434 | /* corrupt halfway through */ | ||
435 | ++ciphertext[sizeof ciphertext/2]; | ||
436 | AES_set_decrypt_key(rkey, 8*sizeof rkey, &key); | ||
437 | AES_set_decrypt_key(rkey2, 8*sizeof rkey2, &key2); | ||
438 | AES_ige_encrypt(ciphertext, checktext, sizeof checktext, &key, iv, | ||
439 | AES_DECRYPT); | ||
440 | |||
441 | matches=0; | ||
442 | for(n=0 ; n < sizeof checktext ; ++n) | ||
443 | if(checktext[n] == plaintext[n]) | ||
444 | ++matches; | ||
445 | |||
446 | if(matches > sizeof checktext/100) | ||
447 | { | ||
448 | printf("More than 1%% matches after bidirectional garbling\n"); | ||
449 | ++err; | ||
450 | } | ||
451 | |||
452 | /* make sure garble extends both ways (2) */ | ||
453 | AES_set_encrypt_key(rkey, 8*sizeof rkey, &key); | ||
454 | AES_set_encrypt_key(rkey2, 8*sizeof rkey2, &key2); | ||
455 | AES_ige_encrypt(plaintext, ciphertext, sizeof plaintext, &key, iv, | ||
456 | AES_ENCRYPT); | ||
457 | |||
458 | /* corrupt right at the end */ | ||
459 | ++ciphertext[sizeof ciphertext-1]; | ||
460 | AES_set_decrypt_key(rkey, 8*sizeof rkey, &key); | ||
461 | AES_set_decrypt_key(rkey2, 8*sizeof rkey2, &key2); | ||
462 | AES_ige_encrypt(ciphertext, checktext, sizeof checktext, &key, iv, | ||
463 | AES_DECRYPT); | ||
464 | |||
465 | matches=0; | ||
466 | for(n=0 ; n < sizeof checktext ; ++n) | ||
467 | if(checktext[n] == plaintext[n]) | ||
468 | ++matches; | ||
469 | |||
470 | if(matches > sizeof checktext/100) | ||
471 | { | ||
472 | printf("More than 1%% matches after bidirectional garbling (2)\n"); | ||
473 | ++err; | ||
474 | } | ||
475 | |||
476 | /* make sure garble extends both ways (3) */ | ||
477 | AES_set_encrypt_key(rkey, 8*sizeof rkey, &key); | ||
478 | AES_set_encrypt_key(rkey2, 8*sizeof rkey2, &key2); | ||
479 | AES_ige_encrypt(plaintext, ciphertext, sizeof plaintext, &key, iv, | ||
480 | AES_ENCRYPT); | ||
481 | |||
482 | /* corrupt right at the start */ | ||
483 | ++ciphertext[0]; | ||
484 | AES_set_decrypt_key(rkey, 8*sizeof rkey, &key); | ||
485 | AES_set_decrypt_key(rkey2, 8*sizeof rkey2, &key2); | ||
486 | AES_ige_encrypt(ciphertext, checktext, sizeof checktext, &key, iv, | ||
487 | AES_DECRYPT); | ||
488 | |||
489 | matches=0; | ||
490 | for(n=0 ; n < sizeof checktext ; ++n) | ||
491 | if(checktext[n] == plaintext[n]) | ||
492 | ++matches; | ||
493 | |||
494 | if(matches > sizeof checktext/100) | ||
495 | { | ||
496 | printf("More than 1%% matches after bidirectional garbling (3)\n"); | ||
497 | ++err; | ||
498 | } | ||
499 | |||
500 | err += run_test_vectors(); | ||
501 | |||
502 | return err; | ||
503 | } | ||
diff --git a/src/lib/libssl/test/maketests.com b/src/lib/libssl/test/maketests.com new file mode 100644 index 0000000000..ca072f1d11 --- /dev/null +++ b/src/lib/libssl/test/maketests.com | |||
@@ -0,0 +1,926 @@ | |||
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 "executables" will be placed in a directory called | ||
16 | $! [.xxx.EXE.TEST] where "xxx" denotes ALPHA, IA64, or VAX, depending | ||
17 | $! on your machine 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( "HW_MODEL") .lt. 1024) | ||
48 | $ then | ||
49 | $ arch = "VAX" | ||
50 | $ else | ||
51 | $ arch = "" | ||
52 | $ arch = arch+ f$edit( f$getsyi( "ARCH_NAME"), "UPCASE") | ||
53 | $ if (arch .eqs. "") then arch = "UNK" | ||
54 | $ endif | ||
55 | $! | ||
56 | $! Define The OBJ and EXE Directories (EXE before CHECK_OPTIONS). | ||
57 | $! | ||
58 | $ OBJ_DIR := SYS$DISK:[-.'ARCH'.OBJ.TEST] | ||
59 | $ EXE_DIR := SYS$DISK:[-.'ARCH'.EXE.TEST] | ||
60 | $! | ||
61 | $! Check To Make Sure We Have Valid Command Line Parameters. | ||
62 | $! | ||
63 | $ GOSUB CHECK_OPTIONS | ||
64 | $! | ||
65 | $! Initialise logical names and such | ||
66 | $! | ||
67 | $ GOSUB INITIALISE | ||
68 | $! | ||
69 | $! Tell The User What Kind of Machine We Run On. | ||
70 | $! | ||
71 | $ WRITE SYS$OUTPUT "Compiling On ''ARCH'." | ||
72 | $! | ||
73 | $! Define The CRYPTO-LIB We Are To Use. | ||
74 | $! | ||
75 | $ CRYPTO_LIB := SYS$DISK:[-.'ARCH'.EXE.CRYPTO]LIBCRYPTO.OLB | ||
76 | $! | ||
77 | $! Define The SSL We Are To Use. | ||
78 | $! | ||
79 | $ SSL_LIB := SYS$DISK:[-.'ARCH'.EXE.SSL]LIBSSL.OLB | ||
80 | $! | ||
81 | $! Create the OBJ and EXE Directories, if needed. | ||
82 | $! | ||
83 | $ IF (F$PARSE(OBJ_DIR).EQS."") THEN - | ||
84 | CREATE /DIRECTORY 'OBJ_DIR' | ||
85 | $ IF (F$PARSE(EXE_DIR).EQS."") THEN - | ||
86 | CREATE /DIRECTORY 'EXE_DIR' | ||
87 | $! | ||
88 | $! Check To See If We Have The Proper Libraries. | ||
89 | $! | ||
90 | $ GOSUB LIB_CHECK | ||
91 | $! | ||
92 | $! Check To See If We Have A Linker Option File. | ||
93 | $! | ||
94 | $ GOSUB CHECK_OPT_FILE | ||
95 | $! | ||
96 | $! Define The TEST Files. | ||
97 | $! NOTE: Some might think this list ugly. However, it's made this way to | ||
98 | $! reflect the EXE variable in Makefile as closely as possible, | ||
99 | $! thereby making it fairly easy to verify that the lists are the same. | ||
100 | $! | ||
101 | $ TEST_FILES = "BNTEST,ECTEST,ECDSATEST,ECDHTEST,IDEATEST,"+ - | ||
102 | "MD2TEST,MD4TEST,MD5TEST,HMACTEST,WP_TEST,"+ - | ||
103 | "RC2TEST,RC4TEST,RC5TEST,"+ - | ||
104 | "DESTEST,SHATEST,SHA1TEST,SHA256T,SHA512T,"+ - | ||
105 | "MDC2TEST,RMDTEST,"+ - | ||
106 | "RANDTEST,DHTEST,ENGINETEST,"+ - | ||
107 | "BFTEST,CASTTEST,SSLTEST,EXPTEST,DSATEST,RSA_TEST,"+ - | ||
108 | "EVP_TEST,JPAKETEST" | ||
109 | $! Should we add MTTEST,PQ_TEST,LH_TEST,DIVTEST,TABTEST as well? | ||
110 | $! | ||
111 | $! Additional directory information. | ||
112 | $ T_D_BNTEST := [-.crypto.bn] | ||
113 | $ T_D_ECTEST := [-.crypto.ec] | ||
114 | $ T_D_ECDSATEST := [-.crypto.ecdsa] | ||
115 | $ T_D_ECDHTEST := [-.crypto.ecdh] | ||
116 | $ T_D_IDEATEST := [-.crypto.idea] | ||
117 | $ T_D_MD2TEST := [-.crypto.md2] | ||
118 | $ T_D_MD4TEST := [-.crypto.md4] | ||
119 | $ T_D_MD5TEST := [-.crypto.md5] | ||
120 | $ T_D_HMACTEST := [-.crypto.hmac] | ||
121 | $ T_D_WP_TEST := [-.crypto.whrlpool] | ||
122 | $ T_D_RC2TEST := [-.crypto.rc2] | ||
123 | $ T_D_RC4TEST := [-.crypto.rc4] | ||
124 | $ T_D_RC5TEST := [-.crypto.rc5] | ||
125 | $ T_D_DESTEST := [-.crypto.des] | ||
126 | $ T_D_SHATEST := [-.crypto.sha] | ||
127 | $ T_D_SHA1TEST := [-.crypto.sha] | ||
128 | $ T_D_SHA256T := [-.crypto.sha] | ||
129 | $ T_D_SHA512T := [-.crypto.sha] | ||
130 | $ T_D_MDC2TEST := [-.crypto.mdc2] | ||
131 | $ T_D_RMDTEST := [-.crypto.ripemd] | ||
132 | $ T_D_RANDTEST := [-.crypto.rand] | ||
133 | $ T_D_DHTEST := [-.crypto.dh] | ||
134 | $ T_D_ENGINETEST := [-.crypto.engine] | ||
135 | $ T_D_BFTEST := [-.crypto.bf] | ||
136 | $ T_D_CASTTEST := [-.crypto.cast] | ||
137 | $ T_D_SSLTEST := [-.ssl] | ||
138 | $ T_D_EXPTEST := [-.crypto.bn] | ||
139 | $ T_D_DSATEST := [-.crypto.dsa] | ||
140 | $ T_D_RSA_TEST := [-.crypto.rsa] | ||
141 | $ T_D_EVP_TEST := [-.crypto.evp] | ||
142 | $ T_D_JPAKETEST := [-.crypto.jpake] | ||
143 | $ T_D_IGETEST := [-.test] | ||
144 | $! | ||
145 | $ TCPIP_PROGRAMS = ",," | ||
146 | $ IF COMPILER .EQS. "VAXC" THEN - | ||
147 | TCPIP_PROGRAMS = ",SSLTEST," | ||
148 | $! | ||
149 | $! Define A File Counter And Set It To "0". | ||
150 | $! | ||
151 | $ FILE_COUNTER = 0 | ||
152 | $! | ||
153 | $! Top Of The File Loop. | ||
154 | $! | ||
155 | $ NEXT_FILE: | ||
156 | $! | ||
157 | $! O.K, Extract The File Name From The File List. | ||
158 | $! | ||
159 | $ FILE_NAME = F$ELEMENT(FILE_COUNTER,",",TEST_FILES) | ||
160 | $! | ||
161 | $! Check To See If We Are At The End Of The File List. | ||
162 | $! | ||
163 | $ IF (FILE_NAME.EQS.",") THEN GOTO FILE_DONE | ||
164 | $! | ||
165 | $! Increment The Counter. | ||
166 | $! | ||
167 | $ FILE_COUNTER = FILE_COUNTER + 1 | ||
168 | $! | ||
169 | $! Create The Source File Name. | ||
170 | $! | ||
171 | $ SOURCE_FILE = "SYS$DISK:" + T_D_'FILE_NAME' + FILE_NAME + ".C" | ||
172 | $! | ||
173 | $! Create The Object File Name. | ||
174 | $! | ||
175 | $ OBJECT_FILE = OBJ_DIR + FILE_NAME + ".OBJ" | ||
176 | $! | ||
177 | $! Create The Executable File Name. | ||
178 | $! | ||
179 | $ EXE_FILE = EXE_DIR + FILE_NAME + ".EXE" | ||
180 | $ ON WARNING THEN GOTO NEXT_FILE | ||
181 | $! | ||
182 | $! Check To See If The File We Want To Compile Actually Exists. | ||
183 | $! | ||
184 | $ IF (F$SEARCH(SOURCE_FILE).EQS."") | ||
185 | $ THEN | ||
186 | $! | ||
187 | $! Tell The User That The File Dosen't Exist. | ||
188 | $! | ||
189 | $ WRITE SYS$OUTPUT "" | ||
190 | $ WRITE SYS$OUTPUT "The File ",SOURCE_FILE," Dosen't Exist." | ||
191 | $ WRITE SYS$OUTPUT "" | ||
192 | $! | ||
193 | $! Exit The Build. | ||
194 | $! | ||
195 | $ GOTO EXIT | ||
196 | $ ENDIF | ||
197 | $! | ||
198 | $! Tell The User What We Are Building. | ||
199 | $! | ||
200 | $ WRITE SYS$OUTPUT "Building The ",FILE_NAME," Test Program." | ||
201 | $! | ||
202 | $! Compile The File. | ||
203 | $! | ||
204 | $ ON ERROR THEN GOTO NEXT_FILE | ||
205 | $ CC /OBJECT='OBJECT_FILE' 'SOURCE_FILE' | ||
206 | $ ON WARNING THEN GOTO NEXT_FILE | ||
207 | $! | ||
208 | $! Check If What We Are About To Compile Works Without A TCP/IP Library. | ||
209 | $! | ||
210 | $ IF ((TCPIP_LIB.EQS."").AND.((TCPIP_PROGRAMS-FILE_NAME).NES.TCPIP_PROGRAMS)) | ||
211 | $ THEN | ||
212 | $! | ||
213 | $! Inform The User That A TCP/IP Library Is Needed To Compile This Program. | ||
214 | $! | ||
215 | $ WRITE SYS$OUTPUT - | ||
216 | FILE_NAME," Needs A TCP/IP Library. Can't Link. Skipping..." | ||
217 | $ GOTO NEXT_FILE | ||
218 | $! | ||
219 | $! End The TCP/IP Library Check. | ||
220 | $! | ||
221 | $ ENDIF | ||
222 | $! | ||
223 | $! Link The Program, Check To See If We Need To Link With RSAREF Or Not. | ||
224 | $! Check To See If We Are To Link With A Specific TCP/IP Library. | ||
225 | $! | ||
226 | $ IF (TCPIP_LIB.NES."") | ||
227 | $ THEN | ||
228 | $! | ||
229 | $! Don't Link With The RSAREF Routines And TCP/IP Library. | ||
230 | $! | ||
231 | $ LINK /'DEBUGGER' /'TRACEBACK' /EXECTABLE = 'EXE_FILE' - | ||
232 | 'OBJECT_FILE', - | ||
233 | 'SSL_LIB' /LIBRARY, - | ||
234 | 'CRYPTO_LIB' /LIBRARY, - | ||
235 | 'TCPIP_LIB', - | ||
236 | 'OPT_FILE' /OPTIONS | ||
237 | $! | ||
238 | $! Else... | ||
239 | $! | ||
240 | $ ELSE | ||
241 | $! | ||
242 | $! Don't Link With The RSAREF Routines And Link With A TCP/IP Library. | ||
243 | $! | ||
244 | $ LINK /'DEBUGGER' /'TRACEBACK' /EXECUTABLE = 'EXE_FILE' - | ||
245 | 'OBJECT_FILE', - | ||
246 | 'SSL_LIB' /LIBRARY, - | ||
247 | 'CRYPTO_LIB' /LIBRARY, - | ||
248 | 'OPT_FILE' /OPTIONS | ||
249 | $! | ||
250 | $! End The TCP/IP Library Check. | ||
251 | $! | ||
252 | $ ENDIF | ||
253 | $! | ||
254 | $! Go Back And Do It Again. | ||
255 | $! | ||
256 | $ GOTO NEXT_FILE | ||
257 | $! | ||
258 | $! All Done With This Library Part. | ||
259 | $! | ||
260 | $ FILE_DONE: | ||
261 | $! | ||
262 | $! All Done, Time To Exit. | ||
263 | $! | ||
264 | $ EXIT: | ||
265 | $ GOSUB CLEANUP | ||
266 | $ EXIT | ||
267 | $! | ||
268 | $! Check For The Link Option FIle. | ||
269 | $! | ||
270 | $ CHECK_OPT_FILE: | ||
271 | $! | ||
272 | $! Check To See If We Need To Make A VAX C Option File. | ||
273 | $! | ||
274 | $ IF (COMPILER.EQS."VAXC") | ||
275 | $ THEN | ||
276 | $! | ||
277 | $! Check To See If We Already Have A VAX C Linker Option File. | ||
278 | $! | ||
279 | $ IF (F$SEARCH(OPT_FILE).EQS."") | ||
280 | $ THEN | ||
281 | $! | ||
282 | $! We Need A VAX C Linker Option File. | ||
283 | $! | ||
284 | $ CREATE 'OPT_FILE' | ||
285 | $DECK | ||
286 | ! | ||
287 | ! Default System Options File To Link Against | ||
288 | ! The Sharable VAX C Runtime Library. | ||
289 | ! | ||
290 | SYS$SHARE:VAXCRTL.EXE /SHAREABLE | ||
291 | $EOD | ||
292 | $! | ||
293 | $! End The Option File Check. | ||
294 | $! | ||
295 | $ ENDIF | ||
296 | $! | ||
297 | $! End The VAXC Check. | ||
298 | $! | ||
299 | $ ENDIF | ||
300 | $! | ||
301 | $! Check To See If We Need A GNU C Option File. | ||
302 | $! | ||
303 | $ IF (COMPILER.EQS."GNUC") | ||
304 | $ THEN | ||
305 | $! | ||
306 | $! Check To See If We Already Have A GNU C Linker Option File. | ||
307 | $! | ||
308 | $ IF (F$SEARCH(OPT_FILE).EQS."") | ||
309 | $ THEN | ||
310 | $! | ||
311 | $! We Need A GNU C Linker Option File. | ||
312 | $! | ||
313 | $ CREATE 'OPT_FILE' | ||
314 | $DECK | ||
315 | ! | ||
316 | ! Default System Options File To Link Agianst | ||
317 | ! The Sharable C Runtime Library. | ||
318 | ! | ||
319 | GNU_CC:[000000]GCCLIB.OLB /LIBRARY | ||
320 | SYS$SHARE:VAXCRTL.EXE /SHAREABLE | ||
321 | $EOD | ||
322 | $! | ||
323 | $! End The Option File Check. | ||
324 | $! | ||
325 | $ ENDIF | ||
326 | $! | ||
327 | $! End The GNU C Check. | ||
328 | $! | ||
329 | $ ENDIF | ||
330 | $! | ||
331 | $! Check To See If We Need A DEC C Option File. | ||
332 | $! | ||
333 | $ IF (COMPILER.EQS."DECC") | ||
334 | $ THEN | ||
335 | $! | ||
336 | $! Check To See If We Already Have A DEC C Linker Option File. | ||
337 | $! | ||
338 | $ IF (F$SEARCH(OPT_FILE).EQS."") | ||
339 | $ THEN | ||
340 | $! | ||
341 | $! Figure Out If We Need A non-VAX Or A VAX Linker Option File. | ||
342 | $! | ||
343 | $ IF (ARCH.EQS."VAX") | ||
344 | $ THEN | ||
345 | $! | ||
346 | $! We Need A DEC C Linker Option File For VAX. | ||
347 | $! | ||
348 | $ CREATE 'OPT_FILE' | ||
349 | $DECK | ||
350 | ! | ||
351 | ! Default System Options File To Link Agianst | ||
352 | ! The Sharable DEC C Runtime Library. | ||
353 | ! | ||
354 | SYS$SHARE:DECC$SHR.EXE /SHAREABLE | ||
355 | $EOD | ||
356 | $! | ||
357 | $! Else... | ||
358 | $! | ||
359 | $ ELSE | ||
360 | $! | ||
361 | $! Create The non-VAX Linker Option File. | ||
362 | $! | ||
363 | $ CREATE 'OPT_FILE' | ||
364 | $DECK | ||
365 | ! | ||
366 | ! Default System Options File For non-VAX To Link Agianst | ||
367 | ! The Sharable C Runtime Library. | ||
368 | ! | ||
369 | SYS$SHARE:CMA$OPEN_LIB_SHR.EXE /SHAREABLE | ||
370 | SYS$SHARE:CMA$OPEN_RTL.EXE /SHAREABLE | ||
371 | $EOD | ||
372 | $! | ||
373 | $! End The DEC C Option File Check. | ||
374 | $! | ||
375 | $ ENDIF | ||
376 | $! | ||
377 | $! End The Option File Search. | ||
378 | $! | ||
379 | $ ENDIF | ||
380 | $! | ||
381 | $! End The DEC C Check. | ||
382 | $! | ||
383 | $ ENDIF | ||
384 | $! | ||
385 | $! Tell The User What Linker Option File We Are Using. | ||
386 | $! | ||
387 | $ WRITE SYS$OUTPUT "Using Linker Option File ",OPT_FILE,"." | ||
388 | $! | ||
389 | $! Time To RETURN. | ||
390 | $! | ||
391 | $ RETURN | ||
392 | $! | ||
393 | $! Check To See If We Have The Appropiate Libraries. | ||
394 | $! | ||
395 | $ LIB_CHECK: | ||
396 | $! | ||
397 | $! Look For The Library LIBCRYPTO.OLB. | ||
398 | $! | ||
399 | $ IF (F$SEARCH(CRYPTO_LIB).EQS."") | ||
400 | $ THEN | ||
401 | $! | ||
402 | $! Tell The User We Can't Find The LIBCRYPTO.OLB Library. | ||
403 | $! | ||
404 | $ WRITE SYS$OUTPUT "" | ||
405 | $ WRITE SYS$OUTPUT "Can't Find The Library ",CRYPTO_LIB,"." | ||
406 | $ WRITE SYS$OUTPUT "We Can't Link Without It." | ||
407 | $ WRITE SYS$OUTPUT "" | ||
408 | $! | ||
409 | $! Since We Can't Link Without It, Exit. | ||
410 | $! | ||
411 | $ EXIT | ||
412 | $! | ||
413 | $! End The Crypto Library Check. | ||
414 | $! | ||
415 | $ ENDIF | ||
416 | $! | ||
417 | $! Look For The Library LIBSSL.OLB. | ||
418 | $! | ||
419 | $ IF (F$SEARCH(SSL_LIB).EQS."") | ||
420 | $ THEN | ||
421 | $! | ||
422 | $! Tell The User We Can't Find The LIBSSL.OLB Library. | ||
423 | $! | ||
424 | $ WRITE SYS$OUTPUT "" | ||
425 | $ WRITE SYS$OUTPUT "Can't Find The Library ",SSL_LIB,"." | ||
426 | $ WRITE SYS$OUTPUT "Some Of The Test Programs Need To Link To It." | ||
427 | $ WRITE SYS$OUTPUT "" | ||
428 | $! | ||
429 | $! Since We Can't Link Without It, Exit. | ||
430 | $! | ||
431 | $ EXIT | ||
432 | $! | ||
433 | $! End The SSL Library Check. | ||
434 | $! | ||
435 | $ ENDIF | ||
436 | $! | ||
437 | $! Time To Return. | ||
438 | $! | ||
439 | $ RETURN | ||
440 | $! | ||
441 | $! Check The User's Options. | ||
442 | $! | ||
443 | $ CHECK_OPTIONS: | ||
444 | $! | ||
445 | $! Check To See If P1 Is Blank. | ||
446 | $! | ||
447 | $ IF (P1.EQS."NODEBUG") | ||
448 | $ THEN | ||
449 | $! | ||
450 | $! P1 Is NODEBUG, So Compile Without Debugger Information. | ||
451 | $! | ||
452 | $ DEBUGGER = "NODEBUG" | ||
453 | $ TRACEBACK = "NOTRACEBACK" | ||
454 | $ GCC_OPTIMIZE = "OPTIMIZE" | ||
455 | $ CC_OPTIMIZE = "OPTIMIZE" | ||
456 | $ WRITE SYS$OUTPUT "No Debugger Information Will Be Produced During Compile." | ||
457 | $ WRITE SYS$OUTPUT "Compiling With Compiler Optimization." | ||
458 | $! | ||
459 | $! Else... | ||
460 | $! | ||
461 | $ ELSE | ||
462 | $! | ||
463 | $! Check To See If We Are To Compile With Debugger Information. | ||
464 | $! | ||
465 | $ IF (P1.EQS."DEBUG") | ||
466 | $ THEN | ||
467 | $! | ||
468 | $! Compile With Debugger Information. | ||
469 | $! | ||
470 | $ DEBUGGER = "DEBUG" | ||
471 | $ TRACEBACK = "TRACEBACK" | ||
472 | $ GCC_OPTIMIZE = "NOOPTIMIZE" | ||
473 | $ CC_OPTIMIZE = "NOOPTIMIZE" | ||
474 | $ WRITE SYS$OUTPUT "Debugger Information Will Be Produced During Compile." | ||
475 | $ WRITE SYS$OUTPUT "Compiling Without Compiler Optimization." | ||
476 | $! | ||
477 | $! Else... | ||
478 | $! | ||
479 | $ ELSE | ||
480 | $! | ||
481 | $! Tell The User Entered An Invalid Option.. | ||
482 | $! | ||
483 | $ WRITE SYS$OUTPUT "" | ||
484 | $ WRITE SYS$OUTPUT "The Option ",P1," Is Invalid. The Valid Options Are:" | ||
485 | $ WRITE SYS$OUTPUT "" | ||
486 | $ WRITE SYS$OUTPUT " DEBUG : Compile With The Debugger Information." | ||
487 | $ WRITE SYS$OUTPUT " NODEBUG : Compile Without The Debugger Information." | ||
488 | $ WRITE SYS$OUTPUT "" | ||
489 | $! | ||
490 | $! Time To EXIT. | ||
491 | $! | ||
492 | $ EXIT | ||
493 | $! | ||
494 | $! End The Valid Arguement Check. | ||
495 | $! | ||
496 | $ ENDIF | ||
497 | $! | ||
498 | $! End The P2 Check. | ||
499 | $! | ||
500 | $ ENDIF | ||
501 | $! | ||
502 | $! Check To See If P2 Is Blank. | ||
503 | $! | ||
504 | $ IF (P2.EQS."") | ||
505 | $ THEN | ||
506 | $! | ||
507 | $! O.K., The User Didn't Specify A Compiler, Let's Try To | ||
508 | $! Find Out Which One To Use. | ||
509 | $! | ||
510 | $! Check To See If We Have GNU C. | ||
511 | $! | ||
512 | $ IF (F$TRNLNM("GNU_CC").NES."") | ||
513 | $ THEN | ||
514 | $! | ||
515 | $! Looks Like GNUC, Set To Use GNUC. | ||
516 | $! | ||
517 | $ P2 = "GNUC" | ||
518 | $! | ||
519 | $! End The GNU C Compiler Check. | ||
520 | $! | ||
521 | $ ELSE | ||
522 | $! | ||
523 | $! Check To See If We Have VAXC Or DECC. | ||
524 | $! | ||
525 | $ IF (ARCH.NES."VAX").OR.(F$TRNLNM("DECC$CC_DEFAULT").NES."") | ||
526 | $ THEN | ||
527 | $! | ||
528 | $! Looks Like DECC, Set To Use DECC. | ||
529 | $! | ||
530 | $ P2 = "DECC" | ||
531 | $! | ||
532 | $! Else... | ||
533 | $! | ||
534 | $ ELSE | ||
535 | $! | ||
536 | $! Looks Like VAXC, Set To Use VAXC. | ||
537 | $! | ||
538 | $ P2 = "VAXC" | ||
539 | $! | ||
540 | $! End The VAXC Compiler Check. | ||
541 | $! | ||
542 | $ ENDIF | ||
543 | $! | ||
544 | $! End The DECC & VAXC Compiler Check. | ||
545 | $! | ||
546 | $ ENDIF | ||
547 | $! | ||
548 | $! End The Compiler Check. | ||
549 | $! | ||
550 | $ ENDIF | ||
551 | $! | ||
552 | $! Check To See If We Have A Option For P3. | ||
553 | $! | ||
554 | $ IF (P3.EQS."") | ||
555 | $ THEN | ||
556 | $! | ||
557 | $! Find out what socket library we have available | ||
558 | $! | ||
559 | $ IF F$PARSE("SOCKETSHR:") .NES. "" | ||
560 | $ THEN | ||
561 | $! | ||
562 | $! We have SOCKETSHR, and it is my opinion that it's the best to use. | ||
563 | $! | ||
564 | $ P3 = "SOCKETSHR" | ||
565 | $! | ||
566 | $! Tell the user | ||
567 | $! | ||
568 | $ WRITE SYS$OUTPUT "Using SOCKETSHR for TCP/IP" | ||
569 | $! | ||
570 | $! Else, let's look for something else | ||
571 | $! | ||
572 | $ ELSE | ||
573 | $! | ||
574 | $! Like UCX (the reason to do this before Multinet is that the UCX | ||
575 | $! emulation is easier to use...) | ||
576 | $! | ||
577 | $ IF F$TRNLNM("UCX$IPC_SHR") .NES. "" - | ||
578 | .OR. F$PARSE("SYS$SHARE:UCX$IPC_SHR.EXE") .NES. "" - | ||
579 | .OR. F$PARSE("SYS$LIBRARY:UCX$IPC.OLB") .NES. "" | ||
580 | $ THEN | ||
581 | $! | ||
582 | $! Last resort: a UCX or UCX-compatible library | ||
583 | $! | ||
584 | $ P3 = "UCX" | ||
585 | $! | ||
586 | $! Tell the user | ||
587 | $! | ||
588 | $ WRITE SYS$OUTPUT "Using UCX or an emulation thereof for TCP/IP" | ||
589 | $! | ||
590 | $! That was all... | ||
591 | $! | ||
592 | $ ENDIF | ||
593 | $ ENDIF | ||
594 | $ ENDIF | ||
595 | $! | ||
596 | $! Set Up Initial CC Definitions, Possibly With User Ones | ||
597 | $! | ||
598 | $ CCDEFS = "TCPIP_TYPE_''P3'" | ||
599 | $ IF F$TYPE(USER_CCDEFS) .NES. "" THEN CCDEFS = CCDEFS + "," + USER_CCDEFS | ||
600 | $ CCEXTRAFLAGS = "" | ||
601 | $ IF F$TYPE(USER_CCFLAGS) .NES. "" THEN CCEXTRAFLAGS = USER_CCFLAGS | ||
602 | $ CCDISABLEWARNINGS = "LONGLONGTYPE,LONGLONGSUFX,FOUNDCR" | ||
603 | $ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. "" THEN - | ||
604 | CCDISABLEWARNINGS = CCDISABLEWARNINGS + "," + USER_CCDISABLEWARNINGS | ||
605 | $! | ||
606 | $! Check To See If The User Entered A Valid Paramter. | ||
607 | $! | ||
608 | $ IF (P2.EQS."VAXC").OR.(P2.EQS."DECC").OR.(P2.EQS."GNUC") | ||
609 | $ THEN | ||
610 | $! | ||
611 | $! Check To See If The User Wanted DECC. | ||
612 | $! | ||
613 | $ IF (P2.EQS."DECC") | ||
614 | $ THEN | ||
615 | $! | ||
616 | $! Looks Like DECC, Set To Use DECC. | ||
617 | $! | ||
618 | $ COMPILER = "DECC" | ||
619 | $! | ||
620 | $! Tell The User We Are Using DECC. | ||
621 | $! | ||
622 | $ WRITE SYS$OUTPUT "Using DECC 'C' Compiler." | ||
623 | $! | ||
624 | $! Use DECC... | ||
625 | $! | ||
626 | $ CC = "CC" | ||
627 | $ IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" - | ||
628 | THEN CC = "CC /DECC" | ||
629 | $ CC = CC + "/''CC_OPTIMIZE' /''DEBUGGER' /STANDARD=ANSI89" + - | ||
630 | "/NOLIST /PREFIX=ALL" + - | ||
631 | "/INCLUDE=(SYS$DISK:[-],SYS$DISK:[-.CRYPTO])" + CCEXTRAFLAGS | ||
632 | $! | ||
633 | $! Define The Linker Options File Name. | ||
634 | $! | ||
635 | $ OPT_FILE = "''EXE_DIR'VAX_DECC_OPTIONS.OPT" | ||
636 | $! | ||
637 | $! End DECC Check. | ||
638 | $! | ||
639 | $ ENDIF | ||
640 | $! | ||
641 | $! Check To See If We Are To Use VAXC. | ||
642 | $! | ||
643 | $ IF (P2.EQS."VAXC") | ||
644 | $ THEN | ||
645 | $! | ||
646 | $! Looks Like VAXC, Set To Use VAXC. | ||
647 | $! | ||
648 | $ COMPILER = "VAXC" | ||
649 | $! | ||
650 | $! Tell The User We Are Using VAX C. | ||
651 | $! | ||
652 | $ WRITE SYS$OUTPUT "Using VAXC 'C' Compiler." | ||
653 | $! | ||
654 | $! Compile Using VAXC. | ||
655 | $! | ||
656 | $ CC = "CC" | ||
657 | $ IF ARCH.NES."VAX" | ||
658 | $ THEN | ||
659 | $ WRITE SYS$OUTPUT "There is no VAX C on ''ARCH'!" | ||
660 | $ EXIT | ||
661 | $ ENDIF | ||
662 | $ IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC /VAXC" | ||
663 | $ CC = CC + "/''CC_OPTIMIZE' /''DEBUGGER' /NOLIST" + - | ||
664 | "/INCLUDE=(SYS$DISK:[-],SYS$DISK:[-.CRYPTO])" + CCEXTRAFLAGS | ||
665 | $ CCDEFS = CCDEFS + ",""VAXC""" | ||
666 | $! | ||
667 | $! Define <sys> As SYS$COMMON:[SYSLIB] | ||
668 | $! | ||
669 | $ DEFINE /NOLOG SYS SYS$COMMON:[SYSLIB] | ||
670 | $! | ||
671 | $! Define The Linker Options File Name. | ||
672 | $! | ||
673 | $ OPT_FILE = "''EXE_DIR'VAX_VAXC_OPTIONS.OPT" | ||
674 | $! | ||
675 | $! End VAXC Check | ||
676 | $! | ||
677 | $ ENDIF | ||
678 | $! | ||
679 | $! Check To See If We Are To Use GNU C. | ||
680 | $! | ||
681 | $ IF (P2.EQS."GNUC") | ||
682 | $ THEN | ||
683 | $! | ||
684 | $! Looks Like GNUC, Set To Use GNUC. | ||
685 | $! | ||
686 | $ COMPILER = "GNUC" | ||
687 | $! | ||
688 | $! Tell The User We Are Using GNUC. | ||
689 | $! | ||
690 | $ WRITE SYS$OUTPUT "Using GNU 'C' Compiler." | ||
691 | $! | ||
692 | $! Use GNU C... | ||
693 | $! | ||
694 | $ CC = "GCC /NOCASE_HACK /''GCC_OPTIMIZE' /''DEBUGGER' /NOLIST" + - | ||
695 | "/INCLUDE=(SYS$DISK:[-],SYS$DISK:[-.CRYPTO])" + CCEXTRAFLAGS | ||
696 | $! | ||
697 | $! Define The Linker Options File Name. | ||
698 | $! | ||
699 | $ OPT_FILE = "''EXE_DIR'VAX_GNUC_OPTIONS.OPT" | ||
700 | $! | ||
701 | $! End The GNU C Check. | ||
702 | $! | ||
703 | $ ENDIF | ||
704 | $! | ||
705 | $! Set up default defines | ||
706 | $! | ||
707 | $ CCDEFS = """FLAT_INC=1""," + CCDEFS | ||
708 | $! | ||
709 | $! Finish up the definition of CC. | ||
710 | $! | ||
711 | $ IF COMPILER .EQS. "DECC" | ||
712 | $ THEN | ||
713 | $ IF CCDISABLEWARNINGS .EQS. "" | ||
714 | $ THEN | ||
715 | $ CC4DISABLEWARNINGS = "DOLLARID" | ||
716 | $ ELSE | ||
717 | $ CC4DISABLEWARNINGS = CCDISABLEWARNINGS + ",DOLLARID" | ||
718 | $ CCDISABLEWARNINGS = "/WARNING=(DISABLE=(" + CCDISABLEWARNINGS + "))" | ||
719 | $ ENDIF | ||
720 | $ CC4DISABLEWARNINGS = "/WARNING=(DISABLE=(" + CC4DISABLEWARNINGS + "))" | ||
721 | $ ELSE | ||
722 | $ CCDISABLEWARNINGS = "" | ||
723 | $ CC4DISABLEWARNINGS = "" | ||
724 | $ ENDIF | ||
725 | $ CC = CC + "/DEFINE=(" + CCDEFS + ")" + CCDISABLEWARNINGS | ||
726 | $! | ||
727 | $! Show user the result | ||
728 | $! | ||
729 | $ WRITE /SYMBOL SYS$OUTPUT "Main Compiling Command: ", CC | ||
730 | $! | ||
731 | $! Else The User Entered An Invalid Arguement. | ||
732 | $! | ||
733 | $ ELSE | ||
734 | $! | ||
735 | $! Tell The User We Don't Know What They Want. | ||
736 | $! | ||
737 | $ WRITE SYS$OUTPUT "" | ||
738 | $ WRITE SYS$OUTPUT "The Option ",P2," Is Invalid. The Valid Options Are:" | ||
739 | $ WRITE SYS$OUTPUT "" | ||
740 | $ WRITE SYS$OUTPUT " VAXC : To Compile With VAX C." | ||
741 | $ WRITE SYS$OUTPUT " DECC : To Compile With DEC C." | ||
742 | $ WRITE SYS$OUTPUT " GNUC : To Compile With GNU C." | ||
743 | $ WRITE SYS$OUTPUT "" | ||
744 | $! | ||
745 | $! Time To EXIT. | ||
746 | $! | ||
747 | $ EXIT | ||
748 | $ ENDIF | ||
749 | $! | ||
750 | $! Time to check the contents, and to make sure we get the correct library. | ||
751 | $! | ||
752 | $ IF P3.EQS."SOCKETSHR" .OR. P3.EQS."MULTINET" .OR. P3.EQS."UCX" - | ||
753 | .OR. P3.EQS."TCPIP" .OR. P3.EQS."NONE" | ||
754 | $ THEN | ||
755 | $! | ||
756 | $! Check to see if SOCKETSHR was chosen | ||
757 | $! | ||
758 | $ IF P3.EQS."SOCKETSHR" | ||
759 | $ THEN | ||
760 | $! | ||
761 | $! Set the library to use SOCKETSHR | ||
762 | $! | ||
763 | $ TCPIP_LIB = "SYS$DISK:[-.VMS]SOCKETSHR_SHR.OPT /OPTIONS" | ||
764 | $! | ||
765 | $! Done with SOCKETSHR | ||
766 | $! | ||
767 | $ ENDIF | ||
768 | $! | ||
769 | $! Check to see if MULTINET was chosen | ||
770 | $! | ||
771 | $ IF P3.EQS."MULTINET" | ||
772 | $ THEN | ||
773 | $! | ||
774 | $! Set the library to use UCX emulation. | ||
775 | $! | ||
776 | $ P3 = "UCX" | ||
777 | $! | ||
778 | $! Done with MULTINET | ||
779 | $! | ||
780 | $ ENDIF | ||
781 | $! | ||
782 | $! Check to see if UCX was chosen | ||
783 | $! | ||
784 | $ IF P3.EQS."UCX" | ||
785 | $ THEN | ||
786 | $! | ||
787 | $! Set the library to use UCX. | ||
788 | $! | ||
789 | $ TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_DECC.OPT /OPTIONS" | ||
790 | $ IF F$TRNLNM("UCX$IPC_SHR") .NES. "" | ||
791 | $ THEN | ||
792 | $ TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_DECC_LOG.OPT /OPTIONS" | ||
793 | $ ELSE | ||
794 | $ IF COMPILER .NES. "DECC" .AND. ARCH .EQS. "VAX" THEN - | ||
795 | TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_VAXC.OPT /OPTIONS" | ||
796 | $ ENDIF | ||
797 | $! | ||
798 | $! Done with UCX | ||
799 | $! | ||
800 | $ ENDIF | ||
801 | $! | ||
802 | $! Check to see if TCPIP was chosen | ||
803 | $! | ||
804 | $ IF P3.EQS."TCPIP" | ||
805 | $ THEN | ||
806 | $! | ||
807 | $! Set the library to use TCPIP (post UCX). | ||
808 | $! | ||
809 | $ TCPIP_LIB = "SYS$DISK:[-.VMS]TCPIP_SHR_DECC.OPT /OPTIONS" | ||
810 | $! | ||
811 | $! Done with TCPIP | ||
812 | $! | ||
813 | $ ENDIF | ||
814 | $! | ||
815 | $! Check to see if NONE was chosen | ||
816 | $! | ||
817 | $ IF P3.EQS."NONE" | ||
818 | $ THEN | ||
819 | $! | ||
820 | $! Do not use a TCPIP library. | ||
821 | $! | ||
822 | $ TCPIP_LIB = "" | ||
823 | $! | ||
824 | $! Done with NONE | ||
825 | $! | ||
826 | $ ENDIF | ||
827 | $! | ||
828 | $! Print info | ||
829 | $! | ||
830 | $ WRITE SYS$OUTPUT "TCP/IP library spec: ", TCPIP_LIB | ||
831 | $! | ||
832 | $! Else The User Entered An Invalid Arguement. | ||
833 | $! | ||
834 | $ ELSE | ||
835 | $! | ||
836 | $! Tell The User We Don't Know What They Want. | ||
837 | $! | ||
838 | $ WRITE SYS$OUTPUT "" | ||
839 | $ WRITE SYS$OUTPUT "The Option ",P3," Is Invalid. The Valid Options Are:" | ||
840 | $ WRITE SYS$OUTPUT "" | ||
841 | $ WRITE SYS$OUTPUT " SOCKETSHR : To link with SOCKETSHR TCP/IP library." | ||
842 | $ WRITE SYS$OUTPUT " UCX : To link with UCX TCP/IP library." | ||
843 | $ WRITE SYS$OUTPUT " TCPIP : To link with TCPIP (post UCX) TCP/IP library." | ||
844 | $ WRITE SYS$OUTPUT "" | ||
845 | $! | ||
846 | $! Time To EXIT. | ||
847 | $! | ||
848 | $ EXIT | ||
849 | $! | ||
850 | $! Done with TCP/IP libraries | ||
851 | $! | ||
852 | $ ENDIF | ||
853 | $! | ||
854 | $! Special Threads For OpenVMS v7.1 Or Later | ||
855 | $! | ||
856 | $! Written By: Richard Levitte | ||
857 | $! richard@levitte.org | ||
858 | $! | ||
859 | $! | ||
860 | $! Check To See If We Have A Option For P4. | ||
861 | $! | ||
862 | $ IF (P4.EQS."") | ||
863 | $ THEN | ||
864 | $! | ||
865 | $! Get The Version Of VMS We Are Using. | ||
866 | $! | ||
867 | $ ISSEVEN := | ||
868 | $ TMP = F$ELEMENT(0,"-",F$EXTRACT(1,4,F$GETSYI("VERSION"))) | ||
869 | $ TMP = F$INTEGER(F$ELEMENT(0,".",TMP)+F$ELEMENT(1,".",TMP)) | ||
870 | $! | ||
871 | $! Check To See If The VMS Version Is v7.1 Or Later. | ||
872 | $! | ||
873 | $ IF (TMP.GE.71) | ||
874 | $ THEN | ||
875 | $! | ||
876 | $! We Have OpenVMS v7.1 Or Later, So Use The Special Threads. | ||
877 | $! | ||
878 | $ ISSEVEN := ,PTHREAD_USE_D4 | ||
879 | $! | ||
880 | $! End The VMS Version Check. | ||
881 | $! | ||
882 | $ ENDIF | ||
883 | $! | ||
884 | $! End The P4 Check. | ||
885 | $! | ||
886 | $ ENDIF | ||
887 | $! | ||
888 | $! Time To RETURN... | ||
889 | $! | ||
890 | $ RETURN | ||
891 | $! | ||
892 | $ INITIALISE: | ||
893 | $! | ||
894 | $! Save old value of the logical name OPENSSL | ||
895 | $! | ||
896 | $ __SAVE_OPENSSL = F$TRNLNM("OPENSSL","LNM$PROCESS_TABLE") | ||
897 | $! | ||
898 | $! Save directory information | ||
899 | $! | ||
900 | $ __HERE = F$PARSE(F$PARSE("A.;",F$ENVIRONMENT("PROCEDURE"))-"A.;","[]A.;") - "A.;" | ||
901 | $ __HERE = F$EDIT(__HERE,"UPCASE") | ||
902 | $ __TOP = __HERE - "TEST]" | ||
903 | $ __INCLUDE = __TOP + "INCLUDE.OPENSSL]" | ||
904 | $! | ||
905 | $! Set up the logical name OPENSSL to point at the include directory | ||
906 | $! | ||
907 | $ DEFINE OPENSSL /NOLOG '__INCLUDE' | ||
908 | $! | ||
909 | $! Done | ||
910 | $! | ||
911 | $ RETURN | ||
912 | $! | ||
913 | $ CLEANUP: | ||
914 | $! | ||
915 | $! Restore the logical name OPENSSL if it had a value | ||
916 | $! | ||
917 | $ IF __SAVE_OPENSSL .EQS. "" | ||
918 | $ THEN | ||
919 | $ DEASSIGN OPENSSL | ||
920 | $ ELSE | ||
921 | $ DEFINE /NOLOG OPENSSL '__SAVE_OPENSSL' | ||
922 | $ ENDIF | ||
923 | $! | ||
924 | $! Done | ||
925 | $! | ||
926 | $ RETURN | ||
diff --git a/src/lib/libssl/test/tcrl.com b/src/lib/libssl/test/tcrl.com new file mode 100644 index 0000000000..1f606eb850 --- /dev/null +++ b/src/lib/libssl/test/tcrl.com | |||
@@ -0,0 +1,85 @@ | |||
1 | $! TCRL.COM -- Tests crl keys | ||
2 | $ | ||
3 | $ __arch := VAX | ||
4 | $ if f$getsyi("cpu") .ge. 128 then - | ||
5 | __arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE") | ||
6 | $ if __arch .eqs. "" then __arch := UNK | ||
7 | $ exe_dir := sys$disk:[-.'__arch'.exe.apps] | ||
8 | $ | ||
9 | $ cmd := mcr 'exe_dir'openssl crl | ||
10 | $ | ||
11 | $ t := testcrl.pem | ||
12 | $ if p1 .nes. "" then t = p1 | ||
13 | $ | ||
14 | $ write sys$output "testing CRL conversions" | ||
15 | $ if f$search("fff.*") .nes "" then delete fff.*;* | ||
16 | $ if f$search("ff.*") .nes "" then delete ff.*;* | ||
17 | $ if f$search("f.*") .nes "" then delete f.*;* | ||
18 | $ convert/fdl=sys$input: 't' fff.p | ||
19 | RECORD | ||
20 | FORMAT STREAM_LF | ||
21 | $ | ||
22 | $ write sys$output "p -> d" | ||
23 | $ 'cmd' -in fff.p -inform p -outform d -out f.d | ||
24 | $ if $severity .ne. 1 then exit 3 | ||
25 | $! write sys$output "p -> t" | ||
26 | $! 'cmd' -in fff.p -inform p -outform t -out f.t | ||
27 | $! if $severity .ne. 1 then exit 3 | ||
28 | $ write sys$output "p -> p" | ||
29 | $ 'cmd' -in fff.p -inform p -outform p -out f.p | ||
30 | $ if $severity .ne. 1 then exit 3 | ||
31 | $ | ||
32 | $ write sys$output "d -> d" | ||
33 | $ 'cmd' -in f.d -inform d -outform d -out ff.d1 | ||
34 | $ if $severity .ne. 1 then exit 3 | ||
35 | $! write sys$output "t -> d" | ||
36 | $! 'cmd' -in f.t -inform t -outform d -out ff.d2 | ||
37 | $! if $severity .ne. 1 then exit 3 | ||
38 | $ write sys$output "p -> d" | ||
39 | $ 'cmd' -in f.p -inform p -outform d -out ff.d3 | ||
40 | $ if $severity .ne. 1 then exit 3 | ||
41 | $ | ||
42 | $! write sys$output "d -> t" | ||
43 | $! 'cmd' -in f.d -inform d -outform t -out ff.t1 | ||
44 | $! if $severity .ne. 1 then exit 3 | ||
45 | $! write sys$output "t -> t" | ||
46 | $! 'cmd' -in f.t -inform t -outform t -out ff.t2 | ||
47 | $! if $severity .ne. 1 then exit 3 | ||
48 | $! write sys$output "p -> t" | ||
49 | $! 'cmd' -in f.p -inform p -outform t -out ff.t3 | ||
50 | $! if $severity .ne. 1 then exit 3 | ||
51 | $ | ||
52 | $ write sys$output "d -> p" | ||
53 | $ 'cmd' -in f.d -inform d -outform p -out ff.p1 | ||
54 | $ if $severity .ne. 1 then exit 3 | ||
55 | $! write sys$output "t -> p" | ||
56 | $! 'cmd' -in f.t -inform t -outform p -out ff.p2 | ||
57 | $! if $severity .ne. 1 then exit 3 | ||
58 | $ write sys$output "p -> p" | ||
59 | $ 'cmd' -in f.p -inform p -outform p -out ff.p3 | ||
60 | $ if $severity .ne. 1 then exit 3 | ||
61 | $ | ||
62 | $ backup/compare fff.p f.p | ||
63 | $ if $severity .ne. 1 then exit 3 | ||
64 | $ backup/compare fff.p ff.p1 | ||
65 | $ if $severity .ne. 1 then exit 3 | ||
66 | $! backup/compare fff.p ff.p2 | ||
67 | $! if $severity .ne. 1 then exit 3 | ||
68 | $ backup/compare fff.p ff.p3 | ||
69 | $ if $severity .ne. 1 then exit 3 | ||
70 | $ | ||
71 | $! backup/compare f.t ff.t1 | ||
72 | $! if $severity .ne. 1 then exit 3 | ||
73 | $! backup/compare f.t ff.t2 | ||
74 | $! if $severity .ne. 1 then exit 3 | ||
75 | $! backup/compare f.t ff.t3 | ||
76 | $! if $severity .ne. 1 then exit 3 | ||
77 | $ | ||
78 | $ backup/compare f.p ff.p1 | ||
79 | $ if $severity .ne. 1 then exit 3 | ||
80 | $! backup/compare f.p ff.p2 | ||
81 | $! if $severity .ne. 1 then exit 3 | ||
82 | $ backup/compare f.p ff.p3 | ||
83 | $ if $severity .ne. 1 then exit 3 | ||
84 | $ | ||
85 | $ delete f.*;*,ff.*;*,fff.*;* | ||
diff --git a/src/lib/libssl/test/test_aesni b/src/lib/libssl/test/test_aesni new file mode 100644 index 0000000000..e8fb63ee2b --- /dev/null +++ b/src/lib/libssl/test/test_aesni | |||
@@ -0,0 +1,69 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | PROG=$1 | ||
4 | |||
5 | if [ -x $PROG ]; then | ||
6 | if expr "x`$PROG version`" : "xOpenSSL" > /dev/null; then | ||
7 | : | ||
8 | else | ||
9 | echo "$PROG is not OpenSSL executable" | ||
10 | exit 1 | ||
11 | fi | ||
12 | else | ||
13 | echo "$PROG is not executable" | ||
14 | exit 1; | ||
15 | fi | ||
16 | |||
17 | if $PROG engine aesni | grep -v no-aesni; then | ||
18 | |||
19 | HASH=`cat $PROG | $PROG dgst -hex` | ||
20 | |||
21 | AES_ALGS=" aes-128-ecb aes-192-ecb aes-256-ecb \ | ||
22 | aes-128-cbc aes-192-cbc aes-256-cbc \ | ||
23 | aes-128-cfb aes-192-cfb aes-256-cfb \ | ||
24 | aes-128-ofb aes-192-ofb aes-256-ofb" | ||
25 | BUFSIZE="16 32 48 64 80 96 128 144 999" | ||
26 | |||
27 | nerr=0 | ||
28 | |||
29 | for alg in $AES_ALGS; do | ||
30 | echo $alg | ||
31 | for bufsize in $BUFSIZE; do | ||
32 | TEST=`( cat $PROG | \ | ||
33 | $PROG enc -e -k "$HASH" -$alg -bufsize $bufsize -engine aesni | \ | ||
34 | $PROG enc -d -k "$HASH" -$alg | \ | ||
35 | $PROG dgst -hex ) 2>/dev/null` | ||
36 | if [ "$TEST" != "$HASH" ]; then | ||
37 | echo "-$alg/$bufsize encrypt test failed" | ||
38 | nerr=`expr $nerr + 1` | ||
39 | fi | ||
40 | done | ||
41 | for bufsize in $BUFSIZE; do | ||
42 | TEST=`( cat $PROG | \ | ||
43 | $PROG enc -e -k "$HASH" -$alg | \ | ||
44 | $PROG enc -d -k "$HASH" -$alg -bufsize $bufsize -engine aesni | \ | ||
45 | $PROG dgst -hex ) 2>/dev/null` | ||
46 | if [ "$TEST" != "$HASH" ]; then | ||
47 | echo "-$alg/$bufsize decrypt test failed" | ||
48 | nerr=`expr $nerr + 1` | ||
49 | fi | ||
50 | done | ||
51 | TEST=`( cat $PROG | \ | ||
52 | $PROG enc -e -k "$HASH" -$alg -engine aesni | \ | ||
53 | $PROG enc -d -k "$HASH" -$alg -engine aesni | \ | ||
54 | $PROG dgst -hex ) 2>/dev/null` | ||
55 | if [ "$TEST" != "$HASH" ]; then | ||
56 | echo "-$alg en/decrypt test failed" | ||
57 | nerr=`expr $nerr + 1` | ||
58 | fi | ||
59 | done | ||
60 | |||
61 | if [ $nerr -gt 0 ]; then | ||
62 | echo "AESNI engine test failed." | ||
63 | exit 1; | ||
64 | fi | ||
65 | else | ||
66 | echo "AESNI engine is not available" | ||
67 | fi | ||
68 | |||
69 | exit 0 | ||
diff --git a/src/lib/libssl/test/testca.com b/src/lib/libssl/test/testca.com new file mode 100644 index 0000000000..ec7e56dad6 --- /dev/null +++ b/src/lib/libssl/test/testca.com | |||
@@ -0,0 +1,50 @@ | |||
1 | $! TESTCA.COM | ||
2 | $ | ||
3 | $ __arch := VAX | ||
4 | $ if f$getsyi("cpu") .ge. 128 then - | ||
5 | __arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE") | ||
6 | $ if __arch .eqs. "" then __arch := UNK | ||
7 | $ | ||
8 | $ openssl := mcr 'exe_dir'openssl | ||
9 | $ | ||
10 | $ SSLEAY_CONFIG="-config ""CAss.cnf""" | ||
11 | $ | ||
12 | $ set noon | ||
13 | $ if f$search("demoCA.dir") .nes. "" | ||
14 | $ then | ||
15 | $ @[-.util]deltree [.demoCA]*.* | ||
16 | $ set file/prot=(S:RWED,O:RWED,G:RWED,W:RWED) demoCA.dir;* | ||
17 | $ delete demoCA.dir;* | ||
18 | $ endif | ||
19 | $ set on | ||
20 | $ open/read sys$ca_input VMSca-response.1 | ||
21 | $ @[-.apps]CA.com -input sys$ca_input -newca | ||
22 | $ close sys$ca_input | ||
23 | $ if $severity .ne. 1 then exit 3 | ||
24 | $ | ||
25 | $ | ||
26 | $ SSLEAY_CONFIG="-config ""Uss.cnf""" | ||
27 | $ @[-.apps]CA.com -newreq | ||
28 | $ if $severity .ne. 1 then exit 3 | ||
29 | $ | ||
30 | $ | ||
31 | $ SSLEAY_CONFIG="-config [-.apps]openssl-vms.cnf" | ||
32 | $ open/read sys$ca_input VMSca-response.2 | ||
33 | $ @[-.apps]CA.com -input sys$ca_input -sign | ||
34 | $ close sys$ca_input | ||
35 | $ if $severity .ne. 1 then exit 3 | ||
36 | $ | ||
37 | $ | ||
38 | $ @[-.apps]CA.com -verify newcert.pem | ||
39 | $ if $severity .ne. 1 then exit 3 | ||
40 | $ | ||
41 | $ set noon | ||
42 | $ @[-.util]deltree [.demoCA]*.* | ||
43 | $ set file/prot=(S:RWED,O:RWED,G:RWED,W:RWED) demoCA.dir;* | ||
44 | $ delete demoCA.dir;* | ||
45 | $ if f$search("newcert.pem") .nes. "" then delete newcert.pem;* | ||
46 | $ if f$search("newcert.pem") .nes. "" then delete newreq.pem;* | ||
47 | $ set on | ||
48 | $! #usage: CA -newcert|-newreq|-newca|-sign|-verify | ||
49 | $ | ||
50 | $ exit | ||
diff --git a/src/lib/libssl/test/testenc.com b/src/lib/libssl/test/testenc.com new file mode 100644 index 0000000000..621d9a2126 --- /dev/null +++ b/src/lib/libssl/test/testenc.com | |||
@@ -0,0 +1,63 @@ | |||
1 | $! TESTENC.COM -- Test encoding and decoding | ||
2 | $ | ||
3 | $ __arch := VAX | ||
4 | $ if f$getsyi("cpu") .ge. 128 then - | ||
5 | __arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE") | ||
6 | $ if __arch .eqs. "" then __arch := UNK | ||
7 | $ | ||
8 | $ testsrc := makefile. | ||
9 | $ test := p.txt | ||
10 | $ cmd := mcr 'exe_dir'openssl | ||
11 | $ | ||
12 | $ if f$search(test) .nes. "" then delete 'test';* | ||
13 | $ convert/fdl=sys$input: 'testsrc' 'test' | ||
14 | RECORD | ||
15 | FORMAT STREAM_LF | ||
16 | $ | ||
17 | $ if f$search(test+"-cipher") .nes. "" then delete 'test'-cipher;* | ||
18 | $ if f$search(test+"-clear") .nes. "" then delete 'test'-clear;* | ||
19 | $ | ||
20 | $ write sys$output "cat" | ||
21 | $ 'cmd' enc -in 'test' -out 'test'-cipher | ||
22 | $ 'cmd' enc -in 'test'-cipher -out 'test'-clear | ||
23 | $ backup/compare 'test' 'test'-clear | ||
24 | $ if $severity .ne. 1 then exit 3 | ||
25 | $ delete 'test'-cipher;*,'test'-clear;* | ||
26 | $ | ||
27 | $ write sys$output "base64" | ||
28 | $ 'cmd' enc -a -e -in 'test' -out 'test'-cipher | ||
29 | $ 'cmd' enc -a -d -in 'test'-cipher -out 'test'-clear | ||
30 | $ backup/compare 'test' 'test'-clear | ||
31 | $ if $severity .ne. 1 then exit 3 | ||
32 | $ delete 'test'-cipher;*,'test'-clear;* | ||
33 | $ | ||
34 | $ define/user sys$output 'test'-cipher-commands | ||
35 | $ 'cmd' list-cipher-commands | ||
36 | $ open/read f 'test'-cipher-commands | ||
37 | $ loop_cipher_commands: | ||
38 | $ read/end=loop_cipher_commands_end f i | ||
39 | $ write sys$output i | ||
40 | $ | ||
41 | $ if f$search(test+"-"+i+"-cipher") .nes. "" then - | ||
42 | delete 'test'-'i'-cipher;* | ||
43 | $ if f$search(test+"-"+i+"-clear") .nes. "" then - | ||
44 | delete 'test'-'i'-clear;* | ||
45 | $ | ||
46 | $ 'cmd' 'i' -bufsize 113 -e -k test -in 'test' -out 'test'-'i'-cipher | ||
47 | $ 'cmd' 'i' -bufsize 157 -d -k test -in 'test'-'i'-cipher -out 'test'-'i'-clear | ||
48 | $ backup/compare 'test' 'test'-'i'-clear | ||
49 | $ if $severity .ne. 1 then exit 3 | ||
50 | $ delete 'test'-'i'-cipher;*,'test'-'i'-clear;* | ||
51 | $ | ||
52 | $ write sys$output i," base64" | ||
53 | $ 'cmd' 'i' -bufsize 113 -a -e -k test -in 'test' -out 'test'-'i'-cipher | ||
54 | $ 'cmd' 'i' -bufsize 157 -a -d -k test -in 'test'-'i'-cipher -out 'test'-'i'-clear | ||
55 | $ backup/compare 'test' 'test'-'i'-clear | ||
56 | $ if $severity .ne. 1 then exit 3 | ||
57 | $ delete 'test'-'i'-cipher;*,'test'-'i'-clear;* | ||
58 | $ | ||
59 | $ goto loop_cipher_commands | ||
60 | $ loop_cipher_commands_end: | ||
61 | $ close f | ||
62 | $ delete 'test'-cipher-commands;* | ||
63 | $ delete 'test';* | ||
diff --git a/src/lib/libssl/test/testgen.com b/src/lib/libssl/test/testgen.com new file mode 100644 index 0000000000..a4bc574bec --- /dev/null +++ b/src/lib/libssl/test/testgen.com | |||
@@ -0,0 +1,54 @@ | |||
1 | $! TETSGEN.COM | ||
2 | $ | ||
3 | $ __arch := VAX | ||
4 | $ if f$getsyi("cpu") .ge. 128 then - | ||
5 | __arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE") | ||
6 | $ if __arch .eqs. "" then __arch := UNK | ||
7 | $ exe_dir := sys$disk:[-.'__arch'.exe.apps] | ||
8 | $ | ||
9 | $ T := testcert | ||
10 | $ KEY = 512 | ||
11 | $ CA := [-.certs]testca.pem | ||
12 | $ | ||
13 | $ set noon | ||
14 | $ if f$search(T+".1;*") .nes. "" then delete 'T'.1;* | ||
15 | $ if f$search(T+".2;*") .nes. "" then delete 'T'.2;* | ||
16 | $ if f$search(T+".key;*") .nes. "" then delete 'T'.key;* | ||
17 | $ set on | ||
18 | $ | ||
19 | $ write sys$output "generating certificate request" | ||
20 | $ | ||
21 | $ append/new nl: .rnd | ||
22 | $ open/append random_file .rnd | ||
23 | $ write random_file "string to make the random number generator think it has entropy" | ||
24 | $ close random_file | ||
25 | $ | ||
26 | $ set noon | ||
27 | $ define/user sys$output nla0: | ||
28 | $ mcr 'exe_dir'openssl no-rsa | ||
29 | $ save_severity=$SEVERITY | ||
30 | $ set on | ||
31 | $ if save_severity | ||
32 | $ then | ||
33 | $ req_new="-newkey dsa:[-.apps]dsa512.pem" | ||
34 | $ else | ||
35 | $ req_new="-new" | ||
36 | $ write sys$output "There should be a 2 sequences of .'s and some +'s." | ||
37 | $ write sys$output "There should not be more that at most 80 per line" | ||
38 | $ endif | ||
39 | $ | ||
40 | $ write sys$output "This could take some time." | ||
41 | $ | ||
42 | $ mcr 'exe_dir'openssl req -config test.cnf 'req_new' -out testreq.pem | ||
43 | $ if $severity .ne. 1 | ||
44 | $ then | ||
45 | $ write sys$output "problems creating request" | ||
46 | $ exit 3 | ||
47 | $ endif | ||
48 | $ | ||
49 | $ mcr 'exe_dir'openssl req -config test.cnf -verify -in testreq.pem -noout | ||
50 | $ if $severity .ne. 1 | ||
51 | $ then | ||
52 | $ write sys$output "signature on req is wrong" | ||
53 | $ exit 3 | ||
54 | $ endif | ||
diff --git a/src/lib/libssl/test/tests.com b/src/lib/libssl/test/tests.com new file mode 100644 index 0000000000..d151cd3955 --- /dev/null +++ b/src/lib/libssl/test/tests.com | |||
@@ -0,0 +1,299 @@ | |||
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 - | ||
10 | __arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE") | ||
11 | $ if __arch .eqs. "" then __arch := UNK | ||
12 | $ texe_dir := sys$disk:[-.'__arch'.exe.test] | ||
13 | $ exe_dir := sys$disk:[-.'__arch'.exe.apps] | ||
14 | $ | ||
15 | $ sslroot = f$parse("sys$disk:[-.apps];",,,,"syntax_only") - "].;"+ ".]" | ||
16 | $ define /translation_attributes = concealed sslroot 'sslroot' | ||
17 | $ | ||
18 | $ set default '__here' | ||
19 | $ | ||
20 | $ on control_y then goto exit | ||
21 | $ on error then goto exit | ||
22 | $ | ||
23 | $ if p1 .nes. "" | ||
24 | $ then | ||
25 | $ tests = p1 | ||
26 | $ else | ||
27 | $! NOTE: This list reflects the list of dependencies following the | ||
28 | $! "alltests" target in Makefile. This should make it easy to see | ||
29 | $! if there's a difference that needs to be taken care of. | ||
30 | $ tests := - | ||
31 | test_des,test_idea,test_sha,test_md4,test_md5,test_hmac,- | ||
32 | test_md2,test_mdc2,test_wp,- | ||
33 | test_rmd,test_rc2,test_rc4,test_rc5,test_bf,test_cast,test_aes,- | ||
34 | test_rand,test_bn,test_ec,test_ecdsa,test_ecdh,- | ||
35 | test_enc,test_x509,test_rsa,test_crl,test_sid,- | ||
36 | test_gen,test_req,test_pkcs7,test_verify,test_dh,test_dsa,- | ||
37 | test_ss,test_ca,test_engine,test_evp,test_ssl,test_tsa,test_ige,- | ||
38 | test_jpake,test_cms | ||
39 | $ endif | ||
40 | $ tests = f$edit(tests,"COLLAPSE") | ||
41 | $ | ||
42 | $ BNTEST := bntest | ||
43 | $ ECTEST := ectest | ||
44 | $ ECDSATEST := ecdsatest | ||
45 | $ ECDHTEST := ecdhtest | ||
46 | $ EXPTEST := exptest | ||
47 | $ IDEATEST := ideatest | ||
48 | $ SHATEST := shatest | ||
49 | $ SHA1TEST := sha1test | ||
50 | $ MDC2TEST := mdc2test | ||
51 | $ RMDTEST := rmdtest | ||
52 | $ MD2TEST := md2test | ||
53 | $ MD4TEST := md4test | ||
54 | $ MD5TEST := md5test | ||
55 | $ HMACTEST := hmactest | ||
56 | $ WPTEST := wp_test | ||
57 | $ RC2TEST := rc2test | ||
58 | $ RC4TEST := rc4test | ||
59 | $ RC5TEST := rc5test | ||
60 | $ BFTEST := bftest | ||
61 | $ CASTTEST := casttest | ||
62 | $ DESTEST := destest | ||
63 | $ RANDTEST := randtest | ||
64 | $ DHTEST := dhtest | ||
65 | $ DSATEST := dsatest | ||
66 | $ METHTEST := methtest | ||
67 | $ SSLTEST := ssltest | ||
68 | $ RSATEST := rsa_test | ||
69 | $ ENGINETEST := enginetest | ||
70 | $ EVPTEST := evp_test | ||
71 | $ IGETEST := igetest | ||
72 | $ JPAKETEST := jpaketest | ||
73 | $ | ||
74 | $ tests_i = 0 | ||
75 | $ loop_tests: | ||
76 | $ tests_e = f$element(tests_i,",",tests) | ||
77 | $ tests_i = tests_i + 1 | ||
78 | $ if tests_e .eqs. "," then goto exit | ||
79 | $ gosub 'tests_e' | ||
80 | $ goto loop_tests | ||
81 | $ | ||
82 | $ test_evp: | ||
83 | $ mcr 'texe_dir''evptest' evptests.txt | ||
84 | $ return | ||
85 | $ test_des: | ||
86 | $ mcr 'texe_dir''destest' | ||
87 | $ return | ||
88 | $ test_idea: | ||
89 | $ mcr 'texe_dir''ideatest' | ||
90 | $ return | ||
91 | $ test_sha: | ||
92 | $ mcr 'texe_dir''shatest' | ||
93 | $ mcr 'texe_dir''sha1test' | ||
94 | $ return | ||
95 | $ test_mdc2: | ||
96 | $ mcr 'texe_dir''mdc2test' | ||
97 | $ return | ||
98 | $ test_md5: | ||
99 | $ mcr 'texe_dir''md5test' | ||
100 | $ return | ||
101 | $ test_md4: | ||
102 | $ mcr 'texe_dir''md4test' | ||
103 | $ return | ||
104 | $ test_hmac: | ||
105 | $ mcr 'texe_dir''hmactest' | ||
106 | $ return | ||
107 | $ test_wp: | ||
108 | $ mcr 'texe_dir''wptest' | ||
109 | $ return | ||
110 | $ test_md2: | ||
111 | $ mcr 'texe_dir''md2test' | ||
112 | $ return | ||
113 | $ test_rmd: | ||
114 | $ mcr 'texe_dir''rmdtest' | ||
115 | $ return | ||
116 | $ test_bf: | ||
117 | $ mcr 'texe_dir''bftest' | ||
118 | $ return | ||
119 | $ test_cast: | ||
120 | $ mcr 'texe_dir''casttest' | ||
121 | $ return | ||
122 | $ test_rc2: | ||
123 | $ mcr 'texe_dir''rc2test' | ||
124 | $ return | ||
125 | $ test_rc4: | ||
126 | $ mcr 'texe_dir''rc4test' | ||
127 | $ return | ||
128 | $ test_rc5: | ||
129 | $ mcr 'texe_dir''rc5test' | ||
130 | $ return | ||
131 | $ test_rand: | ||
132 | $ mcr 'texe_dir''randtest' | ||
133 | $ return | ||
134 | $ test_enc: | ||
135 | $ @testenc.com | ||
136 | $ return | ||
137 | $ test_x509: | ||
138 | $ define sys$error nla0: | ||
139 | $ write sys$output "test normal x509v1 certificate" | ||
140 | $ @tx509.com | ||
141 | $ write sys$output "test first x509v3 certificate" | ||
142 | $ @tx509.com v3-cert1.pem | ||
143 | $ write sys$output "test second x509v3 certificate" | ||
144 | $ @tx509.com v3-cert2.pem | ||
145 | $ deassign sys$error | ||
146 | $ return | ||
147 | $ test_rsa: | ||
148 | $ define sys$error nla0: | ||
149 | $ @trsa.com | ||
150 | $ deassign sys$error | ||
151 | $ mcr 'texe_dir''rsatest' | ||
152 | $ return | ||
153 | $ test_crl: | ||
154 | $ define sys$error nla0: | ||
155 | $ @tcrl.com | ||
156 | $ deassign sys$error | ||
157 | $ return | ||
158 | $ test_sid: | ||
159 | $ define sys$error nla0: | ||
160 | $ @tsid.com | ||
161 | $ deassign sys$error | ||
162 | $ return | ||
163 | $ test_req: | ||
164 | $ define sys$error nla0: | ||
165 | $ @treq.com | ||
166 | $ @treq.com testreq2.pem | ||
167 | $ deassign sys$error | ||
168 | $ return | ||
169 | $ test_pkcs7: | ||
170 | $ define sys$error nla0: | ||
171 | $ @tpkcs7.com | ||
172 | $ @tpkcs7d.com | ||
173 | $ deassign sys$error | ||
174 | $ return | ||
175 | $ test_bn: | ||
176 | $ write sys$output "starting big number library test, could take a while..." | ||
177 | $ create bntest-vms.fdl | ||
178 | FILE | ||
179 | ORGANIZATION sequential | ||
180 | RECORD | ||
181 | FORMAT stream_lf | ||
182 | $ create/fdl=bntest-vms.fdl bntest-vms.sh | ||
183 | $ open/append foo bntest-vms.sh | ||
184 | $ type/output=foo: sys$input: | ||
185 | << __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"' | ||
186 | $ define/user sys$output bntest-vms.tmp | ||
187 | $ mcr 'texe_dir''bntest' | ||
188 | $ copy bntest-vms.tmp foo: | ||
189 | $ delete bntest-vms.tmp;* | ||
190 | $ type/output=foo: sys$input: | ||
191 | __FOO__ | ||
192 | $ close foo | ||
193 | $ write sys$output "-- copy the [.test]bntest-vms.sh and [.test]bctest files to a Unix system and" | ||
194 | $ write sys$output "-- run bntest-vms.sh through sh or bash to verify that the bignum operations" | ||
195 | $ write sys$output "-- went well." | ||
196 | $ write sys$output "" | ||
197 | $ write sys$output "test a^b%c implementations" | ||
198 | $ mcr 'texe_dir''exptest' | ||
199 | $ return | ||
200 | $ test_ec: | ||
201 | $ write sys$output "test elliptic curves" | ||
202 | $ mcr 'texe_dir''ectest' | ||
203 | $ return | ||
204 | $ test_ecdsa: | ||
205 | $ write sys$output "test ecdsa" | ||
206 | $ mcr 'texe_dir''ecdsatest' | ||
207 | $ return | ||
208 | $ test_ecdh: | ||
209 | $ write sys$output "test ecdh" | ||
210 | $ mcr 'texe_dir''ecdhtest' | ||
211 | $ return | ||
212 | $ test_verify: | ||
213 | $ write sys$output "The following command should have some OK's and some failures" | ||
214 | $ write sys$output "There are definitly a few expired certificates" | ||
215 | $ @tverify.com | ||
216 | $ return | ||
217 | $ test_dh: | ||
218 | $ write sys$output "Generate a set of DH parameters" | ||
219 | $ mcr 'texe_dir''dhtest' | ||
220 | $ return | ||
221 | $ test_dsa: | ||
222 | $ write sys$output "Generate a set of DSA parameters" | ||
223 | $ mcr 'texe_dir''dsatest' | ||
224 | $ return | ||
225 | $ test_gen: | ||
226 | $ write sys$output "Generate and verify a certificate request" | ||
227 | $ @testgen.com | ||
228 | $ return | ||
229 | $ maybe_test_ss: | ||
230 | $ testss_RDT = f$cvtime(f$file_attributes("testss.com","RDT")) | ||
231 | $ if f$cvtime(f$file_attributes("keyU.ss","RDT")) .les. testss_RDT then - | ||
232 | goto test_ss | ||
233 | $ if f$cvtime(f$file_attributes("certU.ss","RDT")) .les. testss_RDT then - | ||
234 | goto test_ss | ||
235 | $ if f$cvtime(f$file_attributes("certCA.ss","RDT")) .les. testss_RDT then - | ||
236 | goto test_ss | ||
237 | $ return | ||
238 | $ test_ss: | ||
239 | $ write sys$output "Generate and certify a test certificate" | ||
240 | $ @testss.com | ||
241 | $ return | ||
242 | $ test_engine: | ||
243 | $ write sys$output "Manipulate the ENGINE structures" | ||
244 | $ mcr 'texe_dir''enginetest' | ||
245 | $ return | ||
246 | $ test_ssl: | ||
247 | $ write sys$output "test SSL protocol" | ||
248 | $ gosub maybe_test_ss | ||
249 | $ @testssl.com keyU.ss certU.ss certCA.ss | ||
250 | $ return | ||
251 | $ test_ca: | ||
252 | $ set noon | ||
253 | $ define/user sys$output nla0: | ||
254 | $ mcr 'exe_dir'openssl no-rsa | ||
255 | $ save_severity=$SEVERITY | ||
256 | $ set on | ||
257 | $ if save_severity | ||
258 | $ then | ||
259 | $ write sys$output "skipping CA.com test -- requires RSA" | ||
260 | $ else | ||
261 | $ write sys$output "Generate and certify a test certificate via the 'ca' program" | ||
262 | $ @testca.com | ||
263 | $ endif | ||
264 | $ return | ||
265 | $ test_aes: | ||
266 | $! write sys$output "test AES" | ||
267 | $! !mcr 'texe_dir''aestest' | ||
268 | $ return | ||
269 | $ test_tsa: | ||
270 | $ set noon | ||
271 | $ define/user sys$output nla0: | ||
272 | $ mcr 'exe_dir'openssl no-rsa | ||
273 | $ save_severity=$SEVERITY | ||
274 | $ set on | ||
275 | $ if save_severity | ||
276 | $ then | ||
277 | $ write sys$output "skipping testtsa.com test -- requires RSA" | ||
278 | $ else | ||
279 | $ @testtsa.com | ||
280 | $ endif | ||
281 | $ return | ||
282 | $ test_ige: | ||
283 | $ write sys$output "Test IGE mode" | ||
284 | $ mcr 'texe_dir''igetest' | ||
285 | $ return | ||
286 | $ test_jpake: | ||
287 | $ write sys$output "Test JPAKE" | ||
288 | $ mcr 'texe_dir''jpaketest' | ||
289 | $ return | ||
290 | $ test_cms: | ||
291 | $ write sys$output "CMS consistency test" | ||
292 | $ perl CMS-TEST.PL | ||
293 | $ return | ||
294 | $ | ||
295 | $ | ||
296 | $ exit: | ||
297 | $ set default '__save_default' | ||
298 | $ deassign sslroot | ||
299 | $ exit | ||
diff --git a/src/lib/libssl/test/testss.com b/src/lib/libssl/test/testss.com new file mode 100644 index 0000000000..6598106b09 --- /dev/null +++ b/src/lib/libssl/test/testss.com | |||
@@ -0,0 +1,120 @@ | |||
1 | $! TESTSS.COM | ||
2 | $ | ||
3 | $ __arch := VAX | ||
4 | $ if f$getsyi("cpu") .ge. 128 then - | ||
5 | __arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE") | ||
6 | $ if __arch .eqs. "" then __arch := UNK | ||
7 | $ exe_dir := sys$disk:[-.'__arch'.exe.apps] | ||
8 | $ | ||
9 | $ digest="-md5" | ||
10 | $ reqcmd := mcr 'exe_dir'openssl req | ||
11 | $ x509cmd := mcr 'exe_dir'openssl x509 'digest' | ||
12 | $ verifycmd := mcr 'exe_dir'openssl verify | ||
13 | $ dummycnf := sys$disk:[-.apps]openssl-vms.cnf | ||
14 | $ | ||
15 | $ CAkey="""keyCA.ss""" | ||
16 | $ CAcert="""certCA.ss""" | ||
17 | $ CAreq="""reqCA.ss""" | ||
18 | $ CAconf="""CAss.cnf""" | ||
19 | $ CAreq2="""req2CA.ss""" ! temp | ||
20 | $ | ||
21 | $ Uconf="""Uss.cnf""" | ||
22 | $ Ukey="""keyU.ss""" | ||
23 | $ Ureq="""reqU.ss""" | ||
24 | $ Ucert="""certU.ss""" | ||
25 | $ | ||
26 | $ write sys$output "" | ||
27 | $ write sys$output "make a certificate request using 'req'" | ||
28 | $ | ||
29 | $ set noon | ||
30 | $ define/user sys$output nla0: | ||
31 | $ mcr 'exe_dir'openssl no-rsa | ||
32 | $ save_severity=$SEVERITY | ||
33 | $ set on | ||
34 | $ if save_severity | ||
35 | $ then | ||
36 | $ req_new="-newkey dsa:[-.apps]dsa512.pem" | ||
37 | $ else | ||
38 | $ req_new="-new" | ||
39 | $ endif | ||
40 | $ | ||
41 | $ 'reqcmd' -config 'CAconf' -out 'CAreq' -keyout 'CAkey' 'req_new' ! -out err.ss | ||
42 | $ if $severity .ne. 1 | ||
43 | $ then | ||
44 | $ write sys$output "error using 'req' to generate a certificate request" | ||
45 | $ exit 3 | ||
46 | $ endif | ||
47 | $ write sys$output "" | ||
48 | $ write sys$output "convert the certificate request into a self signed certificate using 'x509'" | ||
49 | $ define /user sys$output err.ss | ||
50 | $ 'x509cmd' "-CAcreateserial" -in 'CAreq' -days 30 -req -out 'CAcert' -signkey 'CAkey' | ||
51 | $ if $severity .ne. 1 | ||
52 | $ then | ||
53 | $ write sys$output "error using 'x509' to self sign a certificate request" | ||
54 | $ exit 3 | ||
55 | $ endif | ||
56 | $ | ||
57 | $ write sys$output "" | ||
58 | $ write sys$output "convert a certificate into a certificate request using 'x509'" | ||
59 | $ define /user sys$output err.ss | ||
60 | $ 'x509cmd' -in 'CAcert' -x509toreq -signkey 'CAkey' -out 'CAreq2' | ||
61 | $ if $severity .ne. 1 | ||
62 | $ then | ||
63 | $ write sys$output "error using 'x509' convert a certificate to a certificate request" | ||
64 | $ exit 3 | ||
65 | $ endif | ||
66 | $ | ||
67 | $ 'reqcmd' -config 'dummycnf' -verify -in 'CAreq' -noout | ||
68 | $ if $severity .ne. 1 | ||
69 | $ then | ||
70 | $ write sys$output "first generated request is invalid" | ||
71 | $ exit 3 | ||
72 | $ endif | ||
73 | $ | ||
74 | $ 'reqcmd' -config 'dummycnf' -verify -in 'CAreq2' -noout | ||
75 | $ if $severity .ne. 1 | ||
76 | $ then | ||
77 | $ write sys$output "second generated request is invalid" | ||
78 | $ exit 3 | ||
79 | $ endif | ||
80 | $ | ||
81 | $ 'verifycmd' "-CAfile" 'CAcert' 'CAcert' | ||
82 | $ if $severity .ne. 1 | ||
83 | $ then | ||
84 | $ write sys$output "first generated cert is invalid" | ||
85 | $ exit 3 | ||
86 | $ endif | ||
87 | $ | ||
88 | $ write sys$output "" | ||
89 | $ write sys$output "make another certificate request using 'req'" | ||
90 | $ define /user sys$output err.ss | ||
91 | $ 'reqcmd' -config 'Uconf' -out 'Ureq' -keyout 'Ukey' 'req_new' | ||
92 | $ if $severity .ne. 1 | ||
93 | $ then | ||
94 | $ write sys$output "error using 'req' to generate a certificate request" | ||
95 | $ exit 3 | ||
96 | $ endif | ||
97 | $ | ||
98 | $ write sys$output "" | ||
99 | $ write sys$output "sign certificate request with the just created CA via 'x509'" | ||
100 | $ define /user sys$output err.ss | ||
101 | $ 'x509cmd' "-CAcreateserial" -in 'Ureq' -days 30 -req -out 'Ucert' "-CA" 'CAcert' "-CAkey" 'CAkey' | ||
102 | $ if $severity .ne. 1 | ||
103 | $ then | ||
104 | $ write sys$output "error using 'x509' to sign a certificate request" | ||
105 | $ exit 3 | ||
106 | $ endif | ||
107 | $ | ||
108 | $ 'verifycmd' "-CAfile" 'CAcert' 'Ucert' | ||
109 | $ write sys$output "" | ||
110 | $ write sys$output "Certificate details" | ||
111 | $ 'x509cmd' -subject -issuer -startdate -enddate -noout -in 'Ucert' | ||
112 | $ | ||
113 | $ write sys$output "" | ||
114 | $ write sys$output "The generated CA certificate is ",CAcert | ||
115 | $ write sys$output "The generated CA private key is ",CAkey | ||
116 | $ | ||
117 | $ write sys$output "The generated user certificate is ",Ucert | ||
118 | $ write sys$output "The generated user private key is ",Ukey | ||
119 | $ | ||
120 | $ if f$search("err.ss;*") .nes. "" then delete err.ss;* | ||
diff --git a/src/lib/libssl/test/testssl.com b/src/lib/libssl/test/testssl.com new file mode 100644 index 0000000000..9c83afba04 --- /dev/null +++ b/src/lib/libssl/test/testssl.com | |||
@@ -0,0 +1,206 @@ | |||
1 | $! TESTSSL.COM | ||
2 | $ | ||
3 | $ __arch := VAX | ||
4 | $ if f$getsyi("cpu") .ge. 128 then - | ||
5 | __arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE") | ||
6 | $ if __arch .eqs. "" then __arch := UNK | ||
7 | $ texe_dir := sys$disk:[-.'__arch'.exe.test] | ||
8 | $ exe_dir := sys$disk:[-.'__arch'.exe.apps] | ||
9 | $ | ||
10 | $ if p1 .eqs. "" | ||
11 | $ then | ||
12 | $ key="[-.apps]server.pem" | ||
13 | $ else | ||
14 | $ key=p1 | ||
15 | $ endif | ||
16 | $ if p2 .eqs. "" | ||
17 | $ then | ||
18 | $ cert="[-.apps]server.pem" | ||
19 | $ else | ||
20 | $ cert=p2 | ||
21 | $ endif | ||
22 | $ ssltest := mcr 'texe_dir'ssltest -key 'key' -cert 'cert' -c_key 'key' -c_cert 'cert' | ||
23 | $ | ||
24 | $ define/user sys$output testssl-x509-output. | ||
25 | $ define/user sys$error nla0: | ||
26 | $ mcr 'exe_dir'openssl x509 -in 'cert' -text -noout | ||
27 | $ set noon | ||
28 | $ define/user sys$error nla0: | ||
29 | $ search/output=nla0: testssl-x509-output. "DSA Public Key"/exact | ||
30 | $ if $severity .eq. 1 | ||
31 | $ then | ||
32 | $ dsa_cert := YES | ||
33 | $ else | ||
34 | $ dsa_cert := NO | ||
35 | $ endif | ||
36 | $ set on | ||
37 | $ delete testssl-x509-output.;* | ||
38 | $ | ||
39 | $ if p3 .eqs. "" | ||
40 | $ then | ||
41 | $ copy/concatenate [-.certs]*.pem certs.tmp | ||
42 | $ CA = """-CAfile"" certs.tmp" | ||
43 | $ else | ||
44 | $ CA = """-CAfile"" "+p3 | ||
45 | $ endif | ||
46 | $ | ||
47 | $!########################################################################### | ||
48 | $ | ||
49 | $ write sys$output "test sslv2" | ||
50 | $ 'ssltest' -ssl2 | ||
51 | $ if $severity .ne. 1 then goto exit3 | ||
52 | $ | ||
53 | $ write sys$output "test sslv2 with server authentication" | ||
54 | $ 'ssltest' -ssl2 -server_auth 'CA' | ||
55 | $ if $severity .ne. 1 then goto exit3 | ||
56 | $ | ||
57 | $ if .not. dsa_cert | ||
58 | $ then | ||
59 | $ write sys$output "test sslv2 with client authentication" | ||
60 | $ 'ssltest' -ssl2 -client_auth 'CA' | ||
61 | $ if $severity .ne. 1 then goto exit3 | ||
62 | $ | ||
63 | $ write sys$output "test sslv2 with both client and server authentication" | ||
64 | $ 'ssltest' -ssl2 -server_auth -client_auth 'CA' | ||
65 | $ if $severity .ne. 1 then goto exit3 | ||
66 | $ endif | ||
67 | $ | ||
68 | $ write sys$output "test sslv3" | ||
69 | $ 'ssltest' -ssl3 | ||
70 | $ if $severity .ne. 1 then goto exit3 | ||
71 | $ | ||
72 | $ write sys$output "test sslv3 with server authentication" | ||
73 | $ 'ssltest' -ssl3 -server_auth 'CA' | ||
74 | $ if $severity .ne. 1 then goto exit3 | ||
75 | $ | ||
76 | $ write sys$output "test sslv3 with client authentication" | ||
77 | $ 'ssltest' -ssl3 -client_auth 'CA' | ||
78 | $ if $severity .ne. 1 then goto exit3 | ||
79 | $ | ||
80 | $ write sys$output "test sslv3 with both client and server authentication" | ||
81 | $ 'ssltest' -ssl3 -server_auth -client_auth 'CA' | ||
82 | $ if $severity .ne. 1 then goto exit3 | ||
83 | $ | ||
84 | $ write sys$output "test sslv2/sslv3" | ||
85 | $ 'ssltest' | ||
86 | $ if $severity .ne. 1 then goto exit3 | ||
87 | $ | ||
88 | $ write sys$output "test sslv2/sslv3 with server authentication" | ||
89 | $ 'ssltest' -server_auth 'CA' | ||
90 | $ if $severity .ne. 1 then goto exit3 | ||
91 | $ | ||
92 | $ write sys$output "test sslv2/sslv3 with client authentication" | ||
93 | $ 'ssltest' -client_auth 'CA' | ||
94 | $ if $severity .ne. 1 then goto exit3 | ||
95 | $ | ||
96 | $ write sys$output "test sslv2/sslv3 with both client and server authentication" | ||
97 | $ 'ssltest' -server_auth -client_auth 'CA' | ||
98 | $ if $severity .ne. 1 then goto exit3 | ||
99 | $ | ||
100 | $ write sys$output "test sslv2 via BIO pair" | ||
101 | $ 'ssltest' -bio_pair -ssl2 | ||
102 | $ if $severity .ne. 1 then goto exit3 | ||
103 | $ | ||
104 | $ write sys$output "test sslv2 with server authentication via BIO pair" | ||
105 | $ 'ssltest' -bio_pair -ssl2 -server_auth 'CA' | ||
106 | $ if $severity .ne. 1 then goto exit3 | ||
107 | $ | ||
108 | $ if .not. dsa_cert | ||
109 | $ then | ||
110 | $ write sys$output "test sslv2 with client authentication via BIO pair" | ||
111 | $ 'ssltest' -bio_pair -ssl2 -client_auth 'CA' | ||
112 | $ if $severity .ne. 1 then goto exit3 | ||
113 | $ | ||
114 | $ write sys$output "test sslv2 with both client and server authentication via BIO pair" | ||
115 | $ 'ssltest' -bio_pair -ssl2 -server_auth -client_auth 'CA' | ||
116 | $ if $severity .ne. 1 then goto exit3 | ||
117 | $ endif | ||
118 | $ | ||
119 | $ write sys$output "test sslv3 via BIO pair" | ||
120 | $ 'ssltest' -bio_pair -ssl3 | ||
121 | $ if $severity .ne. 1 then goto exit3 | ||
122 | $ | ||
123 | $ write sys$output "test sslv3 with server authentication via BIO pair" | ||
124 | $ 'ssltest' -bio_pair -ssl3 -server_auth 'CA' | ||
125 | $ if $severity .ne. 1 then goto exit3 | ||
126 | $ | ||
127 | $ write sys$output "test sslv3 with client authentication via BIO pair" | ||
128 | $ 'ssltest' -bio_pair -ssl3 -client_auth 'CA' | ||
129 | $ if $severity .ne. 1 then goto exit3 | ||
130 | |||
131 | $ write sys$output "test sslv3 with both client and server authentication via BIO pair" | ||
132 | $ 'ssltest' -bio_pair -ssl3 -server_auth -client_auth 'CA' | ||
133 | $ if $severity .ne. 1 then goto exit3 | ||
134 | $ | ||
135 | $ write sys$output "test sslv2/sslv3 via BIO pair" | ||
136 | $ 'ssltest' | ||
137 | $ if $severity .ne. 1 then goto exit3 | ||
138 | $ | ||
139 | $ if .not. dsa_cert | ||
140 | $ then | ||
141 | $ write sys$output "test sslv2/sslv3 w/o DHE via BIO pair" | ||
142 | $ 'ssltest' -bio_pair -no_dhe | ||
143 | $ if $severity .ne. 1 then goto exit3 | ||
144 | $ endif | ||
145 | $ | ||
146 | $ write sys$output "test sslv2/sslv3 with 1024 bit DHE via BIO pair" | ||
147 | $ 'ssltest' -bio_pair -dhe1024dsa -v | ||
148 | $ if $severity .ne. 1 then goto exit3 | ||
149 | $ | ||
150 | $ write sys$output "test sslv2/sslv3 with server authentication" | ||
151 | $ 'ssltest' -bio_pair -server_auth 'CA' | ||
152 | $ if $severity .ne. 1 then goto exit3 | ||
153 | $ | ||
154 | $ write sys$output "test sslv2/sslv3 with client authentication via BIO pair" | ||
155 | $ 'ssltest' -bio_pair -client_auth 'CA' | ||
156 | $ if $severity .ne. 1 then goto exit3 | ||
157 | $ | ||
158 | $ write sys$output "test sslv2/sslv3 with both client and server authentication via BIO pair" | ||
159 | $ 'ssltest' -bio_pair -server_auth -client_auth 'CA' | ||
160 | $ if $severity .ne. 1 then goto exit3 | ||
161 | $ | ||
162 | $!########################################################################### | ||
163 | $ | ||
164 | $ set noon | ||
165 | $ define/user sys$output nla0: | ||
166 | $ mcr 'exe_dir'openssl no-rsa | ||
167 | $ no_rsa=$SEVERITY | ||
168 | $ define/user sys$output nla0: | ||
169 | $ mcr 'exe_dir'openssl no-dh | ||
170 | $ no_dh=$SEVERITY | ||
171 | $ set on | ||
172 | $ | ||
173 | $ if no_dh | ||
174 | $ then | ||
175 | $ write sys$output "skipping anonymous DH tests" | ||
176 | $ else | ||
177 | $ write sys$output "test tls1 with 1024bit anonymous DH, multiple handshakes" | ||
178 | $ 'ssltest' -v -bio_pair -tls1 -cipher "ADH" -dhe1024dsa -num 10 -f -time | ||
179 | $ if $severity .ne. 1 then goto exit3 | ||
180 | $ endif | ||
181 | $ | ||
182 | $ if no_rsa | ||
183 | $ then | ||
184 | $ write sys$output "skipping RSA tests" | ||
185 | $ else | ||
186 | $ write sys$output "test tls1 with 1024bit RSA, no DHE, multiple handshakes" | ||
187 | $ mcr 'texe_dir'ssltest -v -bio_pair -tls1 -cert [-.apps]server2.pem -no_dhe -num 10 -f -time | ||
188 | $ if $severity .ne. 1 then goto exit3 | ||
189 | $ | ||
190 | $ if no_dh | ||
191 | $ then | ||
192 | $ write sys$output "skipping RSA+DHE tests" | ||
193 | $ else | ||
194 | $ write sys$output "test tls1 with 1024bit RSA, 1024bit DHE, multiple handshakes" | ||
195 | $ mcr 'texe_dir'ssltest -v -bio_pair -tls1 -cert [-.apps]server2.pem -dhe1024dsa -num 10 -f -time | ||
196 | $ if $severity .ne. 1 then goto exit3 | ||
197 | $ endif | ||
198 | $ endif | ||
199 | $ | ||
200 | $ RET = 1 | ||
201 | $ goto exit | ||
202 | $ exit3: | ||
203 | $ RET = 3 | ||
204 | $ exit: | ||
205 | $ if p3 .eqs. "" then delete certs.tmp;* | ||
206 | $ exit 'RET' | ||
diff --git a/src/lib/libssl/test/testtsa.com b/src/lib/libssl/test/testtsa.com new file mode 100644 index 0000000000..e3c586f14a --- /dev/null +++ b/src/lib/libssl/test/testtsa.com | |||
@@ -0,0 +1,248 @@ | |||
1 | $! | ||
2 | $! A few very basic tests for the 'ts' time stamping authority command. | ||
3 | $! | ||
4 | $ | ||
5 | $ __arch := VAX | ||
6 | $ if f$getsyi("cpu") .ge. 128 then - | ||
7 | __arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE") | ||
8 | $ if __arch .eqs. "" then __arch := UNK | ||
9 | $ exe_dir := sys$disk:[-.'__arch'.exe.apps] | ||
10 | $ | ||
11 | $ openssl := mcr 'f$parse(exe_dir+"openssl.exe")' | ||
12 | $ OPENSSL_CONF := [-]CAtsa.cnf | ||
13 | $ ! Because that's what ../apps/CA.sh really looks at | ||
14 | $ SSLEAY_CONFIG = "-config " + OPENSSL_CONF | ||
15 | $ | ||
16 | $ error: | ||
17 | $ subroutine | ||
18 | $ write sys$error "TSA test failed!" | ||
19 | $ exit 3 | ||
20 | $ endsubroutine | ||
21 | $ | ||
22 | $ setup_dir: | ||
23 | $ subroutine | ||
24 | $ | ||
25 | $ if f$search("tsa.dir") .nes "" | ||
26 | $ then | ||
27 | $ @[-.util]deltree [.tsa]*.* | ||
28 | $ set file/prot=(S:RWED,O:RWED,G:RWED,W:RWED) tsa.dir;* | ||
29 | $ delete tsa.dir;* | ||
30 | $ endif | ||
31 | $ | ||
32 | $ create/dir [.tsa] | ||
33 | $ set default [.tsa] | ||
34 | $ endsubroutine | ||
35 | $ | ||
36 | $ clean_up_dir: | ||
37 | $ subroutine | ||
38 | $ | ||
39 | $ set default [-] | ||
40 | $ @[-.util]deltree [.tsa]*.* | ||
41 | $ set file/prot=(S:RWED,O:RWED,G:RWED,W:RWED) tsa.dir;* | ||
42 | $ delete tsa.dir;* | ||
43 | $ endsubroutine | ||
44 | $ | ||
45 | $ create_ca: | ||
46 | $ subroutine | ||
47 | $ | ||
48 | $ write sys$output "Creating a new CA for the TSA tests..." | ||
49 | $ TSDNSECT = "ts_ca_dn" | ||
50 | $ openssl req -new -x509 -nodes - | ||
51 | -out tsaca.pem -keyout tsacakey.pem | ||
52 | $ if $severity .ne. 1 then call error | ||
53 | $ endsubroutine | ||
54 | $ | ||
55 | $ create_tsa_cert: | ||
56 | $ subroutine | ||
57 | $ | ||
58 | $ INDEX=p1 | ||
59 | $ EXT=p2 | ||
60 | $ TSDNSECT = "ts_cert_dn" | ||
61 | $ | ||
62 | $ openssl req -new - | ||
63 | -out tsa_req'INDEX'.pem -keyout tsa_key'INDEX'.pem | ||
64 | $ if $severity .ne. 1 then call error | ||
65 | $ | ||
66 | $ write sys$output "Using extension ''EXT'" | ||
67 | $ openssl x509 -req - | ||
68 | -in tsa_req'INDEX'.pem -out tsa_cert'INDEX'.pem - | ||
69 | "-CA" tsaca.pem "-CAkey" tsacakey.pem "-CAcreateserial" - | ||
70 | -extfile 'OPENSSL_CONF' -extensions "''EXT'" | ||
71 | $ if $severity .ne. 1 then call error | ||
72 | $ endsubroutine | ||
73 | $ | ||
74 | $ print_request: | ||
75 | $ subroutine | ||
76 | $ | ||
77 | $ openssl ts -query -in 'p1' -text | ||
78 | $ endsubroutine | ||
79 | $ | ||
80 | $ create_time_stamp_request1: subroutine | ||
81 | $ | ||
82 | $ openssl ts -query -data [-]testtsa.com -policy tsa_policy1 - | ||
83 | -cert -out req1.tsq | ||
84 | $ if $severity .ne. 1 then call error | ||
85 | $ endsubroutine | ||
86 | $ | ||
87 | $ create_time_stamp_request2: subroutine | ||
88 | $ | ||
89 | $ openssl ts -query -data [-]testtsa.com -policy tsa_policy2 - | ||
90 | -no_nonce -out req2.tsq | ||
91 | $ if $severity .ne. 1 then call error | ||
92 | $ endsubroutine | ||
93 | $ | ||
94 | $ create_time_stamp_request3: subroutine | ||
95 | $ | ||
96 | $ openssl ts -query -data [-]CAtsa.cnf -no_nonce -out req3.tsq | ||
97 | $ if $severity .ne. 1 then call error | ||
98 | $ endsubroutine | ||
99 | $ | ||
100 | $ print_response: | ||
101 | $ subroutine | ||
102 | $ | ||
103 | $ openssl ts -reply -in 'p1' -text | ||
104 | $ if $severity .ne. 1 then call error | ||
105 | $ endsubroutine | ||
106 | $ | ||
107 | $ create_time_stamp_response: | ||
108 | $ subroutine | ||
109 | $ | ||
110 | $ openssl ts -reply -section 'p3' -queryfile 'p1' -out 'p2' | ||
111 | $ if $severity .ne. 1 then call error | ||
112 | $ endsubroutine | ||
113 | $ | ||
114 | $ time_stamp_response_token_test: | ||
115 | $ subroutine | ||
116 | $ | ||
117 | $ RESPONSE2:='p2'.copy_tsr | ||
118 | $ TOKEN_DER:='p2'.token_der | ||
119 | $ openssl ts -reply -in 'p2' -out 'TOKEN_DER' -token_out | ||
120 | $ if $severity .ne. 1 then call error | ||
121 | $ openssl ts -reply -in 'TOKEN_DER' -token_in -out 'RESPONSE2' | ||
122 | $ if $severity .ne. 1 then call error | ||
123 | $ backup/compare 'RESPONSE2' 'p2' | ||
124 | $ if $severity .ne. 1 then call error | ||
125 | $ openssl ts -reply -in 'p2' -text -token_out | ||
126 | $ if $severity .ne. 1 then call error | ||
127 | $ openssl ts -reply -in 'TOKEN_DER' -token_in -text -token_out | ||
128 | $ if $severity .ne. 1 then call error | ||
129 | $ openssl ts -reply -queryfile 'p1' -text -token_out | ||
130 | $ if $severity .ne. 1 then call error | ||
131 | $ endsubroutine | ||
132 | $ | ||
133 | $ verify_time_stamp_response: | ||
134 | $ subroutine | ||
135 | $ | ||
136 | $ openssl ts -verify -queryfile 'p1' -in 'p2' - | ||
137 | "-CAfile" tsaca.pem -untrusted tsa_cert1.pem | ||
138 | $ if $severity .ne. 1 then call error | ||
139 | $ openssl ts -verify -data 'p3' -in 'p2' - | ||
140 | "-CAfile" tsaca.pem -untrusted tsa_cert1.pem | ||
141 | $ if $severity .ne. 1 then call error | ||
142 | $ endsubroutine | ||
143 | $ | ||
144 | $ verify_time_stamp_token: | ||
145 | $ subroutine | ||
146 | $ | ||
147 | $ ! create the token from the response first | ||
148 | $ openssl ts -reply -in 'p2' -out 'p2'.token -token_out | ||
149 | $ if $severity .ne. 1 then call error | ||
150 | $ openssl ts -verify -queryfile 'p1' -in 'p2'.token -token_in - | ||
151 | "-CAfile" tsaca.pem -untrusted tsa_cert1.pem | ||
152 | $ if $severity .ne. 1 then call error | ||
153 | $ openssl ts -verify -data 'p3' -in 'p2'.token -token_in - | ||
154 | "-CAfile" tsaca.pem -untrusted tsa_cert1.pem | ||
155 | $ if $severity .ne. 1 then call error | ||
156 | $ endsubroutine | ||
157 | $ | ||
158 | $ verify_time_stamp_response_fail: | ||
159 | $ subroutine | ||
160 | $ | ||
161 | $ openssl ts -verify -queryfile 'p1' -in 'p2' - | ||
162 | "-CAfile" tsaca.pem -untrusted tsa_cert1.pem | ||
163 | $ ! Checks if the verification failed, as it should have. | ||
164 | $ if $severity .eq. 1 then call error | ||
165 | $ write sys$output "Ok" | ||
166 | $ endsubroutine | ||
167 | $ | ||
168 | $ ! Main body ---------------------------------------------------------- | ||
169 | $ | ||
170 | $ write sys$output "Setting up TSA test directory..." | ||
171 | $ call setup_dir | ||
172 | $ | ||
173 | $ write sys$output "Creating CA for TSA tests..." | ||
174 | $ call create_ca | ||
175 | $ | ||
176 | $ write sys$output "Creating tsa_cert1.pem TSA server cert..." | ||
177 | $ call create_tsa_cert 1 "tsa_cert" | ||
178 | $ | ||
179 | $ write sys$output "Creating tsa_cert2.pem non-TSA server cert..." | ||
180 | $ call create_tsa_cert 2 "non_tsa_cert" | ||
181 | $ | ||
182 | $ write sys$output "Creating req1.req time stamp request for file testtsa..." | ||
183 | $ call create_time_stamp_request1 | ||
184 | $ | ||
185 | $ write sys$output "Printing req1.req..." | ||
186 | $ call print_request req1.tsq | ||
187 | $ | ||
188 | $ write sys$output "Generating valid response for req1.req..." | ||
189 | $ call create_time_stamp_response req1.tsq resp1.tsr tsa_config1 | ||
190 | $ | ||
191 | $ write sys$output "Printing response..." | ||
192 | $ call print_response resp1.tsr | ||
193 | $ | ||
194 | $ write sys$output "Verifying valid response..." | ||
195 | $ call verify_time_stamp_response req1.tsq resp1.tsr [-]testtsa.com | ||
196 | $ | ||
197 | $ write sys$output "Verifying valid token..." | ||
198 | $ call verify_time_stamp_token req1.tsq resp1.tsr [-]testtsa.com | ||
199 | $ | ||
200 | $ ! The tests below are commented out, because invalid signer certificates | ||
201 | $ ! can no longer be specified in the config file. | ||
202 | $ | ||
203 | $ ! write sys$output "Generating _invalid_ response for req1.req..." | ||
204 | $ ! call create_time_stamp_response req1.tsq resp1_bad.tsr tsa_config2 | ||
205 | $ | ||
206 | $ ! write sys$output "Printing response..." | ||
207 | $ ! call print_response resp1_bad.tsr | ||
208 | $ | ||
209 | $ ! write sys$output "Verifying invalid response, it should fail..." | ||
210 | $ ! call verify_time_stamp_response_fail req1.tsq resp1_bad.tsr | ||
211 | $ | ||
212 | $ write sys$output "Creating req2.req time stamp request for file testtsa..." | ||
213 | $ call create_time_stamp_request2 | ||
214 | $ | ||
215 | $ write sys$output "Printing req2.req..." | ||
216 | $ call print_request req2.tsq | ||
217 | $ | ||
218 | $ write sys$output "Generating valid response for req2.req..." | ||
219 | $ call create_time_stamp_response req2.tsq resp2.tsr tsa_config1 | ||
220 | $ | ||
221 | $ write sys$output "Checking '-token_in' and '-token_out' options with '-reply'..." | ||
222 | $ call time_stamp_response_token_test req2.tsq resp2.tsr | ||
223 | $ | ||
224 | $ write sys$output "Printing response..." | ||
225 | $ call print_response resp2.tsr | ||
226 | $ | ||
227 | $ write sys$output "Verifying valid response..." | ||
228 | $ call verify_time_stamp_response req2.tsq resp2.tsr [-]testtsa.com | ||
229 | $ | ||
230 | $ write sys$output "Verifying response against wrong request, it should fail..." | ||
231 | $ call verify_time_stamp_response_fail req1.tsq resp2.tsr | ||
232 | $ | ||
233 | $ write sys$output "Verifying response against wrong request, it should fail..." | ||
234 | $ call verify_time_stamp_response_fail req2.tsq resp1.tsr | ||
235 | $ | ||
236 | $ write sys$output "Creating req3.req time stamp request for file CAtsa.cnf..." | ||
237 | $ call create_time_stamp_request3 | ||
238 | $ | ||
239 | $ write sys$output "Printing req3.req..." | ||
240 | $ call print_request req3.tsq | ||
241 | $ | ||
242 | $ write sys$output "Verifying response against wrong request, it should fail..." | ||
243 | $ call verify_time_stamp_response_fail req3.tsq resp1.tsr | ||
244 | $ | ||
245 | $ write sys$output "Cleaning up..." | ||
246 | $ call clean_up_dir | ||
247 | $ | ||
248 | $ exit | ||
diff --git a/src/lib/libssl/test/tpkcs7.com b/src/lib/libssl/test/tpkcs7.com new file mode 100644 index 0000000000..e107cc141a --- /dev/null +++ b/src/lib/libssl/test/tpkcs7.com | |||
@@ -0,0 +1,56 @@ | |||
1 | $! TPKCS7.COM -- Tests pkcs7 keys | ||
2 | $ | ||
3 | $ __arch := VAX | ||
4 | $ if f$getsyi("cpu") .ge. 128 then - | ||
5 | __arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE") | ||
6 | $ if __arch .eqs. "" then __arch := UNK | ||
7 | $ exe_dir := sys$disk:[-.'__arch'.exe.apps] | ||
8 | $ | ||
9 | $ cmd := mcr 'exe_dir'openssl pkcs7 | ||
10 | $ | ||
11 | $ t := testp7.pem | ||
12 | $ if p1 .nes. "" then t = p1 | ||
13 | $ | ||
14 | $ write sys$output "testing PKCS7 conversions" | ||
15 | $ if f$search("fff.*") .nes "" then delete fff.*;* | ||
16 | $ if f$search("ff.*") .nes "" then delete ff.*;* | ||
17 | $ if f$search("f.*") .nes "" then delete f.*;* | ||
18 | $ convert/fdl=sys$input: 't' fff.p | ||
19 | RECORD | ||
20 | FORMAT STREAM_LF | ||
21 | $ | ||
22 | $ write sys$output "p -> d" | ||
23 | $ 'cmd' -in fff.p -inform p -outform d -out f.d | ||
24 | $ if $severity .ne. 1 then exit 3 | ||
25 | $ write sys$output "p -> p" | ||
26 | $ 'cmd' -in fff.p -inform p -outform p -out f.p | ||
27 | $ if $severity .ne. 1 then exit 3 | ||
28 | $ | ||
29 | $ write sys$output "d -> d" | ||
30 | $ 'cmd' -in f.d -inform d -outform d -out ff.d1 | ||
31 | $ if $severity .ne. 1 then exit 3 | ||
32 | $ write sys$output "p -> d" | ||
33 | $ 'cmd' -in f.p -inform p -outform d -out ff.d3 | ||
34 | $ if $severity .ne. 1 then exit 3 | ||
35 | $ | ||
36 | $ | ||
37 | $ write sys$output "d -> p" | ||
38 | $ 'cmd' -in f.d -inform d -outform p -out ff.p1 | ||
39 | $ if $severity .ne. 1 then exit 3 | ||
40 | $ write sys$output "p -> p" | ||
41 | $ 'cmd' -in f.p -inform p -outform p -out ff.p3 | ||
42 | $ if $severity .ne. 1 then exit 3 | ||
43 | $ | ||
44 | $ backup/compare fff.p f.p | ||
45 | $ if $severity .ne. 1 then exit 3 | ||
46 | $ backup/compare fff.p ff.p1 | ||
47 | $ if $severity .ne. 1 then exit 3 | ||
48 | $ backup/compare fff.p ff.p3 | ||
49 | $ if $severity .ne. 1 then exit 3 | ||
50 | $ | ||
51 | $ backup/compare f.p ff.p1 | ||
52 | $ if $severity .ne. 1 then exit 3 | ||
53 | $ backup/compare f.p ff.p3 | ||
54 | $ if $severity .ne. 1 then exit 3 | ||
55 | $ | ||
56 | $ delete f.*;*,ff.*;*,fff.*;* | ||
diff --git a/src/lib/libssl/test/tpkcs7d.com b/src/lib/libssl/test/tpkcs7d.com new file mode 100644 index 0000000000..5ff653ccee --- /dev/null +++ b/src/lib/libssl/test/tpkcs7d.com | |||
@@ -0,0 +1,49 @@ | |||
1 | $! TPKCS7.COM -- Tests pkcs7 keys | ||
2 | $ | ||
3 | $ __arch := VAX | ||
4 | $ if f$getsyi("cpu") .ge. 128 then - | ||
5 | __arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE") | ||
6 | $ if __arch .eqs. "" then __arch := UNK | ||
7 | $ exe_dir := sys$disk:[-.'__arch'.exe.apps] | ||
8 | $ | ||
9 | $ cmd := mcr 'exe_dir'openssl pkcs7 | ||
10 | $ | ||
11 | $ t := pkcs7-1.pem | ||
12 | $ if p1 .nes. "" then t = p1 | ||
13 | $ | ||
14 | $ write sys$output "testing PKCS7 conversions (2)" | ||
15 | $ if f$search("fff.*") .nes "" then delete fff.*;* | ||
16 | $ if f$search("ff.*") .nes "" then delete ff.*;* | ||
17 | $ if f$search("f.*") .nes "" then delete f.*;* | ||
18 | $ convert/fdl=sys$input: 't' fff.p | ||
19 | RECORD | ||
20 | FORMAT STREAM_LF | ||
21 | $ | ||
22 | $ write sys$output "p -> d" | ||
23 | $ 'cmd' -in fff.p -inform p -outform d -out f.d | ||
24 | $ if $severity .ne. 1 then exit 3 | ||
25 | $ write sys$output "p -> p" | ||
26 | $ 'cmd' -in fff.p -inform p -outform p -out f.p | ||
27 | $ if $severity .ne. 1 then exit 3 | ||
28 | $ | ||
29 | $ write sys$output "d -> d" | ||
30 | $ 'cmd' -in f.d -inform d -outform d -out ff.d1 | ||
31 | $ if $severity .ne. 1 then exit 3 | ||
32 | $ write sys$output "p -> d" | ||
33 | $ 'cmd' -in f.p -inform p -outform d -out ff.d3 | ||
34 | $ if $severity .ne. 1 then exit 3 | ||
35 | $ | ||
36 | $ | ||
37 | $ write sys$output "d -> p" | ||
38 | $ 'cmd' -in f.d -inform d -outform p -out ff.p1 | ||
39 | $ if $severity .ne. 1 then exit 3 | ||
40 | $ write sys$output "p -> p" | ||
41 | $ 'cmd' -in f.p -inform p -outform p -out ff.p3 | ||
42 | $ if $severity .ne. 1 then exit 3 | ||
43 | $ | ||
44 | $ backup/compare f.p ff.p1 | ||
45 | $ if $severity .ne. 1 then exit 3 | ||
46 | $ backup/compare f.p ff.p3 | ||
47 | $ if $severity .ne. 1 then exit 3 | ||
48 | $ | ||
49 | $ delete f.*;*,ff.*;*,fff.*;* | ||
diff --git a/src/lib/libssl/test/treq.com b/src/lib/libssl/test/treq.com new file mode 100644 index 0000000000..d2594be6a7 --- /dev/null +++ b/src/lib/libssl/test/treq.com | |||
@@ -0,0 +1,85 @@ | |||
1 | $! TREQ.COM -- Tests req keys | ||
2 | $ | ||
3 | $ __arch := VAX | ||
4 | $ if f$getsyi("cpu") .ge. 128 then - | ||
5 | __arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE") | ||
6 | $ if __arch .eqs. "" then __arch := UNK | ||
7 | $ exe_dir := sys$disk:[-.'__arch'.exe.apps] | ||
8 | $ | ||
9 | $ cmd := mcr 'exe_dir'openssl req -config [-.apps]openssl-vms.cnf | ||
10 | $ | ||
11 | $ t := testreq.pem | ||
12 | $ if p1 .nes. "" then t = p1 | ||
13 | $ | ||
14 | $ write sys$output "testing req conversions" | ||
15 | $ if f$search("fff.*") .nes "" then delete fff.*;* | ||
16 | $ if f$search("ff.*") .nes "" then delete ff.*;* | ||
17 | $ if f$search("f.*") .nes "" then delete f.*;* | ||
18 | $ convert/fdl=sys$input: 't' fff.p | ||
19 | RECORD | ||
20 | FORMAT STREAM_LF | ||
21 | $ | ||
22 | $ write sys$output "p -> d" | ||
23 | $ 'cmd' -in fff.p -inform p -outform d -out f.d | ||
24 | $ if $severity .ne. 1 then exit 3 | ||
25 | $! write sys$output "p -> t" | ||
26 | $! 'cmd' -in fff.p -inform p -outform t -out f.t | ||
27 | $! if $severity .ne. 1 then exit 3 | ||
28 | $ write sys$output "p -> p" | ||
29 | $ 'cmd' -in fff.p -inform p -outform p -out f.p | ||
30 | $ if $severity .ne. 1 then exit 3 | ||
31 | $ | ||
32 | $ write sys$output "d -> d" | ||
33 | $ 'cmd' -verify -in f.d -inform d -outform d -out ff.d1 | ||
34 | $ if $severity .ne. 1 then exit 3 | ||
35 | $! write sys$output "t -> d" | ||
36 | $! 'cmd' -verify -in f.t -inform t -outform d -out ff.d2 | ||
37 | $! if $severity .ne. 1 then exit 3 | ||
38 | $ write sys$output "p -> d" | ||
39 | $ 'cmd' -verify -in f.p -inform p -outform d -out ff.d3 | ||
40 | $ if $severity .ne. 1 then exit 3 | ||
41 | $ | ||
42 | $! write sys$output "d -> t" | ||
43 | $! 'cmd' -in f.d -inform d -outform t -out ff.t1 | ||
44 | $! if $severity .ne. 1 then exit 3 | ||
45 | $! write sys$output "t -> t" | ||
46 | $! 'cmd' -in f.t -inform t -outform t -out ff.t2 | ||
47 | $! if $severity .ne. 1 then exit 3 | ||
48 | $! write sys$output "p -> t" | ||
49 | $! 'cmd' -in f.p -inform p -outform t -out ff.t3 | ||
50 | $! if $severity .ne. 1 then exit 3 | ||
51 | $ | ||
52 | $ write sys$output "d -> p" | ||
53 | $ 'cmd' -in f.d -inform d -outform p -out ff.p1 | ||
54 | $ if $severity .ne. 1 then exit 3 | ||
55 | $! write sys$output "t -> p" | ||
56 | $! 'cmd' -in f.t -inform t -outform p -out ff.p2 | ||
57 | $! if $severity .ne. 1 then exit 3 | ||
58 | $ write sys$output "p -> p" | ||
59 | $ 'cmd' -in f.p -inform p -outform p -out ff.p3 | ||
60 | $ if $severity .ne. 1 then exit 3 | ||
61 | $ | ||
62 | $ backup/compare fff.p f.p | ||
63 | $ if $severity .ne. 1 then exit 3 | ||
64 | $ backup/compare fff.p ff.p1 | ||
65 | $ if $severity .ne. 1 then exit 3 | ||
66 | $! backup/compare fff.p ff.p2 | ||
67 | $! if $severity .ne. 1 then exit 3 | ||
68 | $ backup/compare fff.p ff.p3 | ||
69 | $ if $severity .ne. 1 then exit 3 | ||
70 | $ | ||
71 | $! backup/compare f.t ff.t1 | ||
72 | $! if $severity .ne. 1 then exit 3 | ||
73 | $! backup/compare f.t ff.t2 | ||
74 | $! if $severity .ne. 1 then exit 3 | ||
75 | $! backup/compare f.t ff.t3 | ||
76 | $! if $severity .ne. 1 then exit 3 | ||
77 | $ | ||
78 | $ backup/compare f.p ff.p1 | ||
79 | $ if $severity .ne. 1 then exit 3 | ||
80 | $! backup/compare f.p ff.p2 | ||
81 | $! if $severity .ne. 1 then exit 3 | ||
82 | $ backup/compare f.p ff.p3 | ||
83 | $ if $severity .ne. 1 then exit 3 | ||
84 | $ | ||
85 | $ delete f.*;*,ff.*;*,fff.*;* | ||
diff --git a/src/lib/libssl/test/trsa.com b/src/lib/libssl/test/trsa.com new file mode 100644 index 0000000000..d3a8a605b7 --- /dev/null +++ b/src/lib/libssl/test/trsa.com | |||
@@ -0,0 +1,96 @@ | |||
1 | $! TRSA.COM -- Tests rsa keys | ||
2 | $ | ||
3 | $ __arch := VAX | ||
4 | $ if f$getsyi("cpu") .ge. 128 then - | ||
5 | __arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE") | ||
6 | $ if __arch .eqs. "" then __arch := UNK | ||
7 | $ exe_dir := sys$disk:[-.'__arch'.exe.apps] | ||
8 | $ | ||
9 | $ set noon | ||
10 | $ define/user sys$output nla0: | ||
11 | $ mcr 'exe_dir'openssl no-rsa | ||
12 | $ save_severity=$SEVERITY | ||
13 | $ set on | ||
14 | $ if save_severity | ||
15 | $ then | ||
16 | $ write sys$output "skipping RSA conversion test" | ||
17 | $ exit | ||
18 | $ endif | ||
19 | $ | ||
20 | $ cmd := mcr 'exe_dir'openssl rsa | ||
21 | $ | ||
22 | $ t := testrsa.pem | ||
23 | $ if p1 .nes. "" then t = p1 | ||
24 | $ | ||
25 | $ write sys$output "testing RSA conversions" | ||
26 | $ if f$search("fff.*") .nes "" then delete fff.*;* | ||
27 | $ if f$search("ff.*") .nes "" then delete ff.*;* | ||
28 | $ if f$search("f.*") .nes "" then delete f.*;* | ||
29 | $ convert/fdl=sys$input: 't' fff.p | ||
30 | RECORD | ||
31 | FORMAT STREAM_LF | ||
32 | $ | ||
33 | $ write sys$output "p -> d" | ||
34 | $ 'cmd' -in fff.p -inform p -outform d -out f.d | ||
35 | $ if $severity .ne. 1 then exit 3 | ||
36 | $! write sys$output "p -> t" | ||
37 | $! 'cmd' -in fff.p -inform p -outform t -out f.t | ||
38 | $! if $severity .ne. 1 then exit 3 | ||
39 | $ write sys$output "p -> p" | ||
40 | $ 'cmd' -in fff.p -inform p -outform p -out f.p | ||
41 | $ if $severity .ne. 1 then exit 3 | ||
42 | $ | ||
43 | $ write sys$output "d -> d" | ||
44 | $ 'cmd' -in f.d -inform d -outform d -out ff.d1 | ||
45 | $ if $severity .ne. 1 then exit 3 | ||
46 | $! write sys$output "t -> d" | ||
47 | $! 'cmd' -in f.t -inform t -outform d -out ff.d2 | ||
48 | $! if $severity .ne. 1 then exit 3 | ||
49 | $ write sys$output "p -> d" | ||
50 | $ 'cmd' -in f.p -inform p -outform d -out ff.d3 | ||
51 | $ if $severity .ne. 1 then exit 3 | ||
52 | $ | ||
53 | $! write sys$output "d -> t" | ||
54 | $! 'cmd' -in f.d -inform d -outform t -out ff.t1 | ||
55 | $! if $severity .ne. 1 then exit 3 | ||
56 | $! write sys$output "t -> t" | ||
57 | $! 'cmd' -in f.t -inform t -outform t -out ff.t2 | ||
58 | $! if $severity .ne. 1 then exit 3 | ||
59 | $! write sys$output "p -> t" | ||
60 | $! 'cmd' -in f.p -inform p -outform t -out ff.t3 | ||
61 | $! if $severity .ne. 1 then exit 3 | ||
62 | $ | ||
63 | $ write sys$output "d -> p" | ||
64 | $ 'cmd' -in f.d -inform d -outform p -out ff.p1 | ||
65 | $ if $severity .ne. 1 then exit 3 | ||
66 | $! write sys$output "t -> p" | ||
67 | $! 'cmd' -in f.t -inform t -outform p -out ff.p2 | ||
68 | $! if $severity .ne. 1 then exit 3 | ||
69 | $ write sys$output "p -> p" | ||
70 | $ 'cmd' -in f.p -inform p -outform p -out ff.p3 | ||
71 | $ if $severity .ne. 1 then exit 3 | ||
72 | $ | ||
73 | $ backup/compare fff.p f.p | ||
74 | $ if $severity .ne. 1 then exit 3 | ||
75 | $ backup/compare fff.p ff.p1 | ||
76 | $ if $severity .ne. 1 then exit 3 | ||
77 | $! backup/compare fff.p ff.p2 | ||
78 | $! if $severity .ne. 1 then exit 3 | ||
79 | $ backup/compare fff.p ff.p3 | ||
80 | $ if $severity .ne. 1 then exit 3 | ||
81 | $ | ||
82 | $! backup/compare f.t ff.t1 | ||
83 | $! if $severity .ne. 1 then exit 3 | ||
84 | $! backup/compare f.t ff.t2 | ||
85 | $! if $severity .ne. 1 then exit 3 | ||
86 | $! backup/compare f.t ff.t3 | ||
87 | $! if $severity .ne. 1 then exit 3 | ||
88 | $ | ||
89 | $ backup/compare f.p ff.p1 | ||
90 | $ if $severity .ne. 1 then exit 3 | ||
91 | $! backup/compare f.p ff.p2 | ||
92 | $! if $severity .ne. 1 then exit 3 | ||
93 | $ backup/compare f.p ff.p3 | ||
94 | $ if $severity .ne. 1 then exit 3 | ||
95 | $ | ||
96 | $ delete f.*;*,ff.*;*,fff.*;* | ||
diff --git a/src/lib/libssl/test/tsid.com b/src/lib/libssl/test/tsid.com new file mode 100644 index 0000000000..267ace1135 --- /dev/null +++ b/src/lib/libssl/test/tsid.com | |||
@@ -0,0 +1,85 @@ | |||
1 | $! TSID.COM -- Tests sid keys | ||
2 | $ | ||
3 | $ __arch := VAX | ||
4 | $ if f$getsyi("cpu") .ge. 128 then - | ||
5 | __arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE") | ||
6 | $ if __arch .eqs. "" then __arch := UNK | ||
7 | $ exe_dir := sys$disk:[-.'__arch'.exe.apps] | ||
8 | $ | ||
9 | $ cmd := mcr 'exe_dir'openssl sess_id | ||
10 | $ | ||
11 | $ t := testsid.pem | ||
12 | $ if p1 .nes. "" then t = p1 | ||
13 | $ | ||
14 | $ write sys$output "testing session-id conversions" | ||
15 | $ if f$search("fff.*") .nes "" then delete fff.*;* | ||
16 | $ if f$search("ff.*") .nes "" then delete ff.*;* | ||
17 | $ if f$search("f.*") .nes "" then delete f.*;* | ||
18 | $ convert/fdl=sys$input: 't' fff.p | ||
19 | RECORD | ||
20 | FORMAT STREAM_LF | ||
21 | $ | ||
22 | $ write sys$output "p -> d" | ||
23 | $ 'cmd' -in fff.p -inform p -outform d -out f.d | ||
24 | $ if $severity .ne. 1 then exit 3 | ||
25 | $! write sys$output "p -> t" | ||
26 | $! 'cmd' -in fff.p -inform p -outform t -out f.t | ||
27 | $! if $severity .ne. 1 then exit 3 | ||
28 | $ write sys$output "p -> p" | ||
29 | $ 'cmd' -in fff.p -inform p -outform p -out f.p | ||
30 | $ if $severity .ne. 1 then exit 3 | ||
31 | $ | ||
32 | $ write sys$output "d -> d" | ||
33 | $ 'cmd' -in f.d -inform d -outform d -out ff.d1 | ||
34 | $ if $severity .ne. 1 then exit 3 | ||
35 | $! write sys$output "t -> d" | ||
36 | $! 'cmd' -in f.t -inform t -outform d -out ff.d2 | ||
37 | $! if $severity .ne. 1 then exit 3 | ||
38 | $ write sys$output "p -> d" | ||
39 | $ 'cmd' -in f.p -inform p -outform d -out ff.d3 | ||
40 | $ if $severity .ne. 1 then exit 3 | ||
41 | $ | ||
42 | $! write sys$output "d -> t" | ||
43 | $! 'cmd' -in f.d -inform d -outform t -out ff.t1 | ||
44 | $! if $severity .ne. 1 then exit 3 | ||
45 | $! write sys$output "t -> t" | ||
46 | $! 'cmd' -in f.t -inform t -outform t -out ff.t2 | ||
47 | $! if $severity .ne. 1 then exit 3 | ||
48 | $! write sys$output "p -> t" | ||
49 | $! 'cmd' -in f.p -inform p -outform t -out ff.t3 | ||
50 | $! if $severity .ne. 1 then exit 3 | ||
51 | $ | ||
52 | $ write sys$output "d -> p" | ||
53 | $ 'cmd' -in f.d -inform d -outform p -out ff.p1 | ||
54 | $ if $severity .ne. 1 then exit 3 | ||
55 | $! write sys$output "t -> p" | ||
56 | $! 'cmd' -in f.t -inform t -outform p -out ff.p2 | ||
57 | $! if $severity .ne. 1 then exit 3 | ||
58 | $ write sys$output "p -> p" | ||
59 | $ 'cmd' -in f.p -inform p -outform p -out ff.p3 | ||
60 | $ if $severity .ne. 1 then exit 3 | ||
61 | $ | ||
62 | $ backup/compare fff.p f.p | ||
63 | $ if $severity .ne. 1 then exit 3 | ||
64 | $ backup/compare fff.p ff.p1 | ||
65 | $ if $severity .ne. 1 then exit 3 | ||
66 | $! backup/compare fff.p ff.p2 | ||
67 | $! if $severity .ne. 1 then exit 3 | ||
68 | $ backup/compare fff.p ff.p3 | ||
69 | $ if $severity .ne. 1 then exit 3 | ||
70 | $ | ||
71 | $! backup/compare f.t ff.t1 | ||
72 | $! if $severity .ne. 1 then exit 3 | ||
73 | $! backup/compare f.t ff.t2 | ||
74 | $! if $severity .ne. 1 then exit 3 | ||
75 | $! backup/compare f.t ff.t3 | ||
76 | $! if $severity .ne. 1 then exit 3 | ||
77 | $ | ||
78 | $ backup/compare f.p ff.p1 | ||
79 | $ if $severity .ne. 1 then exit 3 | ||
80 | $! backup/compare f.p ff.p2 | ||
81 | $! if $severity .ne. 1 then exit 3 | ||
82 | $ backup/compare f.p ff.p3 | ||
83 | $ if $severity .ne. 1 then exit 3 | ||
84 | $ | ||
85 | $ 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..01431f4aac --- /dev/null +++ b/src/lib/libssl/test/tverify.com | |||
@@ -0,0 +1,63 @@ | |||
1 | $! TVERIFY.COM | ||
2 | $ | ||
3 | $ __arch := VAX | ||
4 | $ if f$getsyi("cpu") .ge. 128 then - | ||
5 | __arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE") | ||
6 | $ if __arch .eqs. "" then __arch := UNK | ||
7 | $! | ||
8 | $ line_max = 255 ! Could be longer on modern non-VAX. | ||
9 | $ temp_file_name = "certs_"+ f$getjpi( "", "PID")+ ".tmp" | ||
10 | $ exe_dir := sys$disk:[-.'__arch'.exe.apps] | ||
11 | $ cmd = "mcr ''exe_dir'openssl verify ""-CAfile"" ''temp_file_name'" | ||
12 | $ cmd_len = f$length( cmd) | ||
13 | $ pems = "[-.certs...]*.pem" | ||
14 | $! | ||
15 | $! Concatenate all the certificate files. | ||
16 | $! | ||
17 | $ copy /concatenate 'pems' 'temp_file_name' | ||
18 | $! | ||
19 | $! Loop through all the certificate files. | ||
20 | $! | ||
21 | $ args = "" | ||
22 | $ old_f := | ||
23 | $ loop_file: | ||
24 | $ f = f$search( pems) | ||
25 | $ if ((f .nes. "") .and. (f .nes. old_f)) | ||
26 | $ then | ||
27 | $ old_f = f | ||
28 | $! | ||
29 | $! If this file name would over-extend the command line, then | ||
30 | $! run the command now. | ||
31 | $! | ||
32 | $ if (cmd_len+ f$length( args)+ 1+ f$length( f) .gt. line_max) | ||
33 | $ then | ||
34 | $ if (args .eqs. "") then goto disaster | ||
35 | $ 'cmd''args' | ||
36 | $ args = "" | ||
37 | $ endif | ||
38 | $! Add the next file to the argument list. | ||
39 | $ args = args+ " "+ f | ||
40 | $ else | ||
41 | $! No more files in the list | ||
42 | $ goto loop_file_end | ||
43 | $ endif | ||
44 | $ goto loop_file | ||
45 | $ loop_file_end: | ||
46 | $! | ||
47 | $! Run the command for any left-over arguments. | ||
48 | $! | ||
49 | $ if (args .nes. "") | ||
50 | $ then | ||
51 | $ 'cmd''args' | ||
52 | $ endif | ||
53 | $! | ||
54 | $! Delete the temporary file. | ||
55 | $! | ||
56 | $ if (f$search( "''temp_file_name';*") .nes. "") then - | ||
57 | delete 'temp_file_name';* | ||
58 | $! | ||
59 | $ exit | ||
60 | $! | ||
61 | $ disaster: | ||
62 | $ write sys$output " Command line too long. Doomed." | ||
63 | $! | ||
diff --git a/src/lib/libssl/test/tx509.com b/src/lib/libssl/test/tx509.com new file mode 100644 index 0000000000..399eb01490 --- /dev/null +++ b/src/lib/libssl/test/tx509.com | |||
@@ -0,0 +1,85 @@ | |||
1 | $! TX509.COM -- Tests x509 certificates | ||
2 | $ | ||
3 | $ __arch := VAX | ||
4 | $ if f$getsyi("cpu") .ge. 128 then - | ||
5 | __arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE") | ||
6 | $ if __arch .eqs. "" then __arch := UNK | ||
7 | $ exe_dir := sys$disk:[-.'__arch'.exe.apps] | ||
8 | $ | ||
9 | $ cmd := mcr 'exe_dir'openssl x509 | ||
10 | $ | ||
11 | $ t := testx509.pem | ||
12 | $ if p1 .nes. "" then t = p1 | ||
13 | $ | ||
14 | $ write sys$output "testing X509 conversions" | ||
15 | $ if f$search("fff.*") .nes "" then delete fff.*;* | ||
16 | $ if f$search("ff.*") .nes "" then delete ff.*;* | ||
17 | $ if f$search("f.*") .nes "" then delete f.*;* | ||
18 | $ convert/fdl=sys$input: 't' fff.p | ||
19 | RECORD | ||
20 | FORMAT STREAM_LF | ||
21 | $ | ||
22 | $ write sys$output "p -> d" | ||
23 | $ 'cmd' -in fff.p -inform p -outform d -out f.d | ||
24 | $ if $severity .ne. 1 then exit 3 | ||
25 | $ write sys$output "p -> n" | ||
26 | $ 'cmd' -in fff.p -inform p -outform n -out f.n | ||
27 | $ if $severity .ne. 1 then exit 3 | ||
28 | $ write sys$output "p -> p" | ||
29 | $ 'cmd' -in fff.p -inform p -outform p -out f.p | ||
30 | $ if $severity .ne. 1 then exit 3 | ||
31 | $ | ||
32 | $ write sys$output "d -> d" | ||
33 | $ 'cmd' -in f.d -inform d -outform d -out ff.d1 | ||
34 | $ if $severity .ne. 1 then exit 3 | ||
35 | $ write sys$output "n -> d" | ||
36 | $ 'cmd' -in f.n -inform n -outform d -out ff.d2 | ||
37 | $ if $severity .ne. 1 then exit 3 | ||
38 | $ write sys$output "p -> d" | ||
39 | $ 'cmd' -in f.p -inform p -outform d -out ff.d3 | ||
40 | $ if $severity .ne. 1 then exit 3 | ||
41 | $ | ||
42 | $ write sys$output "d -> n" | ||
43 | $ 'cmd' -in f.d -inform d -outform n -out ff.n1 | ||
44 | $ if $severity .ne. 1 then exit 3 | ||
45 | $ write sys$output "n -> n" | ||
46 | $ 'cmd' -in f.n -inform n -outform n -out ff.n2 | ||
47 | $ if $severity .ne. 1 then exit 3 | ||
48 | $ write sys$output "p -> n" | ||
49 | $ 'cmd' -in f.p -inform p -outform n -out ff.n3 | ||
50 | $ if $severity .ne. 1 then exit 3 | ||
51 | $ | ||
52 | $ write sys$output "d -> p" | ||
53 | $ 'cmd' -in f.d -inform d -outform p -out ff.p1 | ||
54 | $ if $severity .ne. 1 then exit 3 | ||
55 | $ write sys$output "n -> p" | ||
56 | $ 'cmd' -in f.n -inform n -outform p -out ff.p2 | ||
57 | $ if $severity .ne. 1 then exit 3 | ||
58 | $ write sys$output "p -> p" | ||
59 | $ 'cmd' -in f.p -inform p -outform p -out ff.p3 | ||
60 | $ if $severity .ne. 1 then exit 3 | ||
61 | $ | ||
62 | $ backup/compare fff.p f.p | ||
63 | $ if $severity .ne. 1 then exit 3 | ||
64 | $ backup/compare fff.p ff.p1 | ||
65 | $ if $severity .ne. 1 then exit 3 | ||
66 | $ backup/compare fff.p ff.p2 | ||
67 | $ if $severity .ne. 1 then exit 3 | ||
68 | $ backup/compare fff.p ff.p3 | ||
69 | $ if $severity .ne. 1 then exit 3 | ||
70 | $ | ||
71 | $ backup/compare f.n ff.n1 | ||
72 | $ if $severity .ne. 1 then exit 3 | ||
73 | $ backup/compare f.n ff.n2 | ||
74 | $ if $severity .ne. 1 then exit 3 | ||
75 | $ backup/compare f.n ff.n3 | ||
76 | $ if $severity .ne. 1 then exit 3 | ||
77 | $ | ||
78 | $ backup/compare f.p ff.p1 | ||
79 | $ if $severity .ne. 1 then exit 3 | ||
80 | $ backup/compare f.p ff.p2 | ||
81 | $ if $severity .ne. 1 then exit 3 | ||
82 | $ backup/compare f.p ff.p3 | ||
83 | $ if $severity .ne. 1 then exit 3 | ||
84 | $ | ||
85 | $ delete f.*;*,ff.*;*,fff.*;* | ||