Commit 9967215e5c for openssl.org

commit 9967215e5c77ed1940eeaa5626ab90414ec119e2
Author: Bob Beck <beck@openssl.org>
Date:   Fri Apr 24 20:19:41 2026 -0600

    Touch the perl miasma in self defense.

    The symbol presence test fails for NO_DEPRECATED
    builds  if you use modern CPP practices for definitions.

    This is the result of my accepting that doing so will be as PTSD
    inducing as walking into my parents bedroom at an inopportune
    time, and fixing it. Better me who has less time left to live
    with the mental trauma than a younger developer.

    Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
    Reviewed-by: Norbert Pocs <norbertp@openssl.org>
    MergeDate: Fri May  1 11:01:46 2026
    (Merged from https://github.com/openssl/openssl/pull/31016)

diff --git a/util/libcrypto.num b/util/libcrypto.num
index a2205681c2..5061b5e5a0 100644
--- a/util/libcrypto.num
+++ b/util/libcrypto.num
@@ -4687,8 +4687,8 @@ X509_CRL_print                          4684	4_0_0	EXIST::FUNCTION:
 X509_REQ_print_ex                       4685	4_0_0	EXIST::FUNCTION:
 X509_REQ_print                          4686	4_0_0	EXIST::FUNCTION:
 X509_NAME_entry_count                   4687	4_0_0	EXIST::FUNCTION:
-X509_NAME_get_text_by_NID               4688	4_0_0	EXIST::FUNCTION:DEPRECATED_4_0
-X509_NAME_get_text_by_OBJ               4689	4_0_0	EXIST::FUNCTION:DEPRECATED_4_0
+X509_NAME_get_text_by_NID               4688	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_4_0
+X509_NAME_get_text_by_OBJ               4689	4_0_0	EXIST::FUNCTION:DEPRECATEDIN_4_0
 X509_NAME_get_index_by_NID              4690	4_0_0	EXIST::FUNCTION:
 X509_NAME_get_index_by_OBJ              4691	4_0_0	EXIST::FUNCTION:
 X509_NAME_get_entry                     4692	4_0_0	EXIST::FUNCTION:
diff --git a/util/perl/OpenSSL/ParseC.pm b/util/perl/OpenSSL/ParseC.pm
index 5749254a84..c2546280c8 100644
--- a/util/perl/OpenSSL/ParseC.pm
+++ b/util/perl/OpenSSL/ParseC.pm
@@ -73,6 +73,22 @@ my @opensslcpphandlers = (
       massager => sub {
           return (<<"EOF");
 #if$1 OPENSSL_NO_DEPRECATEDIN_$2
+EOF
+      }
+    },
+    # Do the same for modern CPP definition tests.
+    { regexp   => qr/#if (\!defined).*OPENSSL_NO_DEPRECATED_(\d+_\d+(?:_\d+)?).*$/,
+      massager => sub {
+          return (<<"EOF");
+#ifndef OPENSSL_NO_DEPRECATEDIN_$2
+EOF
+      }
+    },
+    # Do the same for modern CPP definition tests.
+    { regexp   => qr/#if (defined).*OPENSSL_NO_DEPRECATED_(\d+_\d+(?:_\d+)?).*$/,
+      massager => sub {
+          return (<<"EOF");
+#ifdef OPENSSL_NO_DEPRECATEDIN_$2
 EOF
       }
     }