1999-05-13 19:37:32 +08:00
|
|
|
$! TETSGEN.COM
|
|
|
|
$
|
|
|
|
$ __arch := VAX
|
|
|
|
$ if f$getsyi("cpu") .ge. 128 then __arch := AXP
|
|
|
|
$ exe_dir := sys$disk:[-.'__arch'.exe.apps]
|
|
|
|
$
|
|
|
|
$ T := testcert
|
|
|
|
$ KEY = 512
|
|
|
|
$ CA := [-.certs]testca.pem
|
|
|
|
$
|
|
|
|
$ set noon
|
1999-07-29 07:25:59 +08:00
|
|
|
$ if f$search(T+".1;*") .nes. "" then delete 'T'.1;*
|
|
|
|
$ if f$search(T+".2;*") .nes. "" then delete 'T'.2;*
|
|
|
|
$ if f$search(T+".key;*") .nes. "" then delete 'T'.key;*
|
1999-05-13 19:37:32 +08:00
|
|
|
$ set on
|
|
|
|
$
|
|
|
|
$ write sys$output "generating certificate request"
|
|
|
|
$
|
2000-02-26 11:57:35 +08:00
|
|
|
$ append/new nl: .rnd
|
|
|
|
$ open/append random_file .rnd
|
|
|
|
$ write random_file "string to make the random number generator think it has entropy"
|
|
|
|
$ close random_file
|
|
|
|
$
|
2000-03-14 06:27:52 +08:00
|
|
|
$ set noon
|
|
|
|
$ define/user sys$output nla0:
|
|
|
|
$ mcr 'exe_dir'openssl no-rsa
|
|
|
|
$ save_severity=$SEVERITY
|
|
|
|
$ set on
|
|
|
|
$ if save_severity
|
|
|
|
$ then
|
|
|
|
$ req_new="-newkey dsa:[-.apps]dsa512.pem"
|
|
|
|
$ else
|
|
|
|
$ req_new="-new"
|
|
|
|
$ write sys$output "There should be a 2 sequences of .'s and some +'s."
|
|
|
|
$ write sys$output "There should not be more that at most 80 per line"
|
|
|
|
$ endif
|
|
|
|
$
|
|
|
|
$ write sys$output "This could take some time."
|
|
|
|
$
|
|
|
|
$ mcr 'exe_dir'openssl req -config test.cnf 'req_new' -out testreq.pem
|
1999-05-13 19:37:32 +08:00
|
|
|
$ if $severity .ne. 1
|
|
|
|
$ then
|
|
|
|
$ write sys$output "problems creating request"
|
|
|
|
$ exit 3
|
|
|
|
$ endif
|
|
|
|
$
|
2000-03-14 06:27:52 +08:00
|
|
|
$ mcr 'exe_dir'openssl req -config test.cnf -verify -in testreq.pem -noout
|
1999-05-13 19:37:32 +08:00
|
|
|
$ if $severity .ne. 1
|
|
|
|
$ then
|
|
|
|
$ write sys$output "signature on req is wrong"
|
|
|
|
$ exit 3
|
|
|
|
$ endif
|