testgen.com 1.4 KB

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