2
0

testgen.com 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. $! TETSGEN.COM
  2. $
  3. $ __arch := VAX
  4. $ if f$getsyi("cpu") .ge. 128 then -
  5. __arch := f$edit( f$getsyi( "ARCH_NAME"), "UPCASE")
  6. $ if __arch .eqs. "" then __arch := UNK
  7. $
  8. $ T := testcert
  9. $ KEY = 512
  10. $ CA := [-.certs]testca.pem
  11. $
  12. $ set noon
  13. $ if f$search(T+".1;*") .nes. "" then delete 'T'.1;*
  14. $ if f$search(T+".2;*") .nes. "" then delete 'T'.2;*
  15. $ if f$search(T+".key;*") .nes. "" then delete 'T'.key;*
  16. $ set on
  17. $
  18. $ write sys$output "generating certificate request"
  19. $
  20. $ append/new nl: .rnd
  21. $ open/append random_file .rnd
  22. $ write random_file "string to make the random number generator think it has entropy"
  23. $ close random_file
  24. $
  25. $ set noon
  26. $ define/user sys$output nla0:
  27. $ mcr 'exe_dir'openssl no-rsa
  28. $ save_severity=$SEVERITY
  29. $ set on
  30. $ if save_severity
  31. $ then
  32. $ req_new="-newkey dsa:[-.apps]dsa512.pem"
  33. $ else
  34. $ req_new="-new"
  35. $ write sys$output "There should be a 2 sequences of .'s and some +'s."
  36. $ write sys$output "There should not be more that at most 80 per line"
  37. $ endif
  38. $
  39. $ write sys$output "This could take some time."
  40. $
  41. $ mcr 'exe_dir'openssl req -config test.cnf 'req_new' -out testreq.pem
  42. $ if $severity .ne. 1
  43. $ then
  44. $ write sys$output "problems creating request"
  45. $ exit 3
  46. $ endif
  47. $
  48. $ mcr 'exe_dir'openssl req -config test.cnf -verify -in testreq.pem -noout
  49. $ if $severity .ne. 1
  50. $ then
  51. $ write sys$output "signature on req is wrong"
  52. $ exit 3
  53. $ endif