[0001]
[0002]
[0003]
[0004]
[0005]
[0006]
[0007]
[0008]
[0009]
[0010]
[0011]
[0012]
[0013]
[0014]
[0015]
[0016]
[0017]
[0018]
[0019]
[0020]
[0021]
[0022]
[0023]
[0024]
[0025]
[0026]
[0027]
[0028]
[0029]
[0030]
[0031]
[0032]
[0033]
[0034]
[0035]
[0036]
[0037]
[0038]
[0039]
[0040]
[0041]
[0042]
[0043]
[0044]
[0045]
[0046]
[0047]
[0048]
[0049]
[0050]
[0051]
[0052]
[0053]
[0054]
[0055]
[0056]
[0057]
[0058]
[0059]
[0060]
[0061]
[0062]
[0063]
[0064]
[0065]
[0066]
[0067]
[0068]
[0069]
[0070]
[0071]
[0072]
[0073]
[0074]
[0075]
[0076]
[0077]
[0078]
[0079]
[0080]
[0081]
[0082]
[0083]
[0084]
[0085]
[0086]
[0087]
[0088]
[0089]
[0090]
[0091]
[0092]
[0093]
[0094]
[0095]
[0096]
[0097]
[0098]
[0099]
[0100]
[0101]
[0102]
[0103]
[0104]
[0105]
[0106]
[0107]
[0108]
[0109]
[0110]
[0111]
[0112]
[0113]
[0114]
[0115]
[0116]
[0117]
[0118]
[0119]
[0120]
[0121]
[0122]
[0123]
[0124]
[0125]
[0126]
[0127]
[0128]
[0129]
[0130]
[0131]
[0132]
[0133]
[0134]
[0135]
[0136]
[0137]
[0138]
[0139]
[0140]
[0141]
[0142]
[0143]
[0144]
[0145]
[0146]
[0147]
[0148]
[0149]
[0150]
[0151]
[0152]
[0153]
[0154]
[0155]
[0156]
[0157]
[0158]
[0159]
[0160]
[0161]
[0162]
[0163]
[0164]
[0165]
[0166]
[0167]
[0168]
[0169]
[0170]
[0171]
[0172]
[0173]
[0174]
[0175]
[0176]
[0177]
[0178]
[0179]
[0180]
[0181]
[0182]
[0183]
[0184]
[0185]
[0186]
[0187]
[0188]
[0189]
[0190]
[0191]
[0192]
[0193]
[0194]
[0195]
[0196]
[0197]
[0198]
[0199]
[0200]
[0201]
[0202]
[0203]
[0204]
[0205]
[0206]
[0207]
[0208]
[0209]
[0210]
[0211]
[0212]
[0213]
[0214]
[0215]
[0216]
[0217]
[0218]
[0219]
[0220]
[0221]
[0222]
[0223]
[0224]
[0225]
[0226]
[0227]
[0228]
[0229]
[0230]
[0231]
[0232]
[0233]
[0234]
[0235]
[0236]
[0237]
[0238]
[0239]
[0240]
[0241]
[0242]
[0243]
[0244]
[0245]
[0246]
[0247]
[0248]
[0249]
[0250]
[0251]
[0252]
[0253]
[0254]
[0255]
[0256]
[0257]
[0258]
[0259]
[0260]
[0261]
[0262]
[0263]
[0264]
[0265]
[0266]
[0267]
[0268]
[0269]
[0270]
[0271]
[0272]
[0273]
[0274]
[0275]
[0276]
[0277]
[0278]
[0279]
[0280]
[0281]
[0282]
[0283]
[0284]
[0285]
[0286]
[0287]
[0288]
[0289]
[0290]
[0291]
[0292]
[0293]
[0294]
[0295]
[0296]
[0297]
[0298]
[0299]
[0300]
[0301]
[0302]
[0303]
[0304]
[0305]
[0306]
[0307]
[0308]
[0309]
[0310]
[0311]
[0312]
[0313]
[0314]
[0315]
[0316]
[0317]
[0318]
[0319]
[0320]
[0321]
[0322]
[0323]
[0324]
[0325]
[0326]
[0327]
[0328]
[0329]
[0330]
[0331]
[0332]
[0333]
[0334]
[0335]
[0336]
[0337]
[0338]
[0339]
[0340]
[0341]
[0342]
[0343]
[0344]
[0345]
[0346]
[0347]
[0348]
[0349]
[0350]
[0351]
[0352]
[0353]
[0354]
[0355]
[0356]
[0357]
[0358]
[0359]
[0360]
[0361]
[0362]
[0363]
[0364]
[0365]
[0366]
[0367]
[0368]
[0369]
[0370]
[0371]
[0372]
[0373]
[0374]
[0375]
[0376]
[0377]
[0378]
[0379]
[0380]
[0381]
[0382]
[0383]
[0384]
[0385]
[0386]
[0387]
[0388]
[0389]
[0390]
[0391]
[0392]
[0393]
[0394]
[0395]
[0396]
[0397]
[0398]
[0399]
[0400]
[0401]
[0402]
[0403]
[0404]
[0405]
[0406]
$!-----------------------------------------------------------------'f$verify(0)
$! SSL_DETECT.COM
$!
$! Copyright (C) 1996-2021 Mark G.Daniel.
$!
$! Licensed under the Apache License, Version 2.0 (the "License");
$! you may not use this file except in compliance with the License.
$! You may obtain a copy of the License at
$!
$!    http://www.apache.org/licenses/LICENSE-2.0
$!
$! Unless required by applicable law or agreed to in writing, software
$! distributed under the License is distributed on an "AS IS" BASIS,
$! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
$! See the License for the specific language governing permissions and
$! limitations under the License.
$!
$! Checks for and determines which OpenSSL toolkit will be built against.
$!
$!    none (non-SSL build)
$!    VMS port OpenSSL toolkit
$!    VMS SSL toolkit product (HP)
$!    VMS SSL1 toolkit product (HP)
$!    WASD OpenSSL package
$!
$! If an SSL toolkit and build is selected then one of these global symbols
$! is used to convey this to other procedures including [SRC]BUILD_ALL.COM
$!
$! DEMO_SSL ................ used by DEMO.COM to initiate an SSL demo
$! BUILD_HTTPD_SSL ......... build using an SSL toolkit
$! BUILD_HTTPD_OPEN_SSL .... build using the OpenSSL toolkit
$! BUILD_HTTPD_OSSL ........ build using the (v1.1.0) OpenSSL toolkit
$! BUILD_HTTPD_VMS_SSL ..... NO LONGER SUPPORTED - build using the VMS SSL
$! BUILD_HTTPD_VMS_SSL1 .... build using the VMS SSL1 product
$! BUILD_HTTPD_WASD_SSL .... build using the WASD SSL package
$! BUILD_HTTPD_SSL_ROOT .... provides SSL_FINISH.COM with the WASD SSL root
$!
$! 19-JAN-2020  MGD  VSI SSL111
$! 18-SEP-2018  MGD  detect OpenSSL v1.1 in WASD package
$! 03-AUG-2017  MGD  bugfix; BUILD_HTTPD_SSL
$! 13-AUG-2016  MGD  OpenSSL 1.1.0 (new VMS build environment)
$!                   HP SSL (OpenSSL v0.9.8n based) no longer supported
$!                   remove (specific) support for Polarhome OpenSSL kit
$! 24-APR-2016  MGD  HPE SSL1
$! 06-DEC-2014  MGD  remove support for JFP's OpenSSL package
$! 28-APR-2012  MGD  Polarhome OpenSSL (http://www.polarhome.com/openssl/)
$! 07-NOV-2009  MGD  WASD v10 logical naming schema
$! 22-SEP-2006  MGD  upper-case result from f$search() for SSL directory
$! 19-JUN-2005  MGD  Jean-François Piéronne's OpenSSL package
$! 07-DEC-2002  MGD  initial (completely reworked for v8.1)
$!-----------------------------------------------------------------------------
$!
$ if f$trnlnm("INSTALL$DBUG") .nes. "" then set verify
$!
$ ss$_abort = 44
$ ss$_bugcheck = 676
$ say = "write sys$command"
$ on controly then exit ss$_abort
$ if f$environment("depth") .le. 1 then say ""
$!
$ dgs = "delete/symbol/global"
$ if f$type(DEMO_SSL) .nes. "" then dgs DEMO_SSL
$ if f$type(BUILD_HTTPD_OPEN_SSL) .nes. "" then dgs BUILD_HTTPD_OPEN_SSL
$ if f$type(BUILD_HTTPD_OPEN_SSL1) .nes. "" then dgs BUILD_HTTPD_OPEN_SSL1
$ if f$type(BUILD_HTTPD_SSL) .nes. "" then dgs BUILD_HTTPD_SSL
$ if f$type(BUILD_HTTPD_SSL_ROOT) .nes. "" then dgs BUILD_HTTPD_SSL_ROOT
$ if f$type(BUILD_HTTPD_VMS_SSL1) .nes. "" then dgs BUILD_HTTPD_VMS_SSL1
$ if f$type(BUILD_HTTPD_VMS_SSL111) .nes. "" then dgs BUILD_HTTPD_VMS_SSL111
$ if f$type(BUILD_HTTPD_WASD_SSL) .nes. "" then dgs BUILD_HTTPD_WASD_SSL
$!
$ OSSLroot = f$trnlnm("OSSL$INSTROOT")
$ OSSLdir = ""
$ if f$search("OSSL$INSTROOT:[000000]LIB.DIR") .nes. ""
$ then
$!   (OpenSSL v1.1.0 kit)
$    OSSLdir = f$trnlnm("OSSL$INSTROOT")
$ endif
$!
$ openSSLdir = f$trnlnm("SSLROOT")
$ if f$locate("OPENSSL",openSSLdir) .lt. f$length(openSSLdir)
$ then
$    if f$search("SSLROOT:[000000]OPENSSL.CNF") .nes. ""
$    then
$    endif
$ endif
$!
$ openSSLdir = f$trnlnm("SSLROOT")
$ if f$locate("OPENSSL",openSSLdir) .lt. f$length(openSSLdir)
$ then
$    if f$search("SSLROOT:[000000]OPENSSL.CNF") .nes. ""
$    then
$    endif
$ endif
$!
$!(SSL toolkit for OpenVMS - from the logical or look for it's directory)
$!(NO LONGER SUPPORTED but we need to account for it)
$ vmsSSLroot = f$trnlnm("SSL$ROOT")
$ if vmsSSLroot
$    then vmsSSLdir = f$search("SSL$ROOT:[000000]*.DIR");
$    else vmsSSLdir = f$search("SYS$COMMON:[000000]SSL.DIR")
$ endif
$!
$!(SSL1 toolkit for OpenVMS - from the logical or look for it's directory)
$ vmsSSL1root = f$trnlnm("SSL1$ROOT")
$ if vmsSSL1root
$    then vmsSSL1dir = f$search("SSL1$ROOT:[000000]*.DIR")
$    else vmsSSL1dir = f$search("SYS$COMMON:[000000]SSL1.DIR")
$ endif
$!
$!(SSL111 toolkit for OpenVMS - from the logical or look for it's directory)
$ vmsSSL111root = f$trnlnm("SSL111$ROOT")
$ if vmsSSL111root
$    then vmsSSL111dir = f$search("SSL111$ROOT:[000000]*.DIR")
$    else vmsSSL111dir = f$search("SYS$COMMON:[000000]SSL111.DIR")
$ endif
$!
$!(WASD's OpenSSL package)
$ wasdSSLdir = ""
$!(search for latest version in default WASD location)
$ wasdSSLdirLoop:
$    tmpDir = f$edit(f$search("WASD_ROOT:[SRC]OPENSSL-*_*_*.DIR"),"UPCASE")
$    if tmpDir .eqs. "" then goto end_wasdSSLdirLoop
$    sslDirPos = f$locate("]OPENSSL",tmpDir)
$    wasdSSLdir = f$extract(0,sslDirPos,tmpDir) + "." + -
                  f$extract(sslDirPos+1,999,tmpDir) - ".DIR;1" + "]"
$    tmpVersion = f$extract(8,999,f$parse(tmpDir,,,"name"))
$    wasdVersion = "v" + f$extract(0,f$locate("_",tmpVersion),tmpVersion) + "."
$    tmpVersion = f$extract(f$locate("_",tmpVersion)+1,999,tmpVersion)
$    wasdVersion = wasdVersion + -
                   f$extract(0,f$locate(tmpVersion,"_"),tmpVersion) + "."
$    tmpVersion = f$extract(f$locate("_",tmpVersion)+1,999,tmpVersion)
$    wasdVersion = wasdVersion + tmpVersion
$    goto wasdSSLdirLoop
$ end_wasdSSLdirLoop:
$!
$ if OSSLdir .eqs. "" .and. openSSLdir .eqs. "" .and. -
     vmsSSLdir .eqs. "" .and. wasdSSLdir .eqs. "" .and. -
     vmsSSL111dir .eqs. ""
$ then
$    type sys$input
                   **************************************
                   *  NO SSL TOOLKIT COULD BE LOCATED!  *
                   **************************************

None of the following SSL toolkits could be located.

  o  OpenSSL (prior to v1.1.0) toolkit
  o  OpenSSL (v1.1.0 or later) toolkit
  o  VMS SSL1 product (HP)
  o  VMS SSL111 product (VSI)
  o  WASD OpenSSL package

$    if p1 .eqs. "SSL"
$    then
$       type sys$input
As an "SSL" build was specifically requested this cannot continue.

$       exit ss$_abort
$    else
$       type sys$input
A non-SSL version of the server will be built.

$       read sys$command response /prompt="Press RETURN to continue: "
$       say ""
$       exit
$    endif
$ endif
$!
$ if p1 .eqs. "SSL"
$ then
$!   (an SSL build as specifically requested, if there's only one toolkit)
$!
$    if vmsSSLdir .eqs. "" .and. openSSLdir .nes. "" .and. -
        vmsSSL1dir .eqs. "" .and. wasdSSLdir .eqs. ""
$    then
$!      (only the OpenSSL toolkit was found)
$       say "The OpenSSL toolkit will be used."
$       say ""
$       BUILD_HTTPD_OPEN_SSL == 1
$       DEMO_SSL == 1
$       exit
$    endif
$!
$    if vmsSSLdir .nes. "" .and. openSSLdir .eqs. "" .and. -
        vmsSSL1dir .eqs. "" .and. wasdSSLdir .eqs. "" .and. -
        vmsSSL111dir .eqs. ""
$    then
$!      (only the VMS SSL product was found)
$       say "The VMS SSL product is no longer supported."
$       say ""
$       exit
$    endif
$!
$    if vmsSSLdir .eqs. "" .and. openSSLdir .eqs. "" .and. -
        vmsSSL1dir .nes. "" .and. wasdSSLdir .eqs. "" .and. -
        vmsSSL111dir .eqs. ""
$    then
$!      (only the VMS SSL1 product was found)
$       say "The VMS SSL1 product will be used."
$       say ""
$       BUILD_HTTPD_VMS_SSL1 == 1
$       DEMO_SSL == 1
$       exit
$    endif
$!
$    if vmsSSLdir .eqs. "" .and. openSSLdir .eqs. "" .and. -
        vmsSSL1dir .eqs. "" .and. wasdSSLdir .nes. "" .and. -
        vmsSSL111dir .eqs. ""
$    then
$!      (only the WASD OpenSSL package was found)
$       say "The WASD OpenSSL ''wasdVersion' package will be used."
$       say ""
$       BUILD_HTTPD_WASD_SSL == 1
$       DEMO_SSL == 1
$!      (this symbol will be used by SSL_FINISH.COM to build the OpenSSL apps)
$       BUILD_HTTPD_SSL_ROOT == wasdSSLdir
$       exit
$    endif
$!
$    if vmsSSLdir .eqs. "" .and. openSSLdir .eqs. "" .and. -
        vmsSSL1dir .eqs. "" .and. wasdSSLdir .eqs. "" .and. -
        vmsSSL111dir .nes. ""
$    then
$!      (only the VMS SSL111 product was found)
$       say "The VMS SSL111 product will be used."
$       say ""
$       BUILD_HTTPD_VMS_SSL111 == 1
$       DEMO_SSL == 1
$       exit
$    endif
$!
$    type sys$input
                    ************************************
                    *  MULTIPLE SSL TOOLKITS DETECTED  *
                    ************************************

Multiple supported Secure Sockets Layer (SSL) toolkits have been detected.
$!
$ else
$!
$    type sys$input
                         **************************
                         *  SSL TOOLKIT DETECTED  *
                         **************************

A supported Secure Sockets Layer (SSL) toolkit has been detected.
$!
$ endif
$!
$ type sys$input
Those with item numbers are available for building, 'x's are not available.

  0. do not build an SSL version
$ count = 0
$ defaultResponse = 1
$!
$ if openSSLdir .nes. ""
$ then
$    count = count + 1
$    toolkit'count' = openSSLdir
$    say "  ''count'. OpenSSL (prior to v1.1.0) toolkit"
$ else
$    say "  x. OpenSSL (prior to v1.1.0) toolkit"
$ endif
$!
$ if OSSLdir .nes. ""
$ then
$    count = count + 1
$    toolkit'count' = OSSLdir
$    say "  ''count'. OpenSSL (v1.1.0 or later) toolkit OBJECT link"
$    count = count + 1
$    toolkit'count' = OSSLdir + "SHR"
$    say "  ''count'. OpenSSL (v1.1.0 or later) toolkit SHAREABLE IMAGE link"
$ else
$    say "  x. OpenSSL (v1.1.0 or later) toolkit"
$ endif
$!
$ if vmsSSL1dir .nes. ""
$ then
$    count = count + 1
$    toolkit'count' = vmsSSL1dir
$    defaultResponse = count
$    say "  ''count'. OpenVMS SSL1 product (HP)"
$ else
$    say "  x. OpenVMS SSL1 product (HP)"
$ endif
$!
$ if vmsSSL111dir .nes. ""
$ then
$    count = count + 1
$    toolkit'count' = vmsSSL111dir
$    defaultResponse = count
$    say "  ''count'. OpenVMS SSL111 product (VSI)"
$ else
$    say "  x. OpenVMS SSL111 product (VSI)"
$ endif
$!
$ if wasdSSLdir .nes. ""
$ then
$    count = count + 1
$    toolkit'count' = wasdSSLdir
$    say "  ''count'. WASD OpenSSL ''wasdVersion' package"
$ else
$    say "  x. WASD OpenSSL package"
$ endif
$!
$ if vmsSSLdir .nes. "" -
     then say "  x. OpenVMS SSL product (HP) no longer supported"
$!
$ toolkitLoop:
$    response = ""
$    say ""
$    read sys$command response /prompt="Select item number [''defaultResponse']: "
$    say ""
$    if response .eqs. "" then response = defaultResponse
$    number = f$integer(response)
$    if number .lt. 0 .or. number .gt. count
$    then
$       say "RESPONSE ERROR! (enter a single digit 0 to ''count')"
$       goto toolkitLoop
$    endif
$ toolkitLoopEnd:
$!
$ if number .eq. 0
$ then
$    say "A non-SSL version of the server will be built."
$    say ""
$    exit
$ endif
$!
$ if toolkit'number' .eqs. openSSLdir
$ then
$    say "The OpenSSL (prior to v1.1.0) toolkit has been selected."
$    say ""
$    BUILD_HTTPD_SSL == 1
$    BUILD_HTTPD_OPEN_SSL == 1
$    DEMO_SSL == 1
$    exit
$ endif
$!
$ if toolkit'number' .eqs. OSSLdir
$ then
$    say "The OpenSSL (v1.1.0 or later) OBJECT link has been selected."
$    say ""
$    BUILD_HTTPD_SSL == 1
$    BUILD_HTTPD_OSSL == 1
$    DEMO_SSL == 1
$    exit
$ endif
$!
$ if toolkit'number' .eqs. (OSSLdir + "SHR")
$ then
$    say "The OpenSSL (v1.1.0 or later) SHAREABLE IMAGE has been selected."
$    say ""
$    BUILD_HTTPD_SSL == 1
$    BUILD_HTTPD_OSSLSHR == 1
$    DEMO_SSL == 1
$    exit
$ endif
$!
$ if toolkit'number' .eqs. vmsSSL1dir
$ then
$    type sys$input
The VMS SSL1 product has been selected.
$    product show product ssl1
$    type sys$input

NOTE:  As WASD installs it's server image with required privileges the OpenVMS
SSL shareable images also be installed (but without extended privileges).
Using this product requires the v8.1 or later startup procedures.

$    read sys$command response /prompt="Press RETURN to continue: "
$    say ""
$    BUILD_HTTPD_SSL == 1
$    BUILD_HTTPD_VMS_SSL1 == 1
$    DEMO_SSL == 1
$    exit
$ endif
$!
$ if toolkit'number' .eqs. vmsSSL111dir
$ then
$    type sys$input
The VMS SSL111 product has been selected.
$    product show product ssl111
$    read sys$command response /prompt="Press RETURN to continue: "
$    say ""
$    BUILD_HTTPD_SSL == 1
$    BUILD_HTTPD_VMS_SSL111 == 1
$    DEMO_SSL == 1
$    exit
$ endif
$!
$ if toolkit'number' .eqs. wasdSSLdir
$ then
$    say "The WASD OpenSSL ''wasdVersion' package has been selected."
$    say ""
$    BUILD_HTTPD_SSL == 1
$    BUILD_HTTPD_WASD_SSL == 1
$    DEMO_SSL == 1
$!   (this symbol will be used by SSL_FINISH.COM to build the OpenSSL apps)
$    BUILD_HTTPD_SSL_ROOT == wasdSSLdir
$    exit
$ endif
$!
$ exit ss$_bugcheck
$!-----------------------------------------------------------------------------