From ebab062ce0bf4eccc515ab6d8e0d1ee0fb0d166d Mon Sep 17 00:00:00 2001 From: Hakase Date: Sun, 16 Sep 2018 06:28:30 +0900 Subject: [PATCH] Latest update --- Configurations/10-main.conf | 11 ++++++++--- Configurations/descrip.mms.tmpl | 18 +++++++++++------- crypto/rand/rand_vms.c | 11 ++++++++--- ssl/statem/extensions.c | 4 +++- test/build.info | 4 ++-- test/cipher_overhead_test.c | 10 ---------- test/curve448_internal_test.c | 11 ----------- test/ssl_cert_table_internal_test.c | 10 ---------- test/tls13encryptiontest.c | 11 ----------- test/tls13secretstest.c | 10 ---------- test/wpackettest.c | 11 ----------- test/x509_internal_test.c | 9 --------- 12 files changed, 32 insertions(+), 88 deletions(-) diff --git a/Configurations/10-main.conf b/Configurations/10-main.conf index 5cf345da..8360bb36 100644 --- a/Configurations/10-main.conf +++ b/Configurations/10-main.conf @@ -1732,10 +1732,15 @@ my %targets = ( lflags => picker(default => "/MAP='F\$PARSE(\".MAP\",\"\$\@\")'", debug => "/DEBUG/TRACEBACK", release => "/NODEBUG/NOTRACEBACK"), + # Because of dso_cflags below, we can't set the generic |cflags| here, + # as it can't be overriden, so we set separate C flags for libraries + # and binaries instead. + bin_cflags => add("/NAMES=(AS_IS,SHORTENED)/EXTERN_MODEL=STRICT_REFDEF"), lib_cflags => add("/NAMES=(AS_IS,SHORTENED)/EXTERN_MODEL=STRICT_REFDEF"), - # no_inst_lib_cflags is used instead of lib_cflags by descrip.mms.tmpl - # for object files belonging to selected internal libraries - no_inst_lib_cflags => "", + # For modules specifically, we assume that they only use public + # OpenSSL symbols, and therefore don't need to mangle names on + # their own. + dso_cflags => "", ex_libs => add(sub { return vms_info()->{zlib} || (); }), shared_target => "vms-shared", dso_scheme => "vms", diff --git a/Configurations/descrip.mms.tmpl b/Configurations/descrip.mms.tmpl index 95fa521b..b1c00b7d 100644 --- a/Configurations/descrip.mms.tmpl +++ b/Configurations/descrip.mms.tmpl @@ -298,8 +298,8 @@ BIN_CPPFLAGS={- join('', "'qual_includes'", $target{bin_cppflags} || (), @{$config{bin_cppflag}}, '$(CNF_CPPFLAGS)', '$(CPPFLAGS)') -} -BIN_CFLAGS={- join('', $target{bin_cflag} || (), - @{$config{bin_cflag}}, +BIN_CFLAGS={- join('', $target{bin_cflags} || (), + @{$config{bin_cflags}}, '$(CNF_CFLAGS)', '$(CFLAGS)') -} BIN_LDFLAGS={- join('', $target{bin_lflags} || (), @{$config{bin_lflags}} || (), @@ -312,12 +312,14 @@ NO_INST_LIB_CFLAGS={- join('', $target{no_inst_lib_cflags} @{$config{lib_cflags}}, @{$config{shared_cflag}}, '$(CNF_CFLAGS)', '$(CFLAGS)') -} -NO_INST_DSO_CFLAGS={- join('', $target{no_inst_lib_cflags} - // $target{lib_cflags} +NO_INST_DSO_CFLAGS={- join('', $target{no_inst_dso_cflags} + // $target{dso_cflags} + // (), + $target{no_inst_module_cflags} + // $target{module_cflags} // (), - $target{dso_cflags} || (), - @{$config{lib_cflags}}, @{$config{dso_cflags}}, + @{$config{module_cflags}}, '$(CNF_CFLAGS)', '$(CFLAGS)') -} NO_INST_BIN_CFLAGS={- join('', $target{no_inst_bin_cflags} // $target{bin_cflags} @@ -1032,7 +1034,9 @@ EOF "\@ WRITE OPT_FILE \"$x" } @objs). "\""; my $write_opt2 = - join("\n\t", map { my @lines = (); + join("\n\t", map { my @lines = ( + "\ WRITE OPT_FILE \"CASE_SENSITIVE=YES\"" + ); my $x = $_ =~ /\[/ ? $_ : "[]".$_; if ($x =~ m|\.EXE$|) { push @lines, "\@ WRITE OPT_FILE \"$x/SHARE\""; diff --git a/crypto/rand/rand_vms.c b/crypto/rand/rand_vms.c index 43dddf3c..bfcf6f0a 100644 --- a/crypto/rand/rand_vms.c +++ b/crypto/rand/rand_vms.c @@ -478,13 +478,18 @@ int rand_pool_add_nonce_data(RAND_POOL *pool) } data = { 0 }; /* - * Add process id, thread id, and a high resolution timestamp to - * ensure that the nonce is unique whith high probability for - * different process instances. + * Add process id, thread id, and a high resolution timestamp + * (where available, which is OpenVMS v8.4 and up) to ensure that + * the nonce is unique whith high probability for different process + * instances. */ data.pid = getpid(); data.tid = CRYPTO_THREAD_get_current_id(); +#if __CRTL_VER >= 80400000 sys$gettim_prec(&data.time); +#else + sys$gettim((void*)&data.time); +#endif return rand_pool_add(pool, (unsigned char *)&data, sizeof(data), 0); } diff --git a/ssl/statem/extensions.c b/ssl/statem/extensions.c index 8422161d..6e59b01d 100644 --- a/ssl/statem/extensions.c +++ b/ssl/statem/extensions.c @@ -998,7 +998,9 @@ static int final_server_name(SSL *s, unsigned int context, int sent) switch (ret) { case SSL_TLSEXT_ERR_ALERT_FATAL: - SSLfatal(s, altmp, SSL_F_FINAL_SERVER_NAME, SSL_R_CALLBACK_FAILED); + s->statem.in_init = 1; + s->statem.state = MSG_FLOW_ERROR; + ssl3_send_alert(s, SSL3_AL_FATAL, SSL_F_FINAL_RENEGOTIATE); return 0; case SSL_TLSEXT_ERR_ALERT_WARNING: diff --git a/test/build.info b/test/build.info index 08657c80..fa154f07 100644 --- a/test/build.info +++ b/test/build.info @@ -17,10 +17,10 @@ IF[{- !$disabled{tests} -}] DEPEND[libtestutil.a]=../libcrypto # Special hack for descrip.mms to include the MAIN object module - # explicitly. This will only be done if there isn't a MAIN in the + # explicitly. This will only be done if there isn't a 'main' in the # program's object modules already. BEGINRAW[descrip.mms] -INCLUDE_MAIN___test_libtestutil_OLB = /INCLUDE=MAIN +INCLUDE_MAIN___test_libtestutil_OLB = /INCLUDE=main ENDRAW[descrip.mms] PROGRAMS_NO_INST=\ diff --git a/test/cipher_overhead_test.c b/test/cipher_overhead_test.c index f8c6fd73..8997fcc5 100644 --- a/test/cipher_overhead_test.c +++ b/test/cipher_overhead_test.c @@ -9,18 +9,8 @@ #include "internal/nelem.h" #include "testutil.h" - -#ifdef __VMS -# pragma names save -# pragma names as_is,shortened -#endif - #include "../ssl/ssl_locl.h" -#ifdef __VMS -# pragma names restore -#endif - static int cipher_overhead(void) { int ret = 1, i, n = ssl3_num_ciphers(); diff --git a/test/curve448_internal_test.c b/test/curve448_internal_test.c index e7d43785..f0f10790 100644 --- a/test/curve448_internal_test.c +++ b/test/curve448_internal_test.c @@ -10,18 +10,7 @@ #include #include #include - -#ifdef __VMS -# pragma names save -# pragma names as_is,shortened -#endif - #include "curve448_lcl.h" - -#ifdef __VMS -# pragma names restore -#endif - #include "testutil.h" static unsigned int max = 1000; diff --git a/test/ssl_cert_table_internal_test.c b/test/ssl_cert_table_internal_test.c index 2104e8c5..bba4e441 100644 --- a/test/ssl_cert_table_internal_test.c +++ b/test/ssl_cert_table_internal_test.c @@ -15,19 +15,9 @@ #include #include "testutil.h" #include "internal/nelem.h" - -#ifdef __VMS -# pragma names save -# pragma names as_is,shortened -#endif - #include "../ssl/ssl_locl.h" #include "../ssl/ssl_cert_table.h" -#ifdef __VMS -# pragma names restore -#endif - #define test_cert_table(nid, amask, idx) \ do_test_cert_table(nid, amask, idx, #idx) diff --git a/test/tls13encryptiontest.c b/test/tls13encryptiontest.c index 6f359b3a..f9f61a05 100644 --- a/test/tls13encryptiontest.c +++ b/test/tls13encryptiontest.c @@ -9,19 +9,8 @@ #include #include - -#ifdef __VMS -# pragma names save -# pragma names as_is,shortened -#endif - #include "../ssl/ssl_locl.h" #include "../ssl/record/record_locl.h" - -#ifdef __VMS -# pragma names restore -#endif - #include "internal/nelem.h" #include "testutil.h" diff --git a/test/tls13secretstest.c b/test/tls13secretstest.c index 724c170c..319df17b 100644 --- a/test/tls13secretstest.c +++ b/test/tls13secretstest.c @@ -10,17 +10,7 @@ #include #include -#ifdef __VMS -# pragma names save -# pragma names as_is,shortened -#endif - #include "../ssl/ssl_locl.h" - -#ifdef __VMS -# pragma names restore -#endif - #include "testutil.h" #define IVLEN 12 diff --git a/test/wpackettest.c b/test/wpackettest.c index 773eef05..71eb7634 100644 --- a/test/wpackettest.c +++ b/test/wpackettest.c @@ -9,18 +9,7 @@ #include #include - -#ifdef __VMS -# pragma names save -# pragma names as_is,shortened -#endif - #include "../ssl/packet_locl.h" - -#ifdef __VMS -# pragma names restore -#endif - #include "testutil.h" static const unsigned char simple1[] = { 0xff }; diff --git a/test/x509_internal_test.c b/test/x509_internal_test.c index d2f41d70..12f6ac95 100644 --- a/test/x509_internal_test.c +++ b/test/x509_internal_test.c @@ -23,18 +23,9 @@ * ***/ -#ifdef __VMS -# pragma names save -# pragma names as_is,shortened -#endif - #include "../crypto/x509v3/ext_dat.h" #include "../crypto/x509v3/standard_exts.h" -#ifdef __VMS -# pragma names restore -#endif - static int test_standard_exts(void) { size_t i;