1@echo off
2
3cemkdir CE:\OpenSSL
4
5set test=..\ms
6set opath=%PATH%
7PATH=..\ms;%PATH%
8cecopy ..\apps\openssl.cnf CE:\OpenSSL
9set OPENSSL_CONF=\OpenSSL\openssl.cnf
10set HOME=\OpenSSL
11set CERUN_PASS_ENV=OPENSSL_CONF HOME
12
13rem run this from inside the bin directory
14
15rem Copy the DLL's (though they'll only exist if we're in out32dll)
16if exist libeay32.dll cecopy libeay32.dll CE:\OpenSSL
17if exist ssleay32.dll cecopy ssleay32.dll CE:\OpenSSL
18
19echo rsa_test
20call %test%\testce2 rsa_test
21if errorlevel 1 goto done
22
23echo destest
24call %test%\testce2 destest
25if errorlevel 1 goto done
26
27echo ideatest
28call %test%\testce2 ideatest
29if errorlevel 1 goto done
30
31echo bftest
32call %test%\testce2 bftest
33if errorlevel 1 goto done
34
35echo shatest
36call %test%\testce2 shatest
37if errorlevel 1 goto done
38
39echo sha1test
40call %test%\testce2 sha1test
41if errorlevel 1 goto done
42
43echo md5test
44call %test%\testce2 md5test
45if errorlevel 1 goto done
46
47echo md2test
48call %test%\testce2 md2test
49if errorlevel 1 goto done
50
51echo mdc2test
52call %test%\testce2 mdc2test
53if errorlevel 1 goto done
54
55echo rc2test
56call %test%\testce2 rc2test
57if errorlevel 1 goto done
58
59echo rc4test
60call %test%\testce2 rc4test
61if errorlevel 1 goto done
62
63echo randtest
64call %test%\testce2 randtest
65if errorlevel 1 goto done
66
67echo dhtest
68call %test%\testce2 dhtest
69if errorlevel 1 goto done
70
71echo exptest
72call %test%\testce2 exptest
73if errorlevel 1 goto done
74
75echo dsatest
76call %test%\testce2 dsatest
77if errorlevel 1 goto done
78
79echo testenc
80call %test%\testencce openssl.exe
81if errorlevel 1 goto done
82
83echo testpem
84call %test%\testpemce openssl.exe
85if errorlevel 1 goto done
86
87cecopy openssl.exe CE:\OpenSSL
88
89echo verify
90copy ..\certs\*.pem cert.tmp >nul
91cecopy cert.tmp CE:\OpenSSL
92cemkdir CE:\OpenSSL\certs
93rem cecopy ..\certs\*.pem CE:\OpenSSL\certs
94cecopy ..\certs\ca-cert.pem CE:\OpenSSL\certs
95cecopy ..\certs\dsa-ca.pem CE:\OpenSSL\certs
96cecopy ..\certs\dsa-pca.pem CE:\OpenSSL\certs
97cecopy ..\certs\factory.pem CE:\OpenSSL\certs
98cecopy ..\certs\ICE-CA.pem CE:\OpenSSL\certs
99cecopy ..\certs\ICE-root.pem CE:\OpenSSL\certs
100cecopy ..\certs\ICE-user.pem CE:\OpenSSL\certs
101cecopy ..\certs\nortelCA.pem CE:\OpenSSL\certs
102cecopy ..\certs\pca-cert.pem CE:\OpenSSL\certs
103cecopy ..\certs\RegTP-4R.pem CE:\OpenSSL\certs
104cecopy ..\certs\RegTP-5R.pem CE:\OpenSSL\certs
105cecopy ..\certs\RegTP-6R.pem CE:\OpenSSL\certs
106cecopy ..\certs\rsa-cca.pem CE:\OpenSSL\certs
107cecopy ..\certs\thawteCb.pem CE:\OpenSSL\certs
108cecopy ..\certs\thawteCp.pem CE:\OpenSSL\certs
109cecopy ..\certs\timCA.pem CE:\OpenSSL\certs
110cecopy ..\certs\tjhCA.pem CE:\OpenSSL\certs
111cecopy ..\certs\vsign1.pem CE:\OpenSSL\certs
112cecopy ..\certs\vsign2.pem CE:\OpenSSL\certs
113cecopy ..\certs\vsign3.pem CE:\OpenSSL\certs
114cecopy ..\certs\vsignss.pem CE:\OpenSSL\certs
115cecopy ..\certs\vsigntca.pem CE:\OpenSSL\certs
116cerun CE:\OpenSSL\openssl verify -CAfile \OpenSSL\cert.tmp \OpenSSL\certs\*.pem
117
118echo testss
119call %test%\testssce openssl.exe
120if errorlevel 1 goto done
121
122cecopy ssltest.exe CE:\OpenSSL
123cecopy ..\apps\server.pem CE:\OpenSSL
124cecopy ..\apps\client.pem CE:\OpenSSL
125
126echo test sslv2
127cerun CE:\OpenSSL\ssltest -ssl2
128if errorlevel 1 goto done
129
130echo test sslv2 with server authentication
131cerun CE:\OpenSSL\ssltest -ssl2 -server_auth -CAfile \OpenSSL\cert.tmp
132if errorlevel 1 goto done
133
134echo test sslv2 with client authentication
135cerun CE:\OpenSSL\ssltest -ssl2 -client_auth -CAfile \OpenSSL\cert.tmp
136if errorlevel 1 goto done
137
138echo test sslv2 with both client and server authentication
139cerun CE:\OpenSSL\ssltest -ssl2 -server_auth -client_auth -CAfile \OpenSSL\cert.tmp
140if errorlevel 1 goto done
141
142echo test sslv3
143cerun CE:\OpenSSL\ssltest -ssl3
144if errorlevel 1 goto done
145
146echo test sslv3 with server authentication
147cerun CE:\OpenSSL\ssltest -ssl3 -server_auth -CAfile \OpenSSL\cert.tmp
148if errorlevel 1 goto done
149
150echo test sslv3 with client authentication
151cerun CE:\OpenSSL\ssltest -ssl3 -client_auth -CAfile \OpenSSL\cert.tmp
152if errorlevel 1 goto done
153
154echo test sslv3 with both client and server authentication
155cerun CE:\OpenSSL\ssltest -ssl3 -server_auth -client_auth -CAfile \OpenSSL\cert.tmp
156if errorlevel 1 goto done
157
158echo test sslv2/sslv3
159cerun CE:\OpenSSL\ssltest
160if errorlevel 1 goto done
161
162echo test sslv2/sslv3 with server authentication
163cerun CE:\OpenSSL\ssltest -server_auth -CAfile \OpenSSL\cert.tmp
164if errorlevel 1 goto done
165
166echo test sslv2/sslv3 with client authentication
167cerun CE:\OpenSSL\ssltest -client_auth -CAfile \OpenSSL\cert.tmp
168if errorlevel 1 goto done
169
170echo test sslv2/sslv3 with both client and server authentication
171cerun CE:\OpenSSL\ssltest -server_auth -client_auth -CAfile \OpenSSL\cert.tmp
172if errorlevel 1 goto done
173
174echo test sslv2 via BIO pair
175cerun CE:\OpenSSL\ssltest -bio_pair -ssl2
176if errorlevel 1 goto done
177
178echo test sslv2/sslv3 with 1024 bit DHE via BIO pair
179cerun CE:\OpenSSL\ssltest -bio_pair -dhe1024dsa -v
180if errorlevel 1 goto done
181
182echo test sslv2 with server authentication via BIO pair
183cerun CE:\OpenSSL\ssltest -bio_pair -ssl2 -server_auth -CAfile \OpenSSL\cert.tmp
184if errorlevel 1 goto done
185
186echo test sslv2 with client authentication via BIO pair
187cerun CE:\OpenSSL\ssltest -bio_pair -ssl2 -client_auth -CAfile \OpenSSL\cert.tmp
188if errorlevel 1 goto done
189
190echo test sslv2 with both client and server authentication via BIO pair
191cerun CE:\OpenSSL\ssltest -bio_pair -ssl2 -server_auth -client_auth -CAfile \OpenSSL\cert.tmp
192if errorlevel 1 goto done
193
194echo test sslv3 via BIO pair
195cerun CE:\OpenSSL\ssltest -bio_pair -ssl3
196if errorlevel 1 goto done
197
198echo test sslv3 with server authentication via BIO pair
199cerun CE:\OpenSSL\ssltest -bio_pair -ssl3 -server_auth -CAfile \OpenSSL\cert.tmp
200if errorlevel 1 goto done
201
202echo test sslv3 with client authentication  via BIO pair
203cerun CE:\OpenSSL\ssltest -bio_pair -ssl3 -client_auth -CAfile \OpenSSL\cert.tmp
204if errorlevel 1 goto done
205
206echo test sslv3 with both client and server authentication via BIO pair
207cerun CE:\OpenSSL\ssltest -bio_pair -ssl3 -server_auth -client_auth -CAfile \OpenSSL\cert.tmp
208if errorlevel 1 goto done
209
210echo test sslv2/sslv3 via BIO pair
211cerun CE:\OpenSSL\ssltest
212if errorlevel 1 goto done
213
214echo test sslv2/sslv3 with server authentication
215cerun CE:\OpenSSL\ssltest -bio_pair -server_auth -CAfile \OpenSSL\cert.tmp
216if errorlevel 1 goto done
217
218echo test sslv2/sslv3 with client authentication via BIO pair
219cerun CE:\OpenSSL\ssltest -bio_pair -client_auth -CAfile \OpenSSL\cert.tmp
220if errorlevel 1 goto done
221
222echo test sslv2/sslv3 with both client and server authentication via BIO pair
223cerun CE:\OpenSSL\ssltest -bio_pair -server_auth -client_auth -CAfile \OpenSSL\cert.tmp
224if errorlevel 1 goto done
225
226del cert.tmp
227
228echo passed all tests
229goto end
230:done
231echo problems.....
232:end
233PATH=%opath%
234
235