summaryrefslogtreecommitdiff
path: root/src/lib/libssl/test/testtsa.com
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libssl/test/testtsa.com')
-rw-r--r--src/lib/libssl/test/testtsa.com65
1 files changed, 36 insertions, 29 deletions
diff --git a/src/lib/libssl/test/testtsa.com b/src/lib/libssl/test/testtsa.com
index e3c586f14a..29fb1d0e63 100644
--- a/src/lib/libssl/test/testtsa.com
+++ b/src/lib/libssl/test/testtsa.com
@@ -2,14 +2,17 @@ $!
2$! A few very basic tests for the 'ts' time stamping authority command. 2$! A few very basic tests for the 'ts' time stamping authority command.
3$! 3$!
4$ 4$
5$ __arch := VAX 5$ __arch = "VAX"
6$ if f$getsyi("cpu") .ge. 128 then - 6$ if f$getsyi("cpu") .ge. 128 then -
7 __arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE") 7 __arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE")
8$ if __arch .eqs. "" then __arch := UNK 8$ if __arch .eqs. "" then __arch = "UNK"
9$ exe_dir := sys$disk:[-.'__arch'.exe.apps] 9$!
10$ if (p4 .eqs. "64") then __arch = __arch+ "_64"
11$!
12$ exe_dir = "sys$disk:[-.''__arch'.exe.apps]"
10$ 13$
11$ openssl := mcr 'f$parse(exe_dir+"openssl.exe")' 14$ openssl = "mcr ''f$parse(exe_dir+"openssl.exe")'"
12$ OPENSSL_CONF := [-]CAtsa.cnf 15$ OPENSSL_CONF = "[-]CAtsa.cnf"
13$ ! Because that's what ../apps/CA.sh really looks at 16$ ! Because that's what ../apps/CA.sh really looks at
14$ SSLEAY_CONFIG = "-config " + OPENSSL_CONF 17$ SSLEAY_CONFIG = "-config " + OPENSSL_CONF
15$ 18$
@@ -114,8 +117,8 @@ $
114$ time_stamp_response_token_test: 117$ time_stamp_response_token_test:
115$ subroutine 118$ subroutine
116$ 119$
117$ RESPONSE2:='p2'.copy_tsr 120$ RESPONSE2 = p2+ "-copy_tsr"
118$ TOKEN_DER:='p2'.token_der 121$ TOKEN_DER = p2+ "-token_der"
119$ openssl ts -reply -in 'p2' -out 'TOKEN_DER' -token_out 122$ openssl ts -reply -in 'p2' -out 'TOKEN_DER' -token_out
120$ if $severity .ne. 1 then call error 123$ if $severity .ne. 1 then call error
121$ openssl ts -reply -in 'TOKEN_DER' -token_in -out 'RESPONSE2' 124$ openssl ts -reply -in 'TOKEN_DER' -token_in -out 'RESPONSE2'
@@ -145,13 +148,13 @@ $ verify_time_stamp_token:
145$ subroutine 148$ subroutine
146$ 149$
147$ ! create the token from the response first 150$ ! create the token from the response first
148$ openssl ts -reply -in 'p2' -out 'p2'.token -token_out 151$ openssl ts -reply -in "''p2'" -out "''p2'-token" -token_out
149$ if $severity .ne. 1 then call error 152$ if $severity .ne. 1 then call error
150$ openssl ts -verify -queryfile 'p1' -in 'p2'.token -token_in - 153$ openssl ts -verify -queryfile "''p1'" -in "''p2'-token" -
151 "-CAfile" tsaca.pem -untrusted tsa_cert1.pem 154 -token_in "-CAfile" tsaca.pem -untrusted tsa_cert1.pem
152$ if $severity .ne. 1 then call error 155$ if $severity .ne. 1 then call error
153$ openssl ts -verify -data 'p3' -in 'p2'.token -token_in - 156$ openssl ts -verify -data "''p3'" -in "''p2'-token" -
154 "-CAfile" tsaca.pem -untrusted tsa_cert1.pem 157 -token_in "-CAfile" tsaca.pem -untrusted tsa_cert1.pem
155$ if $severity .ne. 1 then call error 158$ if $severity .ne. 1 then call error
156$ endsubroutine 159$ endsubroutine
157$ 160$
@@ -167,6 +170,8 @@ $ endsubroutine
167$ 170$
168$ ! Main body ---------------------------------------------------------- 171$ ! Main body ----------------------------------------------------------
169$ 172$
173$ set noon
174$
170$ write sys$output "Setting up TSA test directory..." 175$ write sys$output "Setting up TSA test directory..."
171$ call setup_dir 176$ call setup_dir
172$ 177$
@@ -183,66 +188,68 @@ $ write sys$output "Creating req1.req time stamp request for file testtsa..."
183$ call create_time_stamp_request1 188$ call create_time_stamp_request1
184$ 189$
185$ write sys$output "Printing req1.req..." 190$ write sys$output "Printing req1.req..."
186$ call print_request req1.tsq 191$ call print_request "req1.tsq"
187$ 192$
188$ write sys$output "Generating valid response for req1.req..." 193$ write sys$output "Generating valid response for req1.req..."
189$ call create_time_stamp_response req1.tsq resp1.tsr tsa_config1 194$ call create_time_stamp_response "req1.tsq" "resp1.tsr" "tsa_config1"
190$ 195$
191$ write sys$output "Printing response..." 196$ write sys$output "Printing response..."
192$ call print_response resp1.tsr 197$ call print_response "resp1.tsr"
193$ 198$
194$ write sys$output "Verifying valid response..." 199$ write sys$output "Verifying valid response..."
195$ call verify_time_stamp_response req1.tsq resp1.tsr [-]testtsa.com 200$ call verify_time_stamp_response "req1.tsq" "resp1.tsr" "[-]testtsa.com"
196$ 201$
197$ write sys$output "Verifying valid token..." 202$ write sys$output "Verifying valid token..."
198$ call verify_time_stamp_token req1.tsq resp1.tsr [-]testtsa.com 203$ call verify_time_stamp_token "req1.tsq" "resp1.tsr" "[-]testtsa.com"
199$ 204$
200$ ! The tests below are commented out, because invalid signer certificates 205$ ! The tests below are commented out, because invalid signer certificates
201$ ! can no longer be specified in the config file. 206$ ! can no longer be specified in the config file.
202$ 207$
203$ ! write sys$output "Generating _invalid_ response for req1.req..." 208$ ! write sys$output "Generating _invalid_ response for req1.req..."
204$ ! call create_time_stamp_response req1.tsq resp1_bad.tsr tsa_config2 209$ ! call create_time_stamp_response "req1.tsq" "resp1_bad.tsr" "tsa_config2"
205$ 210$
206$ ! write sys$output "Printing response..." 211$ ! write sys$output "Printing response..."
207$ ! call print_response resp1_bad.tsr 212$ ! call print_response "resp1_bad.tsr"
208$ 213$
209$ ! write sys$output "Verifying invalid response, it should fail..." 214$ ! write sys$output "Verifying invalid response, it should fail..."
210$ ! call verify_time_stamp_response_fail req1.tsq resp1_bad.tsr 215$ ! call verify_time_stamp_response_fail "req1.tsq" "resp1_bad.tsr"
211$ 216$
212$ write sys$output "Creating req2.req time stamp request for file testtsa..." 217$ write sys$output "Creating req2.req time stamp request for file testtsa..."
213$ call create_time_stamp_request2 218$ call create_time_stamp_request2
214$ 219$
215$ write sys$output "Printing req2.req..." 220$ write sys$output "Printing req2.req..."
216$ call print_request req2.tsq 221$ call print_request "req2.tsq"
217$ 222$
218$ write sys$output "Generating valid response for req2.req..." 223$ write sys$output "Generating valid response for req2.req..."
219$ call create_time_stamp_response req2.tsq resp2.tsr tsa_config1 224$ call create_time_stamp_response "req2.tsq" "resp2.tsr" "tsa_config1"
220$ 225$
221$ write sys$output "Checking '-token_in' and '-token_out' options with '-reply'..." 226$ write sys$output "Checking '-token_in' and '-token_out' options with '-reply'..."
222$ call time_stamp_response_token_test req2.tsq resp2.tsr 227$ call time_stamp_response_token_test "req2.tsq" "resp2.tsr"
223$ 228$
224$ write sys$output "Printing response..." 229$ write sys$output "Printing response..."
225$ call print_response resp2.tsr 230$ call print_response "resp2.tsr"
226$ 231$
227$ write sys$output "Verifying valid response..." 232$ write sys$output "Verifying valid response..."
228$ call verify_time_stamp_response req2.tsq resp2.tsr [-]testtsa.com 233$ call verify_time_stamp_response "req2.tsq" "resp2.tsr" "[-]testtsa.com"
229$ 234$
230$ write sys$output "Verifying response against wrong request, it should fail..." 235$ write sys$output "Verifying response against wrong request, it should fail..."
231$ call verify_time_stamp_response_fail req1.tsq resp2.tsr 236$ call verify_time_stamp_response_fail "req1.tsq" "resp2.tsr"
232$ 237$
233$ write sys$output "Verifying response against wrong request, it should fail..." 238$ write sys$output "Verifying response against wrong request, it should fail..."
234$ call verify_time_stamp_response_fail req2.tsq resp1.tsr 239$ call verify_time_stamp_response_fail "req2.tsq" "resp1.tsr"
235$ 240$
236$ write sys$output "Creating req3.req time stamp request for file CAtsa.cnf..." 241$ write sys$output "Creating req3.req time stamp request for file CAtsa.cnf..."
237$ call create_time_stamp_request3 242$ call create_time_stamp_request3
238$ 243$
239$ write sys$output "Printing req3.req..." 244$ write sys$output "Printing req3.req..."
240$ call print_request req3.tsq 245$ call print_request "req3.tsq"
241$ 246$
242$ write sys$output "Verifying response against wrong request, it should fail..." 247$ write sys$output "Verifying response against wrong request, it should fail..."
243$ call verify_time_stamp_response_fail req3.tsq resp1.tsr 248$ call verify_time_stamp_response_fail "req3.tsq" "resp1.tsr"
244$ 249$
245$ write sys$output "Cleaning up..." 250$ write sys$output "Cleaning up..."
246$ call clean_up_dir 251$ call clean_up_dir
247$ 252$
253$ set on
254$
248$ exit 255$ exit