saprasad / rpms / openssl

Forked from rpms/openssl 3 years ago
Clone
1eb7adc
From 8545e0c4c38934fda47b701043dd5ce89c99fe81 Mon Sep 17 00:00:00 2001
1eb7adc
From: rpm-build <rpm-build>
1eb7adc
Date: Mon, 31 Jul 2023 09:41:28 +0200
1eb7adc
Subject: [PATCH 25/35] 0056-strcasecmp.patch
1eb7adc
1eb7adc
Patch-name: 0056-strcasecmp.patch
1eb7adc
Patch-id: 56
1eb7adc
Patch-status: |
1eb7adc
    # https://github.com/openssl/openssl/pull/18103
1eb7adc
    # The patch is incorporated in 3.0.3 but we provide this function since 3.0.1
1eb7adc
    # so the patch should persist
1eb7adc
From-dist-git-commit: 9409bc7044cf4b5773639cce20f51399888c45fd
1eb7adc
---
1eb7adc
 crypto/o_str.c                         | 14 ++++++++++++--
1eb7adc
 test/recipes/01-test_symbol_presence.t |  1 +
1eb7adc
 util/libcrypto.num                     |  2 ++
1eb7adc
 3 files changed, 15 insertions(+), 2 deletions(-)
1eb7adc
1eb7adc
diff --git a/crypto/o_str.c b/crypto/o_str.c
1eb7adc
index 3354ce0927..95b9538471 100644
1eb7adc
--- a/crypto/o_str.c
1eb7adc
+++ b/crypto/o_str.c
1eb7adc
@@ -342,7 +342,12 @@ int openssl_strerror_r(int errnum, char *buf, size_t buflen)
106fe89
 #endif
106fe89
 }
106fe89
 
106fe89
-int OPENSSL_strcasecmp(const char *s1, const char *s2)
106fe89
+int
106fe89
+#ifndef FIPS_MODULE
106fe89
+__attribute__ ((symver ("OPENSSL_strcasecmp@@OPENSSL_3.0.3"),
106fe89
+                    symver ("OPENSSL_strcasecmp@OPENSSL_3.0.1")))
106fe89
+#endif
106fe89
+OPENSSL_strcasecmp(const char *s1, const char *s2)
106fe89
 {
106fe89
     int t;
106fe89
 
1eb7adc
@@ -352,7 +357,12 @@ int OPENSSL_strcasecmp(const char *s1, const char *s2)
106fe89
     return t;
106fe89
 }
106fe89
 
106fe89
-int OPENSSL_strncasecmp(const char *s1, const char *s2, size_t n)
106fe89
+int
106fe89
+#ifndef FIPS_MODULE
106fe89
+__attribute__ ((symver ("OPENSSL_strncasecmp@@OPENSSL_3.0.3"),
106fe89
+                    symver ("OPENSSL_strncasecmp@OPENSSL_3.0.1")))
106fe89
+#endif
106fe89
+OPENSSL_strncasecmp(const char *s1, const char *s2, size_t n)
106fe89
 {
106fe89
     int t;
106fe89
     size_t i;
1eb7adc
diff --git a/test/recipes/01-test_symbol_presence.t b/test/recipes/01-test_symbol_presence.t
1eb7adc
index 5530ade0ad..238a8d762e 100644
1eb7adc
--- a/test/recipes/01-test_symbol_presence.t
1eb7adc
+++ b/test/recipes/01-test_symbol_presence.t
1eb7adc
@@ -77,6 +77,7 @@ foreach my $libname (@libnames) {
106fe89
                 s| .*||;
106fe89
                 # Drop OpenSSL dynamic version information if there is any
106fe89
                 s|\@\@.+$||;
106fe89
+                s|\@.+$||;
106fe89
                 # Return the result
106fe89
                 $_
106fe89
             }
1eb7adc
diff --git a/util/libcrypto.num b/util/libcrypto.num
1eb7adc
index feb660d030..639074c5d0 100644
1eb7adc
--- a/util/libcrypto.num
1eb7adc
+++ b/util/libcrypto.num
1eb7adc
@@ -5435,6 +5435,8 @@ EVP_MD_CTX_dup                          5562	3_1_0	EXIST::FUNCTION:
1eb7adc
 EVP_CIPHER_CTX_dup                      5563	3_1_0	EXIST::FUNCTION:
1eb7adc
 BN_are_coprime                          5564	3_1_0	EXIST::FUNCTION:
1eb7adc
 OSSL_CMP_MSG_update_recipNonce          5565	3_0_9	EXIST::FUNCTION:CMP
1eb7adc
+OPENSSL_strcasecmp                      ?	3_0_1	EXIST::FUNCTION:
1eb7adc
+OPENSSL_strncasecmp                     ? 	3_0_1	EXIST::FUNCTION:
1eb7adc
 ossl_safe_getenv                        ?	3_0_0	EXIST::FUNCTION:
1eb7adc
 ossl_ctx_legacy_digest_signatures_allowed ?	3_0_1	EXIST::FUNCTION:
1eb7adc
 ossl_ctx_legacy_digest_signatures_allowed_set ?	3_0_1	EXIST::FUNCTION:
1eb7adc
-- 
1eb7adc
2.41.0
1eb7adc