saprasad / rpms / openssl

Forked from rpms/openssl 3 years ago
Clone
Blob Blame History Raw
From 8545e0c4c38934fda47b701043dd5ce89c99fe81 Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Mon, 31 Jul 2023 09:41:28 +0200
Subject: [PATCH 25/35] 0056-strcasecmp.patch

Patch-name: 0056-strcasecmp.patch
Patch-id: 56
Patch-status: |
    # https://github.com/openssl/openssl/pull/18103
    # The patch is incorporated in 3.0.3 but we provide this function since 3.0.1
    # so the patch should persist
From-dist-git-commit: 9409bc7044cf4b5773639cce20f51399888c45fd
---
 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 3354ce0927..95b9538471 100644
--- a/crypto/o_str.c
+++ b/crypto/o_str.c
@@ -342,7 +342,12 @@ int openssl_strerror_r(int errnum, char *buf, size_t buflen)
 #endif
 }
 
-int OPENSSL_strcasecmp(const char *s1, const char *s2)
+int
+#ifndef FIPS_MODULE
+__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;
 
@@ -352,7 +357,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
+#ifndef FIPS_MODULE
+__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 5530ade0ad..238a8d762e 100644
--- a/test/recipes/01-test_symbol_presence.t
+++ b/test/recipes/01-test_symbol_presence.t
@@ -77,6 +77,7 @@ foreach my $libname (@libnames) {
                 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 feb660d030..639074c5d0 100644
--- a/util/libcrypto.num
+++ b/util/libcrypto.num
@@ -5435,6 +5435,8 @@ EVP_MD_CTX_dup                          5562	3_1_0	EXIST::FUNCTION:
 EVP_CIPHER_CTX_dup                      5563	3_1_0	EXIST::FUNCTION:
 BN_are_coprime                          5564	3_1_0	EXIST::FUNCTION:
 OSSL_CMP_MSG_update_recipNonce          5565	3_0_9	EXIST::FUNCTION:CMP
+OPENSSL_strcasecmp                      ?	3_0_1	EXIST::FUNCTION:
+OPENSSL_strncasecmp                     ? 	3_0_1	EXIST::FUNCTION:
 ossl_safe_getenv                        ?	3_0_0	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