testca.com 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. $! TESTCA.COM
  2. $
  3. $ __arch := VAX
  4. $ if f$getsyi("cpu") .ge. 128 then __arch := AXP
  5. $ exe_dir := sys$disk:[-.'__arch'.exe.apps]
  6. $
  7. $ openssl := mcr 'exe_dir'openssl
  8. $
  9. $ SSLEAY_CONFIG="-config ""CAss.cnf"""
  10. $
  11. $ set noon
  12. $ if f$search("demoCA.dir") .nes. ""
  13. $ then
  14. $ call deltree [.demoCA]*.*
  15. $ set file/prot=(S:RWED,O:RWED,G:RWED,W:RWED) demoCA.dir;*
  16. $ delete demoCA.dir;*
  17. $ endif
  18. $ set on
  19. $ open/read sys$ca_input VMSca-response.1
  20. $ @[-.apps]CA.com -input sys$ca_input -newca
  21. $ close sys$ca_input
  22. $ if $severity .ne. 1 then exit 3
  23. $
  24. $
  25. $ SSLEAY_CONFIG="-config ""Uss.cnf"""
  26. $ @[-.apps]CA.com -newreq
  27. $ if $severity .ne. 1 then exit 3
  28. $
  29. $
  30. $ SSLEAY_CONFIG="-config [-.apps]openssl-vms.cnf"
  31. $ open/read sys$ca_input VMSca-response.2
  32. $ @[-.apps]CA.com -input sys$ca_input -sign
  33. $ close sys$ca_input
  34. $ if $severity .ne. 1 then exit 3
  35. $
  36. $
  37. $ @[-.apps]CA.com -verify newcert.pem
  38. $ if $severity .ne. 1 then exit 3
  39. $
  40. $ set noon
  41. $ call deltree [.demoCA]*.*
  42. $ set file/prot=(S:RWED,O:RWED,G:RWED,W:RWED) demoCA.dir;*
  43. $ delete demoCA.dir;*
  44. $ if f$search("newcert.pem") .nes. "" then delete newcert.pem;*
  45. $ if f$search("newcert.pem") .nes. "" then delete newreq.pem;*
  46. $ set on
  47. $! #usage: CA -newcert|-newreq|-newca|-sign|-verify
  48. $
  49. $ exit
  50. $
  51. $ deltree: subroutine ! P1 is a name of a directory
  52. $ on control_y then goto dt_STOP
  53. $ on warning then goto dt_exit
  54. $ _dt_def = f$trnlnm("SYS$DISK")+f$directory()
  55. $ if f$parse(p1) .eqs. "" then exit
  56. $ set default 'f$parse(p1,,,"DEVICE")''f$parse(p1,,,"DIRECTORY")'
  57. $ p1 = f$parse(p1,,,"NAME") + f$parse(p1,,,"TYPE")
  58. $ _fp = f$parse(".DIR",p1)
  59. $ dt_loop:
  60. $ _f = f$search(_fp)
  61. $ if _f .eqs. "" then goto dt_loopend
  62. $ call deltree [.'f$parse(_f,,,"NAME")']*.*
  63. $ goto dt_loop
  64. $ dt_loopend:
  65. $ _fp = f$parse(p1,".;*")
  66. $ if f$search(_fp) .eqs. "" then goto dt_exit
  67. $ set noon
  68. $ set file/prot=(S:RWED,O:RWED,G:RWED,W:RWED) '_fp'
  69. $ set on
  70. $ delete/nolog '_fp'
  71. $ dt_exit:
  72. $ set default '_dt_def'
  73. $ exit
  74. $ dt_STOP:
  75. $ set default '_dt_def'
  76. $ stop/id=""
  77. $ exit
  78. $ endsubroutine