diff options
-rw-r--r-- | Configurations/50-nonstop.conf | 176 | ||||
-rw-r--r-- | NOTES.HPNS | 42 | ||||
-rw-r--r-- | apps/ca.c | 2 | ||||
-rw-r--r-- | apps/lib/apps.c | 20 | ||||
-rw-r--r-- | apps/lib/http_server.c | 6 | ||||
-rw-r--r-- | apps/lib/s_socket.c | 6 | ||||
-rw-r--r-- | apps/ocsp.c | 6 | ||||
-rw-r--r-- | apps/provider.c | 4 | ||||
-rw-r--r-- | apps/speed.c | 6 | ||||
-rw-r--r-- | apps/version.c | 13 | ||||
-rw-r--r-- | crypto/bio/b_sock.c | 8 | ||||
-rw-r--r-- | crypto/conf/conf_def.c | 3 | ||||
-rw-r--r-- | crypto/cryptlib.c | 12 | ||||
-rw-r--r-- | crypto/dso/dso_dlfcn.c | 2 | ||||
-rw-r--r-- | crypto/rand/rand_egd.c | 70 | ||||
-rw-r--r-- | crypto/threads_pthread.c | 6 | ||||
-rw-r--r-- | e_os.h | 58 | ||||
-rw-r--r-- | include/internal/cryptlib.h | 4 | ||||
-rw-r--r-- | include/internal/sockets.h | 11 | ||||
-rw-r--r-- | include/openssl/crypto.h | 8 | ||||
-rw-r--r-- | include/openssl/e_os2.h | 15 | ||||
-rw-r--r-- | ssl/ssl_lib.c | 13 | ||||
-rw-r--r-- | test/bntest.c | 3 | ||||
-rw-r--r-- | test/drbgtest.c | 5 | ||||
-rw-r--r-- | test/recipes/01-test_symbol_presence.t | 2 | ||||
-rw-r--r-- | test/recipes/90-test_shlibload.t | 1 |
26 files changed, 497 insertions, 5 deletions
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(" ",@_,"-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", + }, 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 @@ -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); @@ -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/crypt |