Fix build error with OpenSSL 4 (#2024)

More details here https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1138356
This commit is contained in:
Ravi Kant Sharma
2026-06-29 20:03:27 +02:00
committed by GitHub
parent 2cc7197c38
commit 94bcf919e1
2 changed files with 6 additions and 3 deletions
+2 -2
View File
@@ -306,8 +306,8 @@ typedef enum {
static HostnameValidationResult matches_common_name(const char* hostname,
const X509* server_cert) {
int common_name_loc = -1;
X509_NAME_ENTRY* common_name_entry = nullptr;
ASN1_STRING* common_name_asn1 = nullptr;
const X509_NAME_ENTRY* common_name_entry = nullptr;
const ASN1_STRING* common_name_asn1 = nullptr;
CONST_ASN1_STRING_DATA char* common_name_str = nullptr;
// Find the position of the CN field in the Subject field of the certificate
+4 -1
View File
@@ -129,7 +129,8 @@ void CUtils::GenerateCert(FILE* pOut) {
sEmailAddr += "@";
sEmailAddr += sHostName;
X509_NAME* pName = X509_get_subject_name(pCert.get());
X509_NAME* pName = X509_NAME_new();
if (!pName) return;
X509_NAME_add_entry_by_txt(pName, "OU", MBSTRING_ASC,
(unsigned char*)pLogName, -1, -1, 0);
X509_NAME_add_entry_by_txt(pName, "CN", MBSTRING_ASC,
@@ -137,7 +138,9 @@ void CUtils::GenerateCert(FILE* pOut) {
X509_NAME_add_entry_by_txt(pName, "emailAddress", MBSTRING_ASC,
(unsigned char*)sEmailAddr.c_str(), -1, -1, 0);
X509_set_subject_name(pCert.get(), pName);
X509_set_issuer_name(pCert.get(), pName);
X509_NAME_free(pName);
if (!X509_sign(pCert.get(), pKey.get(), EVP_sha256())) return;