svn commit: r1935449 - in httpd/httpd/branches/2.4.x: . modules/md

[email protected] Wed, 17 Jun 2026 09:48:52 -0000
Newsgroups gmane.comp.apache.cvs
Message-ID <178168973254.2693106.10934459001398587273@svn03-he-fi>
Author: rjung
Date: Wed Jun 17 09:48:52 2026
New Revision: 1935449

Log:
r1935161 | jorton | 2026-06-09 08:44:42 +0200 (Di, 09. Jun 2026) | 13 Zeilen

mod_md: Add OpenSSL 4.0 compatibility:

* Use getters instead of direct member access.

* Struct was made opaque in OpenSSL 4. Getters exist since OpenSSL 1.1.0.

* Keep OpenSSL 1.0.2 compatibility.

Merge from icing/md:
https://github.com/icing/mod_md/commit/9fd90380db0722f0ccc14ff1c4da0ca21d4da75c

Backport of r1935161 from trunk, [mod_md CTR]

Modified:
   httpd/httpd/branches/2.4.x/   (props changed)
   httpd/httpd/branches/2.4.x/CHANGES
   httpd/httpd/branches/2.4.x/modules/md/md_ocsp.c

Modified: httpd/httpd/branches/2.4.x/CHANGES
==============================================================================
--- httpd/httpd/branches/2.4.x/CHANGES	Wed Jun 17 09:44:36 2026	(r1935448)
+++ httpd/httpd/branches/2.4.x/CHANGES	Wed Jun 17 09:48:52 2026	(r1935449)
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.4.69
 
+  *) mod_md: OpenSSL 4 compatibility.
+
   *) pytest_suite: Port of the old PERL test framework to Python
      and pytest. Now included in the source tree under ./test
      [Jim Jagielski]

Modified: httpd/httpd/branches/2.4.x/modules/md/md_ocsp.c
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/md/md_ocsp.c	Wed Jun 17 09:44:36 2026	(r1935448)
+++ httpd/httpd/branches/2.4.x/modules/md/md_ocsp.c	Wed Jun 17 09:48:52 2026	(r1935449)
@@ -533,13 +533,23 @@ static const char *certid_summary(const
     serial = issuer = key = "???";
     OCSP_id_get0_info(&aname_hash, &amd_nid, &akey_hash, &aserial, (OCSP_CERTID*)certid);
     if (aname_hash) {
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
         data.len = (apr_size_t)aname_hash->length;
         data.data = (const char*)aname_hash->data;
+#else
+        data.len = (apr_size_t)ASN1_STRING_length(aname_hash);
+        data.data = (const char*)ASN1_STRING_get0_data(aname_hash);
+#endif
         md_data_to_hex(&issuer, 0, p, &data);
     }
     if (akey_hash) {
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
         data.len = (apr_size_t)akey_hash->length;
         data.data = (const char*)akey_hash->data;
+#else
+        data.len = (apr_size_t)ASN1_STRING_length(akey_hash);
+        data.data = (const char*)ASN1_STRING_get0_data(akey_hash);
+#endif
         md_data_to_hex(&key, 0, p, &data);
     }
     if (aserial) {