From: Oleksandr Stepanov -X (ostepano - SOFTSERVE INC at Cisco) Date: Wed, 27 Aug 2025 19:34:36 +0000 (+0000) Subject: Pull request #4874: ssl: fix unit test for OpenSSL v3+ X-Git-Tag: 3.9.5.0~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=13a80d44d7afd44fdd1aa0ffb689aadf0b6b5cdd;p=thirdparty%2Fsnort3.git Pull request #4874: ssl: fix unit test for OpenSSL v3+ Merge in SNORT/snort3 from ~OSTEPANO/snort3:ssl_utest to master Squashed commit of the following: commit 5b2f280d0734172061d2049c5652a724ce230db9 Author: Oleksandr Stepanov Date: Tue Aug 19 10:31:42 2025 -0400 ssl: fix unit test for OpenSSL v3+ --- diff --git a/src/protocols/test/ssl_protocol_test.cc b/src/protocols/test/ssl_protocol_test.cc index bbf07202c..e6a349053 100644 --- a/src/protocols/test/ssl_protocol_test.cc +++ b/src/protocols/test/ssl_protocol_test.cc @@ -35,7 +35,12 @@ using namespace snort; typedef struct X509_name_entry_st X509_NAME_ENTRY; X509_NAME *X509_get_subject_name(const X509 *a) { return nullptr; } void X509_free(X509* a) { } -int X509_NAME_get_index_by_NID(X509_NAME *name, int nid, int lastpos) { return -1; } +#if OPENSSL_VERSION_NUMBER < 0x30000000L +int X509_NAME_get_index_by_NID(X509_NAME *name, int nid, int lastpos) +#else +int X509_NAME_get_index_by_NID(const X509_NAME *name, int nid, int lastpos) +#endif +{ return -1; } X509_NAME_ENTRY *X509_NAME_get_entry(const X509_NAME *name, int loc) { return nullptr; } ASN1_STRING *X509_NAME_ENTRY_get_data(const X509_NAME_ENTRY *ne) { return nullptr; } const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *x) { return nullptr; }