File 0056-strcasecmp.patch of Package openssl

From 23ef870d2ce22b3c0192d3a3a906df80156b66b8 Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Mon, 8 Jul 2024 11:55:35 +0200
Subject: [PATCH 24/51] 0056-strcasecmp.patch

Patch-name: 0056-strcasecmp.patch
Patch-id: 56
Patch-status: |
    # Originally from https://github.com/openssl/openssl/pull/18103
    # As we rebased to 3.0.7 and used the version of the function
    # not matching the upstream one, we have to use aliasing.
    # When we eliminate this patch, the `-Wl,--allow-multiple-definition`
    # should also be removed
From-dist-git-commit: 892d8e1abb3cd458aae76570c04eb8ae4cf49873
---
 crypto/o_str.c                         | 14 ++++++++++++--
 test/recipes/01-test_symbol_presence.t |  1 +
 util/libcrypto.num                     |  2 ++
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/crypto/o_str.c b/crypto/o_str.c
index 065460336f..2ecf449b39 100644
--- a/crypto/o_str.c
+++ b/crypto/o_str.c
@@ -336,7 +336,12 @@ int openssl_strerror_r(int errnum, char *buf, size_t buflen)
 #endif
 }
 
-int OPENSSL_strcasecmp(const char *s1, const char *s2)
+int
+#if !defined(FIPS_MODULE) && !defined(OPENSSL_SYS_UEFI)
+__attribute__ ((symver ("OPENSSL_strcasecmp@@OPENSSL_3.0.3"),
+                    symver ("OPENSSL_strcasecmp@OPENSSL_3.0.1")))
+#endif
+OPENSSL_strcasecmp(const char *s1, const char *s2)
 {
     int t;
 
@@ -346,7 +351,12 @@ int OPENSSL_strcasecmp(const char *s1, const char *s2)
     return t;
 }
 
-int OPENSSL_strncasecmp(const char *s1, const char *s2, size_t n)
+int
+#if !defined(FIPS_MODULE) && !defined(OPENSSL_SYS_UEFI)
+__attribute__ ((symver ("OPENSSL_strncasecmp@@OPENSSL_3.0.3"),
+                    symver ("OPENSSL_strncasecmp@OPENSSL_3.0.1")))
+#endif
+OPENSSL_strncasecmp(const char *s1, const char *s2, size_t n)
 {
     int t;
     size_t i;
diff --git a/test/recipes/01-test_symbol_presence.t b/test/recipes/01-test_symbol_presence.t
index 222b1886ae..84c76d29a1 100644
--- a/test/recipes/01-test_symbol_presence.t
+++ b/test/recipes/01-test_symbol_presence.t
@@ -131,6 +131,7 @@ foreach (sort keys %stlibname) {
                   s| .*||;
                   # Drop OpenSSL dynamic version information if there is any
                   s|\@\@.+$||;
+                  s|\@.+$||;
                   # Return the result
                   $_
               }
diff --git a/util/libcrypto.num b/util/libcrypto.num
index 8046454025..bb99b1e2a4 100644
--- a/util/libcrypto.num
+++ b/util/libcrypto.num
@@ -5536,5 +5536,7 @@ X509_STORE_CTX_set_get_crl              5663	3_2_0	EXIST::FUNCTION:
 X509_STORE_CTX_set_current_reasons      5664	3_2_0	EXIST::FUNCTION:
 OSSL_STORE_delete                       5665	3_2_0	EXIST::FUNCTION:
 BIO_ADDR_copy                           5666	3_2_0	EXIST::FUNCTION:SOCK
+OPENSSL_strcasecmp                      ?	3_0_1	EXIST::FUNCTION:
+OPENSSL_strncasecmp                     ? 	3_0_1	EXIST::FUNCTION:
 ossl_ctx_legacy_digest_signatures_allowed ?	3_0_1	EXIST::FUNCTION:
 ossl_ctx_legacy_digest_signatures_allowed_set ?	3_0_1	EXIST::FUNCTION:
-- 
2.41.0

openSUSE Build Service is sponsored by