From nobody Sun Aug 25 13:14:44 2024 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WsDmh5h8yz5SHQC; Sun, 25 Aug 2024 13:14:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WsDmh5708z4cr5; Sun, 25 Aug 2024 13:14:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724591684; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9YYqxTJ/VhrzkbnW0vp1UA70k4cNzsiOzUefwdmE6Rw=; b=yzo4bWQUlMJpvx2YtRdamm7oU9p3iPm2En/CvC+rZXfQicpzTXQLxMhnyCMBw4CdCOkDL1 iZLMbKhL/9cagPhfC9AQqxi0fhjY0Dp3lXDOAMrpuciLKy8tvxkZricwvVZkcXlP+vyGkz bYTMMnDxjTLGz2KcNlbHZoTl5WPcTyjSyYOLnh0NPJ8bRAJ7o+0eyNu6SdrghGPzk4VihB c18Lj2i1+b++iebOTRlwjBTcvQSjneD/stt0/hEeVFmLmncd2XbXJE80imKiZQ/rg2Cc5/ vo+4zvU6moOW8voN5uUbGrFirGPl7/J6n1w6LRX0JofK/2/B8NTM/00rw2i8JQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724591684; a=rsa-sha256; cv=none; b=lDJDfNKHvI0bfPuKHhcVSLAuXplGAhtObvZNDL2Rngib0l9v/PN2ch6DEotzcy8Etp84HB N24LHELowfne6UvzngtEXkQzFTQZqiDEPHpHzrQvBC0+f3XXtGx43r4x4r2TSzFdHNBZOC e3Uejx67lU89xiIeG3RUwfKDiwoY6tDk17npIRK3B3jGGm0lz1J6AdpH6ljlDAtLcU5Z92 qEu/pr57XW8zH9F+o8HqaKopn9BX0ygVYQo0nRLUeLvGz5ZorihJ4d7xTKS1i9HIGQN1jj 27HCBya2zJUf1oW++w9E0CxxeulOgKKi7Rhipkdj2k/5ByWUyJoQaIS0S7JMrw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724591684; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9YYqxTJ/VhrzkbnW0vp1UA70k4cNzsiOzUefwdmE6Rw=; b=nFcrFxlzzVrfDUVMlC+VUaIsObd4HWt6Ak7YvzjLOzFszKBcWN+vDj3iQpsngZBk4M8xtH 7JafkuqAboNmIoB7QMqswDMpQACZG+bFawTl472UDf3ojES7r6Byz+uexojmkfDaBJ2PoM MceOW5QuuhDJk9EFS2+lAisMeIY2odcILqnP2lADHYB7VJvXyLHyI7Lno55ZRxDbOle5V2 kbqAu8KtX0eSUz18Mqvzh5kjewaueaCp498lqz3r92433jmvIxp060gXYSWg3lvPFPrwEi DYq4ehtesxGl7J+XThpAz6YJmggeFWpVfSPc88yo5XSXfuICd3/45bnHTSu5ag== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WsDmh4jjCzNbP; Sun, 25 Aug 2024 13:14:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47PDEiTY007468; Sun, 25 Aug 2024 13:14:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47PDEiEX007465; Sun, 25 Aug 2024 13:14:44 GMT (envelope-from git) Date: Sun, 25 Aug 2024 13:14:44 GMT Message-Id: <202408251314.47PDEiEX007465@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Daniel Engberg Subject: git: db203a9d7a6d - main - security/libpki: Fix build with libxml2 2.13 List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-main@freebsd.org Sender: owner-dev-commits-ports-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: diizzy X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: db203a9d7a6ddbf29c75006f6126e5e6274e85fa Auto-Submitted: auto-generated The branch main has been updated by diizzy: URL: https://cgit.FreeBSD.org/ports/commit/?id=db203a9d7a6ddbf29c75006f6126e5e6274e85fa commit db203a9d7a6ddbf29c75006f6126e5e6274e85fa Author: Bruno Damour AuthorDate: 2024-08-25 13:13:07 +0000 Commit: Daniel Engberg CommitDate: 2024-08-25 13:13:22 +0000 security/libpki: Fix build with libxml2 2.13 Backports from upstream repo and adapted to current release PR: 279954 --- security/libpki/Makefile | 2 +- security/libpki/files/patch-src_pki__config.c | 22 ++++ security/libpki/files/patch-src_pki__x509.c | 181 ++++++++++++++++++++++++++ 3 files changed, 204 insertions(+), 1 deletion(-) diff --git a/security/libpki/Makefile b/security/libpki/Makefile index f09f9d9ef067..1fc399318268 100644 --- a/security/libpki/Makefile +++ b/security/libpki/Makefile @@ -1,7 +1,7 @@ PORTNAME= libpki DISTVERSIONPREFIX= v DISTVERSION= 0.9.2 -PORTREVISION= 5 +PORTREVISION= 6 CATEGORIES= security PATCH_SITES= https://github.com/openca/libpki/commit/ diff --git a/security/libpki/files/patch-src_pki__config.c b/security/libpki/files/patch-src_pki__config.c new file mode 100644 index 000000000000..776340729adf --- /dev/null +++ b/security/libpki/files/patch-src_pki__config.c @@ -0,0 +1,22 @@ +--- src/pki_config.c.orig 2024-08-12 07:36:06.493686000 +0200 ++++ src/pki_config.c 2024-08-12 07:40:19.265530000 +0200 +@@ -17,6 +17,7 @@ + + #define PKI_DEF_CONF_DIRS_SIZE 2 + #define LIBXML_MIN_VERSION 20600 ++#define LIBXML_212_VERSION 21200 + + #if LIBXML_VERSION < LIBXML_MIN_VERSION + #define xmlErrorPtr void * +@@ -30,7 +31,11 @@ + #endif + */ + ++#if LIBXML_VERSION >= LIBXML_212_VERSION ++void logXmlMessages( void *userData, const xmlError *error ) { ++#else + void logXmlMessages( void *userData, xmlErrorPtr error ) { ++#endif + #if LIBXML_VERSION >= LIBXML_MIN_VERSION + PKI_log_err( "XML I/O Error: %s", error->message); + #else diff --git a/security/libpki/files/patch-src_pki__x509.c b/security/libpki/files/patch-src_pki__x509.c new file mode 100644 index 000000000000..945c19397d39 --- /dev/null +++ b/security/libpki/files/patch-src_pki__x509.c @@ -0,0 +1,181 @@ +--- src/pki_x509.c 2024-08-14 14:45:55 +0000 ++++ ../libpki-0.9.2-patched/src/pki_x509.c 2024-08-14 15:08:49 +0000 +@@ -33,22 +33,75 @@ + { NULL, -1 } + }; + +-PKI_TBS_ASN1 * __datatype_get_asn1_ref(PKI_DATATYPE type, +- const void * v) { ++const ASN1_ITEM * _get_ossl_item(PKI_DATATYPE type) { ++ ++ const ASN1_ITEM * it = NULL; ++ ++ // Gets the ASN1_ITEM * needed to get the tbSigned ++ switch (type) { ++ ++ case PKI_DATATYPE_X509_CERT : { ++ it = ASN1_ITEM_rptr(X509_CINF); ++ } break; ++ ++ case PKI_DATATYPE_X509_CRL : { ++ it = ASN1_ITEM_rptr(X509_CRL_INFO); ++ } break; ++ ++ case PKI_DATATYPE_X509_REQ : { ++ it = ASN1_ITEM_rptr(X509_REQ_INFO); ++ } break; ++ ++ case PKI_DATATYPE_X509_OCSP_REQ : { ++ it = ASN1_ITEM_rptr(OCSP_REQINFO); ++ } break; ++ ++ case PKI_DATATYPE_X509_OCSP_RESP : { ++ it = ASN1_ITEM_rptr(OCSP_RESPDATA); ++ } break; ++ ++ case PKI_DATATYPE_X509_PRQP_REQ : { ++ it = ASN1_ITEM_rptr(PKI_PRQP_REQ); ++ } break; ++ ++ case PKI_DATATYPE_X509_PRQP_RESP : { ++ it = ASN1_ITEM_rptr(PKI_PRQP_RESP); ++ } break; ++ ++ case PKI_DATATYPE_X509_CMS : { ++ it = ASN1_ITEM_rptr(CMS_ContentInfo); ++ } break; ++ ++ case PKI_DATATYPE_X509_KEYPAIR: { ++ it = NULL; ++ } break; ++ ++ default: { ++ PKI_DEBUG("Datatype Not Supported (Type: %d)", type); ++ return NULL; ++ } ++ } ++ ++ // Return the Pointer ++ return it; ++ ++} ++ ++PKI_TBS_ASN1 * __datatype_get_asn1_ref(PKI_DATATYPE type, ++ const void * v) { + + PKI_TBS_ASN1 * ret = NULL; + const ASN1_ITEM * it = NULL; + const void * p = NULL; + ++ if ((it = _get_ossl_item(type)) == NULL) { ++ return NULL; ++ } ++ + // Gets the ASN1_ITEM * needed to get the tbSigned + switch (type) { + + case PKI_DATATYPE_X509_CERT : { +-#if OPENSSL_VERSION_NUMBER >= 0x30000000L +- it = (ASN1_ITEM *) X509_CINF_it; +-#else +- it = &X509_CINF_it; +-#endif + #if OPENSSL_VERSION_NUMBER > 0x1010000fL + p = &(((LIBPKI_X509_CERT *)v)->cert_info); + #else +@@ -57,11 +110,6 @@ + } break; + + case PKI_DATATYPE_X509_CRL : { +-#if OPENSSL_VERSION_NUMBER >= 0x30000000L +- it = (ASN1_ITEM *) X509_CRL_INFO_it; +-#else +- it = &X509_CRL_INFO_it; +-#endif + #if OPENSSL_VERSION_NUMBER > 0x1010000fL + p = &(((PKI_X509_CRL_VALUE *)v)->crl); + #else +@@ -70,11 +118,6 @@ + } break; + + case PKI_DATATYPE_X509_REQ : { +-#if OPENSSL_VERSION_NUMBER >= 0x30000000L +- it = (ASN1_ITEM *) X509_REQ_INFO_it; +-#else +- it = &X509_REQ_INFO_it; +-#endif + #if OPENSSL_VERSION_NUMBER > 0x1010000fL + p = &(((LIBPKI_X509_REQ *)v)->req_info); + #else +@@ -83,11 +126,6 @@ + } break; + + case PKI_DATATYPE_X509_OCSP_REQ : { +-#if OPENSSL_VERSION_NUMBER >= 0x30000000L +- it = (ASN1_ITEM *) OCSP_REQINFO_it; +-#else +- it = &OCSP_REQINFO_it; +-#endif + #if OPENSSL_VERSION_NUMBER > 0x1010000fL + p = &(((PKI_X509_OCSP_REQ_VALUE *)v)->tbsRequest); + #else +@@ -96,11 +134,6 @@ + } break; + + case PKI_DATATYPE_X509_OCSP_RESP : { +-#if OPENSSL_VERSION_NUMBER >= 0x30000000L +- it = (ASN1_ITEM *) OCSP_RESPDATA_it; +-#else +- it = &OCSP_RESPDATA_it; +-#endif + #if OPENSSL_VERSION_NUMBER > 0x1010000fL + p = &(((PKI_OCSP_RESP *)v)->bs->tbsResponseData); + #else +@@ -109,29 +142,14 @@ + } break; + + case PKI_DATATYPE_X509_PRQP_REQ : { +-#if OPENSSL_VERSION_NUMBER >= 0x30000000L +- it = (ASN1_ITEM *) PKI_PRQP_REQ_it; +-#else +- it = &PKI_PRQP_REQ_it; +-#endif + p = ((PKI_X509_PRQP_REQ_VALUE *)v)->requestData; + } break; + + case PKI_DATATYPE_X509_PRQP_RESP : { +-#if OPENSSL_VERSION_NUMBER >= 0x30000000L +- it = (ASN1_ITEM *) PKI_PRQP_RESP_it; +-#else +- it = &PKI_PRQP_RESP_it; +-#endif + p = ((PKI_X509_PRQP_RESP_VALUE *)v)->respData; + } break; + + case PKI_DATATYPE_X509_CMS : { +-#if OPENSSL_VERSION_NUMBER >= 0x30000000L +- it = (ASN1_ITEM *) CMS_ContentInfo_it; +-#else +- it = &CMS_ContentInfo_it; +-#endif + p = NULL; + } + +@@ -156,6 +174,7 @@ + + } + ++ + /*! \brief Returns the callbacks for a specific PKI_DATATYPE */ + + const PKI_X509_CALLBACKS *PKI_X509_CALLBACKS_get (PKI_DATATYPE type, +@@ -213,6 +232,9 @@ + // Internal Status + ret->status = -1; + ++ // Internal conversion pointer ++ ret->it = _get_ossl_item(type); ++ + // All Done + return ret; + }