Skip to content
This repository was archived by the owner on Jun 9, 2026. It is now read-only.

Commit 9fd9038

Browse files
authored
Openssl 4 compat (#427)
* Use getters instead of direct member access. Struct was made opaque in OpenSSL 4. Getters exist since OpenSSL 1.1.0. * Update ChangeLog * Keep OpenSSL 1.0.2 compatibility.
1 parent 41496f9 commit 9fd9038

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
* OpenSSL 4 compatibility.
12
* Allow the MDHttpProxy setting to be set per MDomain. The global MDHttpProxy
23
setting is used by default. [Michael Kaufmann]
34

src/md_ocsp.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,13 +519,23 @@ static const char *certid_summary(const OCSP_CERTID *certid, apr_pool_t *p)
519519
serial = issuer = key = "???";
520520
OCSP_id_get0_info(&aname_hash, &amd_nid, &akey_hash, &aserial, (OCSP_CERTID*)certid);
521521
if (aname_hash) {
522+
#if OPENSSL_VERSION_NUMBER < 0x10100000L
522523
data.len = (apr_size_t)aname_hash->length;
523524
data.data = (const char*)aname_hash->data;
525+
#else
526+
data.len = (apr_size_t)ASN1_STRING_length(aname_hash);
527+
data.data = (const char*)ASN1_STRING_get0_data(aname_hash);
528+
#endif
524529
md_data_to_hex(&issuer, 0, p, &data);
525530
}
526531
if (akey_hash) {
532+
#if OPENSSL_VERSION_NUMBER < 0x10100000L
527533
data.len = (apr_size_t)akey_hash->length;
528534
data.data = (const char*)akey_hash->data;
535+
#else
536+
data.len = (apr_size_t)ASN1_STRING_length(akey_hash);
537+
data.data = (const char*)ASN1_STRING_get0_data(akey_hash);
538+
#endif
529539
md_data_to_hex(&key, 0, p, &data);
530540
}
531541
if (aserial) {

0 commit comments

Comments
 (0)