2011-03-19 10:58:14 +00:00
|
|
|
$! TESTGEN.COM
|
1999-05-13 11:37:32 +00:00
|
|
|
$
|
2011-03-19 10:58:14 +00:00
|
|
|
$ __arch = "VAX"
|
2009-05-15 16:36:56 +00:00
|
|
|
$ if f$getsyi("cpu") .ge. 128 then -
|
2010-01-27 09:18:42 +00:00
|
|
|
__arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE")
|
2011-03-19 10:58:14 +00:00
|
|
|
$ if __arch .eqs. "" then __arch = "UNK"
|
|
|
|
$ if (p1 .eqs. 64) then __arch = __arch+ "_64"
|
|
|
|
$ exe_dir = "sys$disk:[-.''__arch'.exe.apps]"
|
1999-05-13 11:37:32 +00:00
|
|
|
$
|
2011-03-19 10:58:14 +00:00
|
|
|
$ T = "testcert"
|
1999-05-13 11:37:32 +00:00
|
|
|
$ KEY = 512
|
2011-03-19 10:58:14 +00:00
|
|
|
$ CA = "[-.certs]testca.pem"
|
1999-05-13 11:37:32 +00:00
|
|
|
$
|
|
|
|
$ set noon
|
1999-07-28 23:25:59 +00: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 11:37:32 +00:00
|
|
|
$ set on
|
|
|
|
$
|
|
|
|
$ write sys$output "generating certificate request"
|
|
|
|
$
|
2000-02-26 03:57:35 +00:00
|
|
|
$ append/new nl: .rnd
|
|
|
|
$ open/append random_file .rnd
|
2011-03-19 10:58:14 +00:00
|
|
|
$ write random_file -
|
|
|
|
"string to make the random number generator think it has entropy"
|
2000-02-26 03:57:35 +00:00
|
|
|
$ close random_file
|
|
|
|
$
|
2000-03-13 22:27:52 +00: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"
|
2011-03-19 10:58:14 +00:00
|
|
|
$ 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"
|
2000-03-13 22:27:52 +00:00
|
|
|
$ 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 11:37:32 +00:00
|
|
|
$ if $severity .ne. 1
|
|
|
|
$ then
|
|
|
|
$ write sys$output "problems creating request"
|
|
|
|
$ exit 3
|
|
|
|
$ endif
|
|
|
|
$
|
2000-03-13 22:27:52 +00:00
|
|
|
$ mcr 'exe_dir'openssl req -config test.cnf -verify -in testreq.pem -noout
|
1999-05-13 11:37:32 +00:00
|
|
|
$ if $severity .ne. 1
|
|
|
|
$ then
|
|
|
|
$ write sys$output "signature on req is wrong"
|
|
|
|
$ exit 3
|
|
|
|
$ endif
|