Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: attempt to fix non-patched OpenSSL unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: James Chapman <james.chapman@pionix.de>
james-ctc committed Aug 13, 2024
1 parent bc649ea commit 26ca3c7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/staging/tls/extensions/status_request.cpp
Original file line number Diff line number Diff line change
@@ -554,17 +554,19 @@ 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
* TLSEXT_STATUSTYPE_ocsp for status_request and status_request_v2
*/

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;

0 comments on commit 26ca3c7

Please sign in to comment.