]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Pull request #4874: ssl: fix unit test for OpenSSL v3+
authorOleksandr Stepanov -X (ostepano - SOFTSERVE INC at Cisco) <ostepano@cisco.com>
Wed, 27 Aug 2025 19:34:36 +0000 (19:34 +0000)
committerChris Sherwin (chsherwi) <chsherwi@cisco.com>
Wed, 27 Aug 2025 19:34:36 +0000 (19:34 +0000)
Merge in SNORT/snort3 from ~OSTEPANO/snort3:ssl_utest to master

Squashed commit of the following:

commit 5b2f280d0734172061d2049c5652a724ce230db9
Author: Oleksandr Stepanov <ostepano@cisco.com>
Date:   Tue Aug 19 10:31:42 2025 -0400

    ssl: fix unit test for OpenSSL v3+

src/protocols/test/ssl_protocol_test.cc

index bbf07202cac7be4d2c1ebd9282498326917b6d4b..e6a349053d2cb6c666c5faaf95d7fe270bcf9d8a 100644 (file)
@@ -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; }