Browse Source

NonStop port updates for 3.0.0.

HPE NonStop Port Changes for 3.0.0  Includes unthreaded, PUT, and SPT for OSS.

The port changes include wrapping where necessary for FLOSS and
appropriate configuration changes to support that. Two tests
are excluded as being inappropriate for the platform.

The changes are:
* Added /usr/local/include to nonstop-nsx_spt_floss to load floss.h
* Added SPT Floss variant for NonStop
* Wrapped FLOSS definitions in OPENSSL_TANDEM_FLOSS to allow selective enablement.
* SPT build configuration for NonStop
* Skip tests not relevant for NonStop
* PUT configuration changes required for NonStop platforms
* Configurations/50-nonstop.conf: updates for TNS/X platform.
* FLOSS instrumentation for HPE NonStop TNS/X and TNS/E platforms.
* Configurations/50-nonstop.conf: modifications for non-PUT TNS/E platform b
* Fix use of DELAY in ssltestlib.c for HPNS.
* Fixed commit merge issues and added floss to http_server.c

CLA: Permission is granted by the author to the OpenSSL team to use these modifications.
Fixes #5087.

Signed-off-by: Randall S. Becker <rsbecker@nexbridge.com>

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/12800)
master
Randall S. Becker 2 years ago
committed by Richard Levitte
parent
commit
08073700cc
26 changed files with 497 additions and 5 deletions
  1. +176
    -0
      Configurations/50-nonstop.conf
  2. +42
    -0
      NOTES.HPNS
  3. +1
    -1
      apps/ca.c
  4. +20
    -0
      apps/lib/apps.c
  5. +6
    -0
      apps/lib/http_server.c
  6. +6
    -0
      apps/lib/s_socket.c
  7. +6
    -0
      apps/ocsp.c
  8. +4
    -0
      apps/provider.c
  9. +6
    -0
      apps/speed.c
  10. +13
    -0
      apps/version.c
  11. +7
    -1
      crypto/bio/b_sock.c
  12. +3
    -0
      crypto/conf/conf_def.c
  13. +12
    -0
      crypto/cryptlib.c
  14. +1
    -1
      crypto/dso/dso_dlfcn.c
  15. +70
    -0
      crypto/rand/rand_egd.c
  16. +5
    -1
      crypto/threads_pthread.c
  17. +58
    -0
      e_os.h
  18. +4
    -0
      include/internal/cryptlib.h
  19. +11
    -0
      include/internal/sockets.h
  20. +7
    -1
      include/openssl/crypto.h
  21. +15
    -0
      include/openssl/e_os2.h
  22. +13
    -0
      ssl/ssl_lib.c
  23. +3
    -0
      test/bntest.c
  24. +5
    -0
      test/drbgtest.c
  25. +2
    -0
      test/recipes/01-test_symbol_presence.t
  26. +1
    -0
      test/recipes/90-test_shlibload.t

+ 176
- 0
Configurations/50-nonstop.conf View File

@ -0,0 +1,176 @@
#### Nonstop configurations
"nonstop-common" => {
inherit_from => [ "BASE_unix" ],
template => 1,
cc => "c99",
cflags => add_before(picker(debug => "-g -O0",
release => "-g -O2") ,"-Wextensions -Wnowarn=203,220,272,734,770,1506 -Wbuild_neutral_library"),
perl => "/usr/bin/perl",
lflags => "-lrld",
shared_target => "self",
shared_cflag => "",
shared_ldflag => "-Wshared",
shared_extension => ".so",
enable => ["egd"],
dso_scheme => "DLFCN",
},
"nonstop-nsx" => {
inherit_from => [ "nonstop-common" ],
cflags => sub { join(" ",@_,"-Wverbose -I/usr/local/include") },
shared_cflag => sub { join(" ",@_,"-Wverbose -I/usr/local/include") },
lflags => sub { join(" ",@_,"-lfloss -Wxld='-set floattype neutral_float' -Wsystype=oss") },
shared_ldflag => sub { join(" ",@_,"-lfloss -Wxld='-export_all -set floattype neutral_float -set systype oss' -Wsystype=oss") },
defines => ["OPENSSL_VPROC=\$(OPENSSL_VPROC)","_XOPEN_SOURCE","_XOPEN_SOURCE_EXTENDED=1","B_ENDIAN", "OPENSSL_SYSNAME_TANDEM", "OPENSSL_TANDEM_FLOSS"],
disable => ["threads"],
bn_ops => "THIRTY_TWO_BIT",
},
"nonstop-nsx_put" => {
inherit_from => [ "nonstop-common" ],
cflags => sub { join(" ",@_,"-Wverbose") },
shared_cflag => sub { join(" ",@_,"-Wverbose") },
lflags => sub { join(" ",@_,"-lput") },
shared_ldflag => sub { join(" ",@_,"-Wxld='-export_all -set floattype neutral_float -set systype oss' -lput -Wsystype=oss") },
defines => ["OPENSSL_VPROC=\$(OPENSSL_VPROC)","_REENTRANT", "_PUT_MODEL_","_XOPEN_SOURCE","_XOPEN_SOURCE_EXTENDED=1","_ENABLE_FLOSS_THREADS", "B_ENDIAN", "OPENSSL_SYSNAME_TANDEM"],
bn_ops => "THIRTY_TWO_BIT",
},
"nonstop-nsx_64" => {
inherit_from => [ "nonstop-common" ],
cflags => sub { join(" ",@_,"-Wlp64 -Wverbose") },
shared_cflag => sub { join(" ",@_,"-Wlp64 -Wverbose") },
lflags => sub { join(" ",@_,"-lfloss -Wlp64") },
shared_ldflag => sub { join(" ",@_,"-lfloss -Wxld='-export_all -set data_model lp64 -set floattype neutral_float -set systype oss' -Wlp64 -Wsystype=oss") },
defines => ["OPENSSL_VPROC=\$(OPENSSL_VPROC)","_XOPEN_SOURCE","_XOPEN_SOURCE_EXTENDED=1", "B_ENDIAN", "OPENSSL_SYSNAME_TANDEM", "OPENSSL_TANDEM_FLOSS"],
disable => ["threads"],
bn_ops => "SIXTY_FOUR_BIT",
},
"nonstop-nsx_64_put" => {
inherit_from => [ "nonstop-common" ],
shared_cflag => sub { join(" ",@_,"-Wlp64 -Wverbose -Wtarget=tns/x") },
cflags => sub { join(" ",@_,"-Wlp64 -Wverbose -Wtarget=tns/x") },
lflags => sub { join(" ",@_,"-Wxld='-set floattype neutral_float -set systype oss' -Wlp64 -lput -Wsystype=oss") },
shared_ldflag => sub { join(" ",@_,"-Wxld='-export_all -set data_model lp64'") },
defines => ["OPENSSL_VPROC=\$(OPENSSL_VPROC)","_REENTRANT", "_PUT_MODEL_","_TANDEM_ARCH=3","_XOPEN_SOURCE","_XOPEN_SOURCE_EXTENDED=1","_ENABLE_FLOSS_THREADS","__TANDEM", "_TANDEM_SOURCE", "B_ENDIAN", "OPENSSL_SYSNAME_TANDEM"],
bn_ops => "SIXTY_FOUR_BIT",
},
"nonstop-nsx_spt" => {
inherit_from => [ "nonstop-common" ],
cflags => sub { join(" ",@_,"-Wverbose -Wtarget=tns/x") },
shared_cflag => sub { join(" ",@_,"-Wverbose -Wtarget=tns/x") },
lflags => sub { join(" ",@_,"-lspt -Wextensions") },
shared_ldflag => sub { join(" ",@_,"-Wxld='-export_all -set floattype neutral_float -set systype oss' -lspt -Wextensions -Wsystype=oss") },
defines => ["OPENSSL_VPROC=\$(OPENSSL_VPROC)","_REENTRANT", "_SPT_MODEL_","_THREAD_SUPPORT_FUNCTIONS","_XOPEN_SOURCE","_XOPEN_SOURCE_EXTENDED=1","_TANDEM_SOURCE", "B_ENDIAN", "OPENSSL_SYSNAME_TANDEM"],
bn_ops => "THIRTY_TWO_BIT",
},
"nonstop-nsx_spt_floss" => {
inherit_from => [ "nonstop-common" ],
cflags => sub { join(" ",@_,"-I/usr/local/include -Wverbose -Wtarget=tns/x") },
shared_cflag => sub { join(" ",@_,"-I/usr/local/include -Wverbose -Wtarget=tns/x") },
lflags => sub { join(" ",@_,"-lfloss -lspt -Wextensions") },
shared_ldflag => sub { join(" ",@_,"-lfloss -Wxld='-export_all -set floattype neutral_float -set systype oss' -lspt -Wextensions -Wsystype=oss") },
defines => ["OPENSSL_VPROC=\$(OPENSSL_VPROC)","_REENTRANT", "_SPT_MODEL_","_THREAD_SUPPORT_FUNCTIONS","_XOPEN_SOURCE","_XOPEN_SOURCE_EXTENDED=1","_TANDEM_SOURCE", "B_ENDIAN", "OPENSSL_SYSNAME_TANDEM","OPENSSL_TANDEM_FLOSS"],
bn_ops => "THIRTY_TWO_BIT",
},
"nonstop-nsx_g" => {
inherit_from => [ "nonstop-common" ],
cflags => sub { join(" ",@_,"-Wverbose -Wtarget=tns/x") },
shared_cflag => sub { join(" ",@_,"-Wverbose -Wtarget=tns/x") },
lflags => sub { join(" ",@_,"-Wsystype=guardian -Wxld='-set systype guardian -set floattype neutral_float'") },
shared_ldflag => sub { join(" ",@_,"-Wxld='-export_all -set floattype neutral_float -soname \$\(\@:lib%.so=%\) -set systype guardian' -Wsystype=guardian") },
#shared_extension => " ",
defines => ["OPENSSL_VPROC=\$(OPENSSL_VPROC)","_XOPEN_SOURCE","_XOPEN_SOURCE_EXTENDED=1", "_TANDEM_SOURCE", "B_ENDIAN", "OPENSSL_SYSNAME_TANDEM", "NO_GETPID"],
disable => ["threads"],
bn_ops => "THIRTY_TWO_BIT",
},
"nonstop-nsx_g_tandem" => {
inherit_from => [ "nonstop-common" ],
cflags => sub { join(" ",@_,"-Wverbose -Wtarget=tns/x") },
shared_cflag => sub { join(" ",@_,"-Wverbose -Wtarget=tns/x") },
lflags => sub { join(" ",@_,"-Wsystype=guardian -Wxld='-set systype guardian -set floattype tandem_float'") },
shared_ldflag => sub { join(" ",@_,"-Wxld='-export_all -set floattype tandem_float -soname \$\(\@:lib%.so=%\) -set systype guardian' -Wsystype=guardian") },
#shared_extension => " ",
defines => ["OPENSSL_VPROC=\$(OPENSSL_VPROC)","_XOPEN_SOURCE","_XOPEN_SOURCE_EXTENDED=1", "_TANDEM_SOURCE", "B_ENDIAN", "OPENSSL_SYSNAME_TANDEM", "NO_GETPID"],
disable => ["threads"],
bn_ops => "THIRTY_TWO_BIT",
},
"nonstop-nsv" => {
inherit_from => [ "nonstop-nsx" ],
},
"nonstop-nse" => {
inherit_from => [ "nonstop-common" ],
cflags => sub { join(" ",@_,"-Wverbose -Wtarget=tns/e -I/usr/local/include") },
shared_cflag => sub { join(" ",@_,"-Wverbose -Wtarget=tns/e -I/usr/local/include") },
lflags => sub { join(" ",@_,"-lfloss") },
shared_ldflag => sub { join(" ",@_,"-lfloss -Weld='-export_all -set floattype neutral_float -set systype oss' -Wsystype=oss") },
defines => ["OPENSSL_VPROC=\$(OPENSSL_VPROC)","_TANDEM_ARCH=2","_XOPEN_SOURCE","_XOPEN_SOURCE_EXTENDED=1","__TANDEM", "_TANDEM_SOURCE", "B_ENDIAN", "OPENSSL_SYSNAME_TANDEM", "OPENSSL_TANDEM_FLOSS"],
disable => ["threads"],
bn_ops => "THIRTY_TWO_BIT",
},
"nonstop-nse_put" => {
inherit_from => [ "nonstop-common" ],
cflags => sub { join(" ",@_,"-Wverbose -Wtarget=tns/e") },
shared_cflag => sub { join(" ",@_,"-Wverbose -Wtarget=tns/e") },
lflags => sub { join(" ",@_,"-lput") },
shared_ldflag => sub { join(" ",@_,"-Weld='-export_all -set floattype neutral_float -set systype oss' -lput -Wsystype=oss") },
defines => ["OPENSSL_VPROC=\$(OPENSSL_VPROC)","_REENTRANT", "_PUT_MODEL_","_XOPEN_SOURCE","_XOPEN_SOURCE_EXTENDED=1","_ENABLE_FLOSS_THREADS", "_TANDEM_SOURCE", "B_ENDIAN", "OPENSSL_SYSNAME_TANDEM"],
bn_ops => "THIRTY_TWO_BIT",
},
"nonstop-nse_64" => {
inherit_from => [ "nonstop-common" ],
cflags => sub { join(" ",@_,"-Wlp64 -Wverbose -Wtarget=tns/e") },
shared_cflag => sub { join(" ",@_,"-Wlp64 -Wverbose -Wtarget=tns/e") },
lflags => sub { join(" ",@_,"-lfloss -Wlp64") },
shared_ldflag => sub { join(" ",@_,"-lfloss -Weld='-export_all -set data_model lp64 -set floattype neutral_float -set systype oss' -Wlp64 -Wsystype=oss") },
defines => ["OPENSSL_VPROC=\$(OPENSSL_VPROC)","_XOPEN_SOURCE","_XOPEN_SOURCE_EXTENDED=1","_TANDEM_SOURCE", "B_ENDIAN", "OPENSSL_SYSNAME_TANDEM", "OPENSSL_TANDEM_FLOSS"],
disable => ["threads"],
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR",
},
"nonstop-nse_64_put" => {
inherit_from => [ "nonstop-common" ],
cflags => sub { join(" ",@_,"-Wlp64 -Wverbose -Wtarget=tns/e") },
shared_cflag => sub { join(" ",@_,"-Wlp64 -Wverbose -Wtarget=tns/e") },
lflags => sub { join(" ",@_,"-lput -Wlp64") },
shared_ldflag => sub { join(" ",@_,"-Weld='-export_all -set data_model lp64 -set floattype neutral_float -set systype oss' -Wlp64 -lput -Wsystype=oss") },
defines => ["OPENSSL_VPROC=\$(OPENSSL_VPROC)","_REENTRANT", "_PUT_MODEL_","_XOPEN_SOURCE","_XOPEN_SOURCE_EXTENDED=1","_ENABLE_FLOSS_THREADS", "_TANDEM_SOURCE", "B_ENDIAN", "OPENSSL_SYSNAME_TANDEM"],
bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR",
},
"nonstop-nse_spt" => {
inherit_from => [ "nonstop-common" ],
cflags => sub { join(" ",@_,"-Wverbose -Wtarget=tns/e") },
shared_cflag => sub { join(" ",@_,"-Wverbose -Wtarget=tns/e") },
lflags => sub { join(" ",@_,"-lspt -Wextensions") },
shared_ldflag => sub { join(" ",@_,"-Weld='-export_all -set floattype neutral_float -set systype oss' -lspt -Wextensions -Wsystype=oss") },
defines => ["OPENSSL_VPROC=\$(OPENSSL_VPROC)","_REENTRANT", "_SPT_MODEL_","_THREAD_SUPPORT_FUNCTIONS","_XOPEN_SOURCE","_XOPEN_SOURCE_EXTENDED=1", "_TANDEM_SOURCE", "B_ENDIAN", "OPENSSL_SYSNAME_TANDEM"],
bn_ops => "THIRTY_TWO_BIT",
},
"nonstop-nse_spt_floss" => {
inherit_from => [ "nonstop-common" ],
cflags => sub { join(" ",@_,"-Wverbose -Wtarget=tns/e") },
shared_cflag => sub { join(" ",@_,"-Wverbose -Wtarget=tns/e") },
lflags => sub { join(" ",@_,"-lfloss -lspt -Wextensions") },
shared_ldflag => sub { join(" ",@_,"-lfloss -Weld='-export_all -set floattype neutral_float -set systype oss' -lspt -Wextensions -Wsystype=oss") },
defines => ["OPENSSL_VPROC=\$(OPENSSL_VPROC)","_REENTRANT", "_SPT_MODEL_","_THREAD_SUPPORT_FUNCTIONS","_XOPEN_SOURCE","_XOPEN_SOURCE_EXTENDED=1", "_TANDEM_SOURCE", "B_ENDIAN", "OPENSSL_SYSNAME_TANDEM", "OPENSSL_TANDEM_FLOSS"],
bn_ops => "THIRTY_TWO_BIT",
},
"nonstop-nse_g" => {
inherit_from => [ "nonstop-common" ],
cflags => sub { join(" ",@_,"-Wverbose -Wtarget=tns/e") },
shared_cflag => sub { join(" ",@_,"-Wverbose -Wtarget=tns/e") },
lflags => sub { join(" ",@_,"-Wsystype=guardian -Weld='-set systype guardian'") },
shared_ldflag => sub { join(" ",@_,"-Weld='-set systype guardian -export_all -set floattype neutral_float -soname \$\(\@:lib%.so=%\)' -Wsystype=guardian") },
#shared_extension => " ",
defines => ["OPENSSL_VPROC=\$(OPENSSL_VPROC)","_XOPEN_SOURCE","_XOPEN_SOURCE_EXTENDED=1", "_TANDEM_SOURCE", "B_ENDIAN", "OPENSSL_SYSNAME_TANDEM", "NO_GETPID"],
disable => ["threads"],
bn_ops => "THIRTY_TWO_BIT",
},
"nonstop-nse_g_tandem" => {
inherit_from => [ "nonstop-common" ],
cflags => sub { join(" ",@_,"-Wverbose -Wtarget=tns/e") },
shared_cflag => sub { join(" ",@_,"-Wverbose -Wtarget=tns/e") },
lflags => sub { join(" ",@_,"-Wsystype=guardian -Weld='-set systype guardian -set floattype tandem_float'") },
shared_ldflag => sub { join(" ",@_,"-Wsystype=guardian -Weld='-set systype guardian -export_all -set floattype tandem_float -soname \$\(\@:lib%.so=%\)'") },
#shared_extension => " ",
defines => ["OPENSSL_VPROC=\$(OPENSSL_VPROC)","_XOPEN_SOURCE","_XOPEN_SOURCE_EXTENDED=1", "_TANDEM_SOURCE", "B_ENDIAN", "OPENSSL_SYSNAME_TANDEM", "NO_GETPID"],
disable => ["threads"],
bn_ops => "THIRTY_TWO_BIT",
},

+ 42
- 0
NOTES.HPNS View File

@ -0,0 +1,42 @@
## Probably have to be set:
# COMP_ROOT=$(cygpath -w /path/to/comp_rooot) # must be path format for system (ie windows)
# CC=/path/to/c99 # must be executable by shell
## Optionally
# DBGFLAG="--debug"
# CIPHENABLES="enable-ssl3 enable-ssl3-method enable-weak-ssl-ciphers enable-rc4"
# onplatform cross compile (nsx->nsi): SYSTEMLIBS="-L/E/cs3/usr/local/lib"
## VPROC
## For Itanium:
# OPENSSL_VPROC_PREFIX=T0085H06
## For X86:
# OPENSSL_VPROC_PREFIX=T0085L01
# export OPENSSL_VPROC=${OPENSSL_VPROC_PREFIX}_$(cat include/openssl/opensslv.h |\
# sed -n -e 's/^ *# *define *OPENSSL_VERSION_TEXT[^"]*"\([^"]*\)"/\1/p' |\
# sed -e 's/[. ]/_/g' -e 's/[.-]/_/g' |\
# grep -v fips \
# )
## Current Configure targets
# Guardian targets' libraries will have so-names 'ssl' and 'crypto'
./Configure nonstop-nsx --prefix=${PWD}/install --openssldir=${PWD}/install no-dynamic-engine no-threads --with-rand-seed=egd ${CIPHENABLES} ${DBGFLAG} ${SYSTEMLIBS}
./Configure nonstop-nsx_g --prefix=${PWD}/install --openssldir=${PWD}/install no-dynamic-engine no-threads --with-rand-seed=egd ${CIPHENABLES} ${DBGFLAG} ${SYSTEMLIBS}
./Configure nonstop-nsx_put --prefix=${PWD}/install --openssldir=${PWD}/install no-dynamic-engine threads "-D_REENTRANT" --with-rand-seed=egd ${CIPHENABLES} ${DBGFLAG} ${SYSTEMLIBS}
./Configure nonstop-nsx_spt --prefix=${PWD}/install --openssldir=${PWD}/install no-dynamic-engine threads "-D_REENTRANT" --with-rand-seed=egd ${CIPHENABLES} ${DBGFLAG} ${SYSTEMLIBS}
./Configure nonstop-nsx_64 --prefix=${PWD}/install --openssldir=${PWD}/install no-dynamic-engine no-threads --with-rand-seed=egd ${CIPHENABLES} ${DBGFLAG} ${SYSTEMLIBS}
./Configure nonstop-nsx_64_put --prefix=${PWD}/install --openssldir=${PWD}/install no-dynamic-engine threads "-D_REENTRANT" --with-rand-seed=egd ${CIPHENABLES} ${DBGFLAG} ${SYSTEMLIBS}
./Configure nonstop-nsx_g_tandem --prefix=${PWD}/install --openssldir=${PWD}/install no-dynamic-engine no-threads --with-rand-seed=egd ${CIPHENABLES} ${DBGFLAG} ${SYSTEMLIBS}
./Configure nonstop-nse --prefix=${PWD}/install --openssldir=${PWD}/install no-dynamic-engine no-threads --with-rand-seed=egd ${CIPHENABLES} ${DBGFLAG} ${SYSTEMLIBS}
./Configure nonstop-nse_g --prefix=${PWD}/install --openssldir=${PWD}/install no-dynamic-engine no-threads --with-rand-seed=egd ${CIPHENABLES} ${DBGFLAG} ${SYSTEMLIBS}
./Configure nonstop-nse_put --prefix=${PWD}/install --openssldir=${PWD}/install no-dynamic-engine threads "-D_REENTRANT" --with-rand-seed=egd ${CIPHENABLES} ${DBGFLAG} ${SYSTEMLIBS}
./Configure nonstop-nse_spt --prefix=${PWD}/install --openssldir=${PWD}/install no-dynamic-engine threads "-D_REENTRANT" --with-rand-seed=egd ${CIPHENABLES} ${DBGFLAG} ${SYSTEMLIBS}
./Configure nonstop-nse_64 --prefix=${PWD}/install --openssldir=${PWD}/install no-dynamic-engine no-threads --with-rand-seed=egd ${CIPHENABLES} ${DBGFLAG} ${SYSTEMLIBS}
./Configure nonstop-nse_64_put --prefix=${PWD}/install --openssldir=${PWD}/install no-dynamic-engine threads "-D_REENTRANT" --with-rand-seed=egd ${CIPHENABLES} ${DBGFLAG} ${SYSTEMLIBS}
./Configure nonstop-nse_g_tandem --prefix=${PWD}/install --openssldir=${PWD}/install no-dynamic-engine no-threads --with-rand-seed=egd ${CIPHENABLES} ${DBGFLAG} ${SYSTEMLIBS}
## Build loop:
# Configure <...>
# Make
# ...
# Make install

+ 1
- 1
apps/ca.c View File

@ -26,7 +26,7 @@
#ifndef W_OK
# ifdef OPENSSL_SYS_VMS
# include <unistd.h>
# elif !defined(OPENSSL_SYS_VXWORKS) && !defined(OPENSSL_SYS_WINDOWS)
# elif !defined(OPENSSL_SYS_VXWORKS) && !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYSNAME_TANDEM)
# include <sys/file.h>
# endif
#endif


+ 20
- 0
apps/lib/apps.c View File

@ -2399,6 +2399,11 @@ int raw_read_stdin(void *buf, int siz)
return recv(fileno_stdin(), buf, siz, 0);
}
#else
# if defined(__TANDEM)
# if defined(OPENSSL_TANDEM_FLOSS)
# include <floss.h(floss_read)>
# endif
# endif
int raw_read_stdin(void *buf, int siz)
{
return read(fileno_stdin(), buf, siz);
@ -2414,7 +2419,22 @@ int raw_write_stdout(const void *buf, int siz)
else
return -1;
}
#elif defined(OPENSSL_SYSNAME_TANDEM) && defined(OPENSSL_THREADS) && defined(_SPT_MODEL_)
# if defined(__TANDEM)
# if defined(OPENSSL_TANDEM_FLOSS)
# include <floss.h(floss_write)>
# endif
# endif
int raw_write_stdout(const void *buf,int siz)
{
return write(fileno(stdout),(void*)buf,siz);
}
#else
# if defined(__TANDEM)
# if defined(OPENSSL_TANDEM_FLOSS)
# include <floss.h(floss_write)>
# endif
# endif
int raw_write_stdout(const void *buf, int siz)
{
return write(fileno_stdout(), buf, siz);


+ 6
- 0
apps/lib/http_server.c View File

@ -24,6 +24,12 @@
#include <openssl/err.h>
#include <openssl/rand.h>
#if defined(__TANDEM)
# if defined(OPENSSL_TANDEM_FLOSS)
# include <floss.h(floss_fork)>
# endif
#endif
int multi = 0; /* run multiple responder processes */
#ifdef HTTP_DAEMON


+ 6
- 0
apps/lib/s_socket.c View File

@ -32,6 +32,12 @@ typedef unsigned int u_int;
# include "s_apps.h"
# include "internal/sockets.h"
# if defined(__TANDEM)
# if defined(OPENSSL_TANDEM_FLOSS)
# include <floss.h(floss_read)>
# endif
# endif
# include <openssl/bio.h>
# include <openssl/err.h>


+ 6
- 0
apps/ocsp.c View File

@ -38,6 +38,12 @@ DEFINE_STACK_OF(CONF_VALUE)
DEFINE_STACK_OF(X509)
DEFINE_STACK_OF_STRING()
#if defined(__TANDEM)
# if defined(OPENSSL_TANDEM_FLOSS)
# include <floss.h(floss_fork)>
# endif
#endif
#if defined(OPENSSL_SYS_VXWORKS)
/* not supported */
int setpgid(pid_t pid, pid_t pgid)


+ 4
- 0
apps/provider.c View File

@ -20,6 +20,10 @@
#include <openssl/core.h>
#include <openssl/core_dispatch.h>
#ifdef __TANDEM
# include <string.h> /* memset */
#endif
DEFINE_STACK_OF_CSTRING()
typedef enum OPTION_choice {


+ 6
- 0
apps/speed.c View File

@ -37,6 +37,12 @@
# include <unistd.h>
#endif
#if defined(__TANDEM)
# if defined(OPENSSL_TANDEM_FLOSS)
# include <floss.h(floss_fork)>
# endif
#endif
#if defined(_WIN32)
# include <windows.h>
#endif


+ 13
- 0
apps/version.c View File

@ -134,3 +134,16 @@ opthelp:
end:
return ret;
}
#if defined(__TANDEM) && defined(OPENSSL_VPROC)
/*
* Define a VPROC function for the openssl program.
* This is used by platform version identification tools.
* Do not inline this procedure or make it static.
*/
# define OPENSSL_VPROC_STRING_(x) x##_OPENSSL
# define OPENSSL_VPROC_STRING(x) OPENSSL_VPROC_STRING_(x)
# define OPENSSL_VPROC_FUNC OPENSSL_VPROC_STRING(OPENSSL_VPROC)
void OPENSSL_VPROC_FUNC(void) {}
#endif

+ 7
- 1
crypto/bio/b_sock.c View File

@ -23,7 +23,13 @@
static int wsa_init_done = 0;
# endif
# ifndef _WIN32
# if defined __TANDEM
# include <unistd.h>
# include <sys/time.h> /* select */
# if defined(OPENSSL_TANDEM_FLOSS)
# include <floss.h(floss_select)>
# endif
# elif !defined _WIN32
# include <unistd.h>
# include <sys/select.h>
# else


+ 3
- 0
crypto/conf/conf_def.c View File

@ -11,6 +11,9 @@
#include <stdio.h>
#include <string.h>
#ifdef __TANDEM
# include <strings.h> /* strcasecmp */
#endif
#include "internal/cryptlib.h"
#include "internal/o_dir.h"
#include <openssl/lhash.h>


+ 12
- 0
crypto/cryptlib.c View File

@ -471,3 +471,15 @@ size_t OPENSSL_instrument_bus2(unsigned int *out, size_t cnt, size_t max)
return 0;
}
#endif
#if defined(__TANDEM) && defined(OPENSSL_VPROC)
/*
* Define a VPROC function for HP NonStop build crypto library.
* This is used by platform version identification tools.
* Do not inline this procedure or make it static.
*/
# define OPENSSL_VPROC_STRING_(x) x##_CRYPTO
# define OPENSSL_VPROC_STRING(x) OPENSSL_VPROC_STRING_(x)
# define OPENSSL_VPROC_FUNC OPENSSL_VPROC_STRING(OPENSSL_VPROC)
void OPENSSL_VPROC_FUNC(void) {}
#endif /* __TANDEM */

+ 1
- 1
crypto/dso/dso_dlfcn.c View File

@ -32,7 +32,7 @@ DEFINE_STACK_OF(void)
# if defined(__SCO_VERSION__) || defined(_SCO_ELF) || \
(defined(__osf__) && !defined(RTLD_NEXT)) || \
(defined(__OpenBSD__) && !defined(RTLD_SELF)) || \
defined(__ANDROID__)
defined(__ANDROID__) || defined(__TANDEM)
# undef HAVE_DLINFO
# endif
# endif


+ 70
- 0
crypto/rand/rand_egd.c View File

@ -54,6 +54,60 @@ struct sockaddr_un {
# include <string.h>
# include <errno.h>
# if defined(OPENSSL_SYSNAME_TANDEM)
/*
* HPNS:
*
* Our current MQ 5.3 EGD requies compatability-mode sockets
* This code forces the mode to compatibility if required
* and then restores the mode.
*
* Needs review:
*
* The better long-term solution is to either run two EGD's each in one of
* the two modes or revise the EGD code to listen on two different sockets
* (each in one of the two modes).
*/
_variable
int hpns_socket(int family,
int type,
int protocol,
char* transport)
{
int socket_rc;
char current_transport[20];
# define AF_UNIX_PORTABILITY "$ZAFN2"
# define AF_UNIX_COMPATIBILITY "$ZPLS"
if (!_arg_present(transport) || transport != NULL || transport[0] == '\0')
return socket(family, type, protocol);
socket_transport_name_get(AF_UNIX, current_transport, 20);
if (strcmp(current_transport,transport) == 0)
return socket(family, type, protocol);
/* set the requested socket transport */
if (socket_transport_name_set(AF_UNIX, transport))
return -1;
socket_rc = socket(family,type,protocol);
/* set mode back to what it was */
if (socket_transport_name_set(AF_UNIX, current_transport))
return -1;
return socket_rc;
}
/*#define socket(a,b,c,...) hpns_socket(a,b,c,__VA_ARGS__) */
static int hpns_connect_attempt = 0;
# endif /* defined(OPENSSL_SYS_HPNS) */
int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes)
{
FILE *fp = NULL;
@ -71,7 +125,11 @@ int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes)
return -1;
strcpy(addr.sun_path, path);
i = offsetof(struct sockaddr_un, sun_path) + strlen(path);
#if defined(OPENSSL_SYSNAME_TANDEM)
fd = hpns_socket(AF_UNIX, SOCK_STREAM, 0, AF_UNIX_COMPATIBILITY);
#else
fd = socket(AF_UNIX, SOCK_STREAM, 0);
#endif
if (fd == -1 || (fp = fdopen(fd, "r+")) == NULL)
return -1;
setbuf(fp, NULL);
@ -100,6 +158,18 @@ int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes)
/* No error, try again */
break;
default:
# if defined(OPENSSL_SYSNAME_TANDEM)
if (hpns_connect_attempt == 0) {
/* try the other kind of AF_UNIX socket */
close(fd);
fd = hpns_socket(AF_UNIX, SOCK_STREAM, 0, AF_UNIX_PORTABILITY);
if (fd == -1)
return -1;
++hpns_connect_attempt;
break; /* try the connect again */
}
# endif
ret = -1;
goto err;
}


+ 5
- 1
crypto/threads_pthread.c View File

@ -49,7 +49,11 @@ CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void)
}
pthread_mutexattr_init(&attr);
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
#if defined(__TANDEM) && defined(_SPT_MODEL_)
pthread_mutexattr_setkind_np(&attr,MUTEX_RECURSIVE_NP);
#else
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
#endif
if (pthread_mutex_init(lock, &attr) != 0) {
pthread_mutexattr_destroy(&attr);


+ 58
- 0
e_os.h View File

@ -295,6 +295,64 @@ struct servent *getservbyname(const char *name, const char *proto);
# endif
/* end vxworks */
/* ----------------------------- HP NonStop -------------------------------- */
/* Required to support platform variant without getpid() and pid_t. */
# ifdef __TANDEM
# include <strings.h>
# include <netdb.h>
# define getservbyname(name,proto) getservbyname((char*)name,proto)
# define gethostbyname(name) gethostbyname((char*)name)
# define ioctlsocket(a,b,c) ioctl(a,b,c)
# ifdef NO_GETPID
inline int nssgetpid();
# ifndef NSSGETPID_MACRO
# define NSSGETPID_MACRO
# include <cextdecs.h(PROCESSHANDLE_GETMINE_)>
# include <cextdecs.h(PROCESSHANDLE_DECOMPOSE_)>
inline int nssgetpid()
{
short phandle[10]={0};
union pseudo_pid {
struct {
short cpu;
short pin;
} cpu_pin ;
int ppid;
} ppid = { 0 };
PROCESSHANDLE_GETMINE_(phandle);
PROCESSHANDLE_DECOMPOSE_(phandle, &ppid.cpu_pin.cpu, &ppid.cpu_pin.pin);
return ppid.ppid;
}
# define getpid(a) nssgetpid(a)
# endif /* NSSGETPID_MACRO */
# endif /* NO_GETPID */
/*# define setsockopt(a,b,c,d,f) setsockopt(a,b,c,(char*)d,f)*/
/*# define getsockopt(a,b,c,d,f) getsockopt(a,b,c,(char*)d,f)*/
/*# define connect(a,b,c) connect(a,(struct sockaddr *)b,c)*/
/*# define bind(a,b,c) bind(a,(struct sockaddr *)b,c)*/
/*# define sendto(a,b,c,d,e,f) sendto(a,(char*)b,c,d,(struct sockaddr *)e,f)*/
# if defined(OPENSSL_THREADS) && !defined(_PUT_MODEL_)
/*
* HPNS SPT threads
*/
# define SPT_THREAD_SIGNAL 1
# define SPT_THREAD_AWARE 1
# include <spthread.h>
# undef close
# define close spt_close
/*
# define get_last_socket_error() errno
# define clear_socket_error() errno=0
# define ioctlsocket(a,b,c) ioctl(a,b,c)
# define closesocket(s) close(s)
# define readsocket(s,b,n) read((s),(char*)(b),(n))
# define writesocket(s,b,n) write((s),(char*)(b),(n)
*/
# define accept(a,b,c) accept(a,(struct sockaddr *)b,c)
# define recvfrom(a,b,c,d,e,f) recvfrom(a,b,(socklen_t)c,d,e,f)
# endif
# endif
# ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
# define CRYPTO_memcmp memcmp
# endif


+ 4
- 0
include/internal/cryptlib.h View File

@ -215,6 +215,10 @@ static ossl_inline void ossl_sleep(unsigned long millis)
ts.tv_sec = (long int) (millis / 1000);
ts.tv_nsec = (long int) (millis % 1000) * 1000000ul;
nanosleep(&ts, NULL);
# elif defined(__TANDEM) && !defined(_REENTRANT)
# include <cextdecs.h(PROCESS_DELAY_)>
/* HPNS does not support usleep for non threaded apps */
PROCESS_DELAY_(millis * 1000);
# else
usleep(millis * 1000);
# endif


+ 11
- 0
include/internal/sockets.h View File

@ -145,6 +145,17 @@ struct servent *PASCAL getservbyname(const char *, const char *);
# define closesocket(s) close(s)
# define readsocket(s,b,n) read((s),(b),(n))
# define writesocket(s,b,n) write((s),(char *)(b),(n))
# elif defined(OPENSSL_SYSNAME_TANDEM)
# if defined(OPENSSL_TANDEM_FLOSS)
# include <floss.h(floss_read, floss_write)>
# define readsocket(s,b,n) floss_read((s),(b),(n))
# define writesocket(s,b,n) floss_write((s),(b),(n))
# else
# define readsocket(s,b,n) read((s),(b),(n))
# define writesocket(s,b,n) write((s),(b),(n))
# endif
# define ioctlsocket(a,b,c) ioctl(a,b,c)
# define closesocket(s) close(s)
# else
# define ioctlsocket(a,b,c) ioctl(a,b,c)
# define closesocket(s) close(s)


+ 7
- 1
include/openssl/crypto.h View File

@ -464,7 +464,13 @@ typedef LONG CRYPTO_ONCE;
# define CRYPTO_ONCE_STATIC_INIT 0
# endif
# else
# include <pthread.h>
# if defined(__TANDEM) && defined(_SPT_MODEL_)
# define SPT_THREAD_SIGNAL 1
# define SPT_THREAD_AWARE 1
# include <spthread.h>
# else
# include <pthread.h>
# endif
typedef pthread_once_t CRYPTO_ONCE;
typedef pthread_key_t CRYPTO_THREAD_LOCAL;
typedef pthread_t CRYPTO_THREAD_ID;


+ 15
- 0
include/openssl/e_os2.h View File

@ -138,6 +138,21 @@ extern "C" {
# endif
# endif
/* ---------------------------- HP NonStop -------------------------------- */
# ifdef __TANDEM
# ifdef _STRING
# include <strings.h>
# endif
# define OPENSSL_USE_BUILD_DATE
# if defined(OPENSSL_THREADS) && defined(_SPT_MODEL_)
# define SPT_THREAD_SIGNAL 1
# define SPT_THREAD_AWARE 1
# include <spthread.h>
# elif defined(OPENSSL_THREADS) && defined(_PUT_MODEL_)
# include <pthread.h>
# endif
# endif
/**
* That's it for OS-specific stuff
*****************************************************************************/


+ 13
- 0
ssl/ssl_lib.c View File

@ -556,6 +556,19 @@ static int ssl_check_allowed_versions(int min_version, int max_version)
return 1;
}
#if defined(__TANDEM) && defined(OPENSSL_VPROC)
/*
* Define a VPROC function for HP NonStop build ssl library.
* This is used by platform version identification tools.
* Do not inline this procedure or make it static.
*/
# define OPENSSL_VPROC_STRING_(x) x##_SSL
# define OPENSSL_VPROC_STRING(x) OPENSSL_VPROC_STRING_(x)
# define OPENSSL_VPROC_FUNC OPENSSL_VPROC_STRING(OPENSSL_VPROC)
void OPENSSL_VPROC_FUNC(void) {}
#endif
static void clear_ciphers(SSL *s)
{
/* clear the current cipher */


+ 3
- 0
test/bntest.c View File

@ -10,6 +10,9 @@
#include <errno.h>
#include <stdio.h>
#include <string.h>
#ifdef __TANDEM
# include <strings.h> /* strcasecmp */
#endif
#include <ctype.h>
#include <openssl/bn.h>


+ 5
- 0
test/drbgtest.c View File

@ -31,6 +31,11 @@
# include <windows.h>
#endif
#if defined(__TANDEM)
# if defined(OPENSSL_TANDEM_FLOSS)
# include <floss.h(floss_fork)>
# endif
#endif
#if defined(OPENSSL_SYS_UNIX)
# include <sys/types.h>


+ 2
- 0
test/recipes/01-test_symbol_presence.t View File

@ -17,6 +17,8 @@ setup("test_symbol_presence");
plan skip_all => "Only useful when building shared libraries"
if disabled("shared");
plan skip_all => "Test is disabled on NonStop" if config('target') =~ m|^nonstop|;
my @libnames = ("crypto", "ssl");
my $testcount = scalar @libnames;


+ 1
- 0
test/recipes/90-test_shlibload.t View File

@ -21,6 +21,7 @@ use platform;
plan skip_all => "Test only supported in a shared build" if disabled("shared");
plan skip_all => "Test is disabled on AIX" if config('target') =~ m|^aix|;
plan skip_all => "Test is disabled on NonStop" if config('target') =~ m|^nonstop|;
plan skip_all => "Test only supported in a dso build" if disabled("dso");
plan tests => 10;


Loading…
Cancel
Save