]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Diverse small VMS build fixups
authorRichard Levitte <levitte@openssl.org>
Sat, 30 Mar 2024 11:52:50 +0000 (12:52 +0100)
committerTomas Mraz <tomas@openssl.org>
Thu, 4 Apr 2024 16:16:05 +0000 (18:16 +0200)
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24008)

(cherry picked from commit 1a4b029af51ba6128a37959796381ca5b8b7ac00)

Configurations/descrip.mms.tmpl
apps/lib/http_server.c
crypto/asn1/a_time.c
crypto/conf/conf_lib.c
crypto/conf/conf_sap.c
ssl/quic/json_enc.c
test/json_test.c

index 94eb7e28102e0c6046c9da64c069f4d806864caa..db6a1b17997c2744c06971d214f3fa032928f7a8 100644 (file)
       # from these directories.
       push @{$unified_info{includes_extra}->{$obj}}, qw(./quic);
   }
-  foreach (grep /\[\.ssl\.(?:quic|record|statem)\].*?\.o$/, keys %{$unified_info{sources}}) {
+  foreach (grep /\[\.ssl\.(?:quic|record|statem|rio)\].*?\.o$/, keys %{$unified_info{sources}}) {
       my $obj = platform->obj($_);
       # Most of the files in [.ssl.record] and [.ssl.statem] include
       # "../ssl_local.h", which includes things like "record/record.h".
index bca2e7110d4570d0f06f6710aab51e3e81652250..0bdeaeb5f7416bd6494b025537d95832a2bfb9e3 100644 (file)
@@ -200,7 +200,7 @@ BIO *http_server_init(const char *prog, const char *port, int verb)
     int port_num;
     char name[40];
 
-    snprintf(name, sizeof(name), "*:%s", port); /* port may be "0" */
+    BIO_snprintf(name, sizeof(name), "*:%s", port); /* port may be "0" */
     if (verb >= 0 && !log_set_verbosity(prog, verb))
         return NULL;
     bufbio = BIO_new(BIO_f_buffer());
index 25d306a3a6ac2a03a1590cd81207dbcbd25fe077..b4a0f9918ab7825aafa854787f5914d01092499b 100644 (file)
@@ -14,6 +14,8 @@
  *      generalTime    GeneralizedTime }
  */
 
+#define _XOPEN_SOURCE            /* To get a definition of timezone */
+
 #include <stdio.h>
 #include <time.h>
 #include "crypto/asn1.h"
index 99e9f8c987b3471b4e6470425846b96dc4be8f49..13e2723f8009f5e4e6513267ed3f0ed312f95d7b 100644 (file)
@@ -7,6 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
+#define _XOPEN_SOURCE_EXTENDED   /* To get a definition of strdup() */
+
 #include "internal/e_os.h"
 #include <stdio.h>
 #include <string.h>
index 3019bcf31af81abf116cc6bae319b3d9cb094fd3..9c78f465814894556e1e8d112d883af402c88193 100644 (file)
@@ -7,6 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
+#define _XOPEN_SOURCE_EXTENDED   /* To get a definition of strdup() */
+
 #include <stdio.h>
 #include <openssl/crypto.h>
 #include "internal/cryptlib.h"
index 650247f869f3eab1df83d79cc564d1fe641adbb3..990c67dc5f458184535bac21ca11aa53f0e8b6a5 100644 (file)
@@ -9,6 +9,7 @@
 
 #include "internal/json_enc.h"
 #include "internal/nelem.h"
+#include "internal/numbers.h"
 #include <string.h>
 #include <math.h>
 
@@ -602,10 +603,19 @@ void ossl_json_f64(OSSL_JSON_ENC *json, double value)
     if (!json_pre_item(json))
         return;
 
-    if (isnan(value) || isinf(value)) {
-        json_raise_error(json);
-        return;
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+    {
+        int checks = isnan(value);
+# if !defined(OPENSSL_SYS_VMS)
+        checks |= isinf(value);
+# endif
+
+        if (checks) {
+            json_raise_error(json);
+            return;
+        }
     }
+#endif
 
     BIO_snprintf(buf, sizeof(buf), "%1.17g", value);
     json_write_str(json, buf);
index db3038d766c08c6e4c91dff43a7c29e615bb2f41..7b46b4f15e908721d8077bfddd9b0c739ee2c5bd 100644 (file)
@@ -144,6 +144,15 @@ typedef void (*fp_pz_type)(OSSL_JSON_ENC *, const void *, size_t);
         return &script_info;                                                   \
     }
 
+#ifdef OPENSSL_SYS_VMS
+/*
+ * The VMS C compiler recognises \u in strings, and emits a warning, which
+ * stops the build.  Because we think we know what we're doing, we change that
+ * particular message to be merely informational.
+ */
+# pragma message informational UCNNOMAP
+#endif
+
 #define END_SCRIPT_EXPECTING_S(s)   END_SCRIPT_EXPECTING(s, SIZE_MAX)
 #define END_SCRIPT_EXPECTING_Q(s)   END_SCRIPT_EXPECTING(#s, sizeof(#s) - 1)