 $
 $		INDEX=p1
 $		EXT=p2
-$		open/write file VMStsa-response1.create_tsa_cert
-$		write file "HU"
-$		write file "Budapest"
-$		write file "Buda"
-$		write file "Hun-TSA Ltd."
-$		write file "tsa",INDEX
-$		close file
-$		define/user sys$input VMStsa-response.create_tsa_cert
+$		TSDNSECT = "ts_cert_dn"
+$
 $		openssl req -new -
 			-out tsa_req'INDEX'.pem -keyout tsa_key'INDEX'.pem
 $		if $severity .ne. 1 then call error
 $
-$		open/write file VMStsa-response2.create_tsa_cert
-$		write file "y"
-$		write file "y"
-$		close file
-$		define/user sys$input VMStsa-response.create_tsa_cert
-$		openssl ca -in tsa_req'INDEX'.pem -out tsa_cert'INDEX'.pem -
-			-extensions "''EXT'"
+$		write sys$output "Using extension ''EXT'"
+$		openssl x509 -req -
+			-in tsa_req'INDEX'.pem -out tsa_cert'INDEX'.pem -
+			"-CA" tsaca.pem "-CAkey" tsacakey.pem "-CAcreateserial" -
+			-extfile 'OPENSSL_CONF' -extensions "''EXT'"
 $		if $severity .ne. 1 then call error
 $	endsubroutine
 $

$	call print_response resp1.tsr
$
$	write sys$output "Verifying valid response..."
$	call verify_time_stamp_response req1.tsq resp1.tsr ../testtsa
$
$	write sys$output "Verifying valid token..."
$	call verify_time_stamp_token req1.tsq resp1.tsr ../testtsa
$
$	! The tests below are commented out, because invalid signer certificates
$	! can no longer be specified in the config file.

$	subroutine
$
$		openssl ts -verify -queryfile 'p1' -in 'p2' -
			"-CAfile" tsaca.pem -untrusted tsa_cert1.pem
$		! Checks if the verification failed, as it should have.
$		if $severity .eq. 1 then call error
$		write sys$output "Ok"
$	endsubroutine
$
