mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-08-31 03:45:41 +00:00
znc: fix build with OpenSSL 4.0
OpenSSL 4.0 adds const qualifiers to X509_NAME and ASN1_STRING returns. Backport upstream fix. Upstream-Status: Backport [https://github.com/znc/znc/commit/c6b7fece1ec3] Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech> Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
This commit is contained in:
committed by
Khem Raj
parent
2e8eba02ec
commit
bc4eee367c
@@ -0,0 +1,51 @@
|
||||
From c6b7fece1ec318c67ed8afa80ef914a135180a4f Mon Sep 17 00:00:00 2001
|
||||
From: Ravi Kant Sharma <ravi.kant.sharma@canonical.com>
|
||||
Date: Tue, 16 Jun 2026 10:08:17 +0200
|
||||
Subject: [PATCH] Fix build error with OpenSSL 4
|
||||
|
||||
Upstream-Status: Backport [https://github.com/znc/znc/commit/c6b7fece1ec3]
|
||||
Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
|
||||
---
|
||||
src/SSLVerifyHost.cpp | 4 ++--
|
||||
src/Utils.cpp | 5 ++++-
|
||||
2 files changed, 6 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/SSLVerifyHost.cpp b/src/SSLVerifyHost.cpp
|
||||
index ccc20898e2..99b215bc23 100644
|
||||
--- a/src/SSLVerifyHost.cpp
|
||||
+++ b/src/SSLVerifyHost.cpp
|
||||
@@ -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
|
||||
diff --git a/src/Utils.cpp b/src/Utils.cpp
|
||||
index ed2c9c8386..744f61d195 100644
|
||||
--- a/src/Utils.cpp
|
||||
+++ b/src/Utils.cpp
|
||||
@@ -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;
|
||||
|
||||
@@ -4,7 +4,9 @@ LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
|
||||
|
||||
DEPENDS = "zlib"
|
||||
SRC_URI = "gitsm://github.com/znc/znc.git;branch=master;protocol=https;tag=${BP}"
|
||||
SRC_URI = "gitsm://github.com/znc/znc.git;branch=master;protocol=https;tag=${BP} \
|
||||
file://0001-Fix-build-error-with-OpenSSL-4.patch \
|
||||
"
|
||||
|
||||
SRCREV = "59af2206c62724eec0d8c43d3c1c0b70610ca1d9"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user