[openssl] master update
Richard Levitte
levitte at openssl.org
Sat Sep 12 18:33:01 UTC 2020
The branch master has been updated
via 08073700cc50bcd0df5c0ee68c100e300a320d03 (commit)
from f0c62c53286b3a79cc059354a6d3425b35bb1d50 (commit)
- Log -----------------------------------------------------------------
commit 08073700cc50bcd0df5c0ee68c100e300a320d03
Author: Randall S. Becker <rsbecker at nexbridge.com>
Date: Sun Sep 6 16:37:47 2020 -0500
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 at nexbridge.com>
Reviewed-by: Shane Lontis <shane.lontis at oracle.com>
Reviewed-by: Richard Levitte <levitte at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/12800)
-----------------------------------------------------------------------
Summary of changes:
Configurations/50-nonstop.conf | 176 +++++++++++++++++++++++++++++++++
NOTES.HPNS | 42 ++++++++
apps/ca.c | 2 +-
apps/lib/apps.c | 20 ++++
apps/lib/http_server.c | 6 ++
apps/lib/s_socket.c | 6 ++
apps/ocsp.c | 6 ++
apps/provider.c | 4 +
apps/speed.c | 6 ++
apps/version.c | 13 +++
crypto/bio/b_sock.c | 8 +-
crypto/conf/conf_def.c | 3 +
crypto/cryptlib.c | 12 +++
crypto/dso/dso_dlfcn.c | 2 +-
crypto/rand/rand_egd.c | 70 +++++++++++++
crypto/threads_pthread.c | 6 +-
e_os.h | 58 +++++++++++
include/internal/cryptlib.h | 4 +
include/internal/sockets.h | 11 +++
include/openssl/crypto.h | 8 +-
include/openssl/e_os2.h | 15 +++
ssl/ssl_lib.c | 13 +++
test/bntest.c | 3 +
test/drbgtest.c | 5 +
test/recipes/01-test_symbol_presence.t | 2 +
test/recipes/90-test_shlibload.t | 1 +
26 files changed, 497 insertions(+), 5 deletions(-)
create mode 100644 Configurations/50-nonstop.conf
create mode 100644 NOTES.HPNS
diff --git a/Configurations/50-nonstop.conf b/Configurations/50-nonstop.conf
new file mode 100644
index 0000000000..51034c70aa
--- /dev/null
+++ b/Configurations/50-nonstop.conf
@@ -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(" ", at _,"-Wverbose -I/usr/local/include") },
+ shared_cflag => sub { join(" ", at _,"-Wverbose -I/usr/local/include") },
+ lflags => sub { join(" ", at _,"-lfloss -Wxld='-set floattype neutral_float' -Wsystype=oss") },
+ shared_ldflag => sub { join(" ", at _,"-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(" ", at _,"-Wverbose") },
+ shared_cflag => sub { join(" ", at _,"-Wverbose") },
+ lflags => sub { join(" ", at _,"-lput") },
+ shared_ldflag => sub { join(" ", at _,"-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(" ", at _,"-Wlp64 -Wverbose") },
+ shared_cflag => sub { join(" ", at _,"-Wlp64 -Wverbose") },
+ lflags => sub { join(" ", at _,"-lfloss -Wlp64") },
+ shared_ldflag => sub { join(" ", at _,"-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(" ", at _,"-Wlp64 -Wverbose -Wtarget=tns/x") },
+ cflags => sub { join(" ", at _,"-Wlp64 -Wverbose -Wtarget=tns/x") },
+ lflags => sub { join(" ", at _,"-Wxld='-set floattype neutral_float -set systype oss' -Wlp64 -lput -Wsystype=oss") },
+ shared_ldflag => sub { join(" ", at _,"-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(" ", at _,"-Wverbose -Wtarget=tns/x") },
+ shared_cflag => sub { join(" ", at _,"-Wverbose -Wtarget=tns/x") },
+ lflags => sub { join(" ", at _,"-lspt -Wextensions") },
+ shared_ldflag => sub { join(" ", at _,"-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(" ", at _,"-I/usr/local/include -Wverbose -Wtarget=tns/x") },
+ shared_cflag => sub { join(" ", at _,"-I/usr/local/include -Wverbose -Wtarget=tns/x") },
+ lflags => sub { join(" ", at _,"-lfloss -lspt -Wextensions") },
+ shared_ldflag => sub { join(" ", at _,"-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(" ", at _,"-Wverbose -Wtarget=tns/x") },
+ shared_cflag => sub { join(" ", at _,"-Wverbose -Wtarget=tns/x") },
+ lflags => sub { join(" ", at _,"-Wsystype=guardian -Wxld='-set systype guardian -set floattype neutral_float'") },
+ shared_ldflag => sub { join(" ", at _,"-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(" ", at _,"-Wverbose -Wtarget=tns/x") },
+ shared_cflag => sub { join(" ", at _,"-Wverbose -Wtarget=tns/x") },
+ lflags => sub { join(" ", at _,"-Wsystype=guardian -Wxld='-set systype guardian -set floattype tandem_float'") },
+ shared_ldflag => sub { join(" ", at _,"-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(" ", at _,"-Wverbose -Wtarget=tns/e -I/usr/local/include") },
+ shared_cflag => sub { join(" ", at _,"-Wverbose -Wtarget=tns/e -I/usr/local/include") },
+ lflags => sub { join(" ", at _,"-lfloss") },
+ shared_ldflag => sub { join(" ", at _,"-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(" ", at _,"-Wverbose -Wtarget=tns/e") },
+ shared_cflag => sub { join(" ", at _,"-Wverbose -Wtarget=tns/e") },
+ lflags => sub { join(" ", at _,"-lput") },
+ shared_ldflag => sub { join(" ", at _,"-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(" ", at _,"-Wlp64 -Wverbose -Wtarget=tns/e") },
+ shared_cflag => sub { join(" ", at _,"-Wlp64 -Wverbose -Wtarget=tns/e") },
+ lflags => sub { join(" ", at _,"-lfloss -Wlp64") },
+ shared_ldflag => sub { join(" ", at _,"-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(" ", at _,"-Wlp64 -Wverbose -Wtarget=tns/e") },
+ shared_cflag => sub { join(" ", at _,"-Wlp64 -Wverbose -Wtarget=tns/e") },
+ lflags => sub { join(" ", at _,"-lput -Wlp64") },
+ shared_ldflag => sub { join(" ", at _,"-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(" ", at _,"-Wverbose -Wtarget=tns/e") },
+ shared_cflag => sub { join(" ", at _,"-Wverbose -Wtarget=tns/e") },
+ lflags => sub { join(" ", at _,"-lspt -Wextensions") },
+ shared_ldflag => sub { join(" ", at _,"-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(" ", at _,"-Wverbose -Wtarget=tns/e") },
+ shared_cflag => sub { join(" ", at _,"-Wverbose -Wtarget=tns/e") },
+ lflags => sub { join(" ", at _,"-lfloss -lspt -Wextensions") },
+ shared_ldflag => sub { join(" ", at _,"-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(" ", at _,"-Wverbose -Wtarget=tns/e") },
+ shared_cflag => sub { join(" ", at _,"-Wverbose -Wtarget=tns/e") },
+ lflags => sub { join(" ", at _,"-Wsystype=guardian -Weld='-set systype guardian'") },
+ shared_ldflag => sub { join(" ", at _,"-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(" ", at _,"-Wverbose -Wtarget=tns/e") },
+ shared_cflag => sub { join(" ", at _,"-Wverbose -Wtarget=tns/e") },
+ lflags => sub { join(" ", at _,"-Wsystype=guardian -Weld='-set systype guardian -set floattype tandem_float'") },
+ shared_ldflag => sub { join(" ", at _,"-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",
+ },
diff --git a/NOTES.HPNS b/NOTES.HPNS
new file mode 100644
index 0000000000..359f18b3a8
--- /dev/null
+++ b/NOTES.HPNS
@@ -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
diff --git a/apps/ca.c b/apps/ca.c
index f6a928a0e8..3c2bee8f2f 100644
--- a/apps/ca.c
+++ b/apps/ca.c
@@ -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
diff --git a/apps/lib/apps.c b/apps/lib/apps.c
index f2c384494f..5d95ce0c65 100644
--- a/apps/lib/apps.c
+++ b/apps/lib/apps.c
@@ -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);
diff --git a/apps/lib/http_server.c b/apps/lib/http_server.c
index 5c009b9990..b7d9842013 100644
--- a/apps/lib/http_server.c
+++ b/apps/lib/http_server.c
@@ -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
diff --git a/apps/lib/s_socket.c b/apps/lib/s_socket.c
index b9baef913d..890bd39414 100644
--- a/apps/lib/s_socket.c
+++ b/apps/lib/s_socket.c
@@ -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>
diff --git a/apps/ocsp.c b/apps/ocsp.c
index 0aca4b7622..4f42d66c0e 100644
--- a/apps/ocsp.c
+++ b/apps/ocsp.c
@@ -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)
diff --git a/apps/provider.c b/apps/provider.c
index 7d3581153b..748b95023e 100644
--- a/apps/provider.c
+++ b/apps/provider.c
@@ -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 {
diff --git a/apps/speed.c b/apps/speed.c
index 4bd42d4e42..017c5a280a 100644
--- a/apps/speed.c
+++ b/apps/speed.c
@@ -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
diff --git a/apps/version.c b/apps/version.c
index ebdd03e0fe..4a289faca0 100644
--- a/apps/version.c
+++ b/apps/version.c
@@ -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
diff --git a/crypto/bio/b_sock.c b/crypto/bio/b_sock.c
index 79f7743b2f..61dbf474f9 100644
--- a/crypto/bio/b_sock.c
+++ b/crypto/bio/b_sock.c
@@ -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
diff --git a/crypto/conf/conf_def.c b/crypto/conf/conf_def.c
index 5475429abd..6f7c06afd7 100644
--- a/crypto/conf/conf_def.c
+++ b/crypto/conf/conf_def.c
@@ -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>
diff --git a/crypto/cryptlib.c b/crypto/cryptlib.c
index bc29a3b583..0f6d38e67b 100644
--- a/crypto/cryptlib.c
+++ b/crypto/cryptlib.c
@@ -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 */
diff --git a/crypto/dso/dso_dlfcn.c b/crypto/dso/dso_dlfcn.c
index b8bbed87e8..bb34c6ed42 100644
--- a/crypto/dso/dso_dlfcn.c
+++ b/crypto/dso/dso_dlfcn.c
@@ -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
diff --git a/crypto/rand/rand_egd.c b/crypto/rand/rand_egd.c
index cd87531943..c6dcd87f04 100644
--- a/crypto/rand/rand_egd.c
+++ b/crypto/rand/rand_egd.c
@@ -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;
}
diff --git a/crypto/threads_pthread.c b/crypto/threads_pthread.c
index 8b60251e77..936aa7f0c7 100644
--- a/crypto/threads_pthread.c
+++ b/crypto/threads_pthread.c
@@ -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);
diff --git a/e_os.h b/e_os.h
index c035568464..979be9b2b1 100644
--- a/e_os.h
+++ b/e_os.h
@@ -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
diff --git a/include/internal/cryptlib.h b/include/internal/cryptlib.h
index 1df0c5df34..a01b1f15d5 100644
--- a/include/internal/cryptlib.h
+++ b/include/internal/cryptlib.h
@@ -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
diff --git a/include/internal/sockets.h b/include/internal/sockets.h
index 6d17363d9b..e3a6bd459b 100644
--- a/include/internal/sockets.h
+++ b/include/internal/sockets.h
@@ -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)
diff --git a/include/openssl/crypto.h b/include/openssl/crypto.h
index abd3a68cd4..a7c2863b54 100644
--- a/include/openssl/crypto.h
+++ b/include/openssl/crypto.h
@@ -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;
diff --git a/include/openssl/e_os2.h b/include/openssl/e_os2.h
index 7b51939e3d..13420d9928 100644
--- a/include/openssl/e_os2.h
+++ b/include/openssl/e_os2.h
@@ -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
*****************************************************************************/
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c
index ad1cfb4f40..a036ac29e9 100644
--- a/ssl/ssl_lib.c
+++ b/ssl/ssl_lib.c
@@ -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 */
diff --git a/test/bntest.c b/test/bntest.c
index 252bac4d8e..5ec35181f1 100644
--- a/test/bntest.c
+++ b/test/bntest.c
@@ -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>
diff --git a/test/drbgtest.c b/test/drbgtest.c
index d069460cd5..2ded33aa7f 100644
--- a/test/drbgtest.c
+++ b/test/drbgtest.c
@@ -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>
diff --git a/test/recipes/01-test_symbol_presence.t b/test/recipes/01-test_symbol_presence.t
index d339770b0f..f22133d9d2 100644
--- a/test/recipes/01-test_symbol_presence.t
+++ b/test/recipes/01-test_symbol_presence.t
@@ -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;
diff --git a/test/recipes/90-test_shlibload.t b/test/recipes/90-test_shlibload.t
index fee56cd254..96e3e6e12e 100644
--- a/test/recipes/90-test_shlibload.t
+++ b/test/recipes/90-test_shlibload.t
@@ -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;
More information about the openssl-commits
mailing list