From 26ca3c7462ca4a7e93496aacc5a234fdb0342c4a Mon Sep 17 00:00:00 2001 From: James Chapman Date: Tue, 13 Aug 2024 12:37:03 +0100 Subject: [PATCH] fix: attempt to fix non-patched OpenSSL unit tests Signed-off-by: James Chapman --- lib/staging/tls/extensions/status_request.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/staging/tls/extensions/status_request.cpp b/lib/staging/tls/extensions/status_request.cpp index 8a47f381be..ff8f12bc46 100644 --- a/lib/staging/tls/extensions/status_request.cpp +++ b/lib/staging/tls/extensions/status_request.cpp @@ -554,7 +554,6 @@ int ClientStatusRequestV2::status_request_v2_add(SSL* ctx, unsigned int ext_type static const std::uint8_t asn1[] = {0x00, 0x07, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00}; *out = &asn1[0]; *outlen = sizeof(asn1); -#ifdef OPENSSL_PATCHED /* * ensure client callback is called - SSL_set_tlsext_status_type() needs to have a value * TLSEXT_STATUSTYPE_ocsp_multi for status_request_v2, or @@ -562,9 +561,12 @@ int ClientStatusRequestV2::status_request_v2_add(SSL* ctx, unsigned int ext_type */ if (SSL_get_tlsext_status_type(ctx) != TLSEXT_STATUSTYPE_ocsp) { +#ifdef OPENSSL_PATCHED SSL_set_tlsext_status_type(ctx, TLSEXT_STATUSTYPE_ocsp_multi); - } +#else + SSL_set_tlsext_status_type(ctx, 2); #endif // OPENSSL_PATCHED + } result = 1; } return result;