changeset 5502:834be222605b

upgraded to OpenSSL 3.1.4
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 24 Jan 2024 17:16:06 +0100
parents 8b96d1d17831
children 5910aa0c96ce
files NEWS OrthancFramework/Resources/CMake/BoostConfiguration.cmake OrthancFramework/Resources/CMake/OpenSslConfigurationStatic-3.0.cmake OrthancFramework/Resources/Patches/openssl-3.1.0.patch OrthancFramework/Resources/Patches/openssl-3.1.4.patch OrthancServer/UnitTestsSources/VersionsTests.cpp
diffstat 6 files changed, 54 insertions(+), 53 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Wed Jan 24 16:50:21 2024 +0100
+++ b/NEWS	Wed Jan 24 17:16:06 2024 +0100
@@ -13,6 +13,7 @@
 * Upgraded dependencies for static builds:
   - boost 1.84.0
   - dcmtk 3.6.8
+  - openssl 3.1.4
 
 
 Version 1.12.2 (2023-12-19)
--- a/OrthancFramework/Resources/CMake/BoostConfiguration.cmake	Wed Jan 24 16:50:21 2024 +0100
+++ b/OrthancFramework/Resources/CMake/BoostConfiguration.cmake	Wed Jan 24 17:16:06 2024 +0100
@@ -134,7 +134,7 @@
   endif()
 
   include_directories(
-    BEFORE
+    BEFORE SYSTEM
     ${BOOST_SOURCES_DIR}
     ${BOOST_SOURCES_DIR}/libs/atomic/src/
     ${BOOST_SOURCES_DIR}/libs/locale/src/
--- a/OrthancFramework/Resources/CMake/OpenSslConfigurationStatic-3.0.cmake	Wed Jan 24 16:50:21 2024 +0100
+++ b/OrthancFramework/Resources/CMake/OpenSslConfigurationStatic-3.0.cmake	Wed Jan 24 17:16:06 2024 +0100
@@ -21,12 +21,12 @@
 
 set(OPENSSL_VERSION_MAJOR 3)
 set(OPENSSL_VERSION_MINOR 1)
-set(OPENSSL_VERSION_PATCH 0)
+set(OPENSSL_VERSION_PATCH 4)
 set(OPENSSL_VERSION_PRE_RELEASE "")
 set(OPENSSL_VERSION_FULL "${OPENSSL_VERSION_MAJOR}.${OPENSSL_VERSION_MINOR}.${OPENSSL_VERSION_PATCH}${OPENSSL_VERSION_PRE_RELEASE}")
 SET(OPENSSL_SOURCES_DIR ${CMAKE_BINARY_DIR}/openssl-${OPENSSL_VERSION_FULL})
 SET(OPENSSL_URL "https://orthanc.uclouvain.be/downloads/third-party-downloads/openssl-${OPENSSL_VERSION_FULL}.tar.gz")
-SET(OPENSSL_MD5 "f6c520aa2206d4d1fa71ea30b5e9a56d")
+SET(OPENSSL_MD5 "653ad58812c751b887e8ec37e02bba70")
 
 if (IS_DIRECTORY "${OPENSSL_SOURCES_DIR}")
   set(FirstRun OFF)
@@ -124,7 +124,7 @@
 
 
 include_directories(
-  BEFORE
+  BEFORE SYSTEM
   ${OPENSSL_SOURCES_DIR}
   ${OPENSSL_SOURCES_DIR}/crypto/asn1
   ${OPENSSL_SOURCES_DIR}/crypto/ec/curve448
--- a/OrthancFramework/Resources/Patches/openssl-3.1.0.patch	Wed Jan 24 16:50:21 2024 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-diff -urEb openssl-3.1.0.orig/crypto/riscvcap.c openssl-3.1.0/crypto/riscvcap.c
---- openssl-3.1.0.orig/crypto/riscvcap.c	2023-03-14 13:59:07.000000000 +0100
-+++ openssl-3.1.0/crypto/riscvcap.c	2023-04-04 17:18:21.018468423 +0200
-@@ -37,7 +37,8 @@
- 
- static void strtoupper(char *str)
- {
--    for (char *x = str; *x; ++x)
-+    char* x;
-+    for (x = str; *x; ++x)
-         *x = toupper(*x);
- }
- 
-@@ -51,12 +52,13 @@
- {
-     char envstrupper[BUFLEN];
-     char buf[BUFLEN];
-+    size_t i;
- 
-     /* Convert env str to all uppercase */
-     OPENSSL_strlcpy(envstrupper, envstr, sizeof(envstrupper));
-     strtoupper(envstrupper);
- 
--    for (size_t i = 0; i < kRISCVNumCaps; ++i) {
-+    for (i = 0; i < kRISCVNumCaps; ++i) {
-         /* Prefix capability with underscore in preparation for search */
-         BIO_snprintf(buf, BUFLEN, "_%s", RISCV_capabilities[i].name);
-         if (strstr(envstrupper, buf) != NULL) {
-diff -urEb openssl-3.1.0.orig/providers/implementations/rands/seeding/rand_unix.c openssl-3.1.0/providers/implementations/rands/seeding/rand_unix.c
---- openssl-3.1.0.orig/providers/implementations/rands/seeding/rand_unix.c	2023-03-14 13:59:07.000000000 +0100
-+++ openssl-3.1.0/providers/implementations/rands/seeding/rand_unix.c	2023-04-04 17:17:43.874649403 +0200
-@@ -452,6 +452,7 @@
-              * system call and this should always succeed which renders
-              * this alternative but essentially identical source moot.
-              */
-+#if !defined(__LSB_VERSION__)  // "syscall()" is not available in LSB
-             if (uname(&un) == 0) {
-                 kernel[0] = atoi(un.release);
-                 p = strchr(un.release, '.');
-@@ -462,6 +463,7 @@
-                     return 0;
-                 }
-             }
-+#endif
-             /* Open /dev/random and wait for it to be readable */
-             if ((fd = open(DEVRANDOM_WAIT, O_RDONLY)) != -1) {
-                 if (DEVRANDM_WAIT_USE_SELECT && fd < FD_SETSIZE) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/OrthancFramework/Resources/Patches/openssl-3.1.4.patch	Wed Jan 24 17:16:06 2024 +0100
@@ -0,0 +1,47 @@
+diff -urEb openssl-3.1.4.orig/crypto/riscvcap.c openssl-3.1.4/crypto/riscvcap.c
+--- openssl-3.1.4.orig/crypto/riscvcap.c	2024-01-24 16:58:48.308108757 +0100
++++ openssl-3.1.4/crypto/riscvcap.c	2024-01-24 17:01:04.114914015 +0100
+@@ -37,7 +37,8 @@
+ 
+ static void strtoupper(char *str)
+ {
+-    for (char *x = str; *x; ++x)
++    char* x;
++    for (x = str; *x; ++x)
+         *x = toupper(*x);
+ }
+ 
+@@ -51,12 +52,13 @@
+ {
+     char envstrupper[BUFLEN];
+     char buf[BUFLEN];
++    size_t i;
+ 
+     /* Convert env str to all uppercase */
+     OPENSSL_strlcpy(envstrupper, envstr, sizeof(envstrupper));
+     strtoupper(envstrupper);
+ 
+-    for (size_t i = 0; i < kRISCVNumCaps; ++i) {
++    for (i = 0; i < kRISCVNumCaps; ++i) {
+         /* Prefix capability with underscore in preparation for search */
+         BIO_snprintf(buf, BUFLEN, "_%s", RISCV_capabilities[i].name);
+         if (strstr(envstrupper, buf) != NULL) {
+diff -urEb openssl-3.1.4.orig/providers/implementations/rands/seeding/rand_unix.c openssl-3.1.4/providers/implementations/rands/seeding/rand_unix.c
+--- openssl-3.1.4.orig/providers/implementations/rands/seeding/rand_unix.c	2024-01-24 16:58:48.332108547 +0100
++++ openssl-3.1.4/providers/implementations/rands/seeding/rand_unix.c	2024-01-24 17:01:30.182683539 +0100
+@@ -452,6 +452,7 @@
+              * system call and this should always succeed which renders
+              * this alternative but essentially identical source moot.
+              */
++#if !defined(__LSB_VERSION__)  // "syscall()" is not available in LSB
+             if (uname(&un) == 0) {
+                 kernel[0] = atoi(un.release);
+                 p = strchr(un.release, '.');
+@@ -462,6 +463,7 @@
+                     return 0;
+                 }
+             }
++#endif
+             /* Open /dev/random and wait for it to be readable */
+             if ((fd = open(DEVRANDOM_WAIT, O_RDONLY)) != -1) {
+                 if (DEVRANDM_WAIT_USE_SELECT && fd < FD_SETSIZE) {
--- a/OrthancServer/UnitTestsSources/VersionsTests.cpp	Wed Jan 24 16:50:21 2024 +0100
+++ b/OrthancServer/UnitTestsSources/VersionsTests.cpp	Wed Jan 24 17:16:06 2024 +0100
@@ -167,11 +167,11 @@
 #if ORTHANC_ENABLE_SSL == 1
 TEST(Version, OpenSslStatic)
 {
-  // openssl-3.1.0
+  // openssl-3.1.4
   // https://www.openssl.org/docs/man3.0/man3/OPENSSL_VERSION_NUMBER.html
   ASSERT_EQ(3 /* major */ * 0x10000000L +
             1 /* minor */ * 0x00100000L +
-            0 /* patch */ * 0x00000010L, OPENSSL_VERSION_NUMBER);
+            4 /* patch */ * 0x00000010L, OPENSSL_VERSION_NUMBER);
 }
 #endif