From patchwork Mon Nov 2 14:17:04 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 5553 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:6022:3119:b0:118:2077:975e with SMTP id e25csp5469117laa; Mon, 2 Nov 2026 06:17:26 -0800 (PST) X-Forwarded-Encrypted: i=2; AKwUvBzhKC+SDN4GgJHWVe6FnW2KjbeF/mNpMynA/A4dAAdVXy6CU7+uVMZn+SrY2xsWxXStrRNxCs04Xoc=@openvpn.net X-Received: by 2002:a05:7023:a42:b0:151:ece6:b16b with SMTP id a92af1059eb24-1ac5da755bdmr13829411c88.7.1793629045978; Mon, 02 Nov 2026 06:17:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1793629045; cv=none; d=google.com; s=arc-20260327; b=dk9E2wAvCM5YTFrlpLLPVykZswMmu5irUG1oqmONMz67Be4qDzdSkkepDW4m+SS0zx 28XEXm+63Cq6Q4T3x3xLUVPH2k4lUtzhj+VXoHVL9vbRIrLXMcXIMvLVWAUqLL9ycU1r y5MYaW9WxI2q0Mi3uLFFGAxW4YRlBt/YB5aHXqW4CJMdvY5WA6X9TcbmoycFxzmhYEPK FdhGx+77QNAQHBMcRvwn0cMMjRO41wPZSM90XwyvUw9LqSlY9KifQmGtKoRIKt1yb/V2 x6pnVy7Pnv6MibEmq8rdsUOvVcOceST36hOy1Qbmzf7SyONDIo0xu2iVd3fVeo9TRgAP D1Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature:dkim-signature; bh=OsMx1vSL1G9ROg0nJsVolOiksyys4O4XInoa6z0YU20=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=rhVqcmapIBZfc/BJzqznPmBGf66p4g3NgaKebu1H3VcH0k8S4uHCaY9xeRCxgiBTpF THWBwfRkChahb/nYd6vC7GBsyLkESwoT0X4CWrwwce1SX/hC53aNxo9WqtnD6enG1BwT YOsT3U6895GqvEu9Vl9E+PQn8MpCmVHNZnh+PEF6tezOHUZtONYvINdt990Kg2gIzca8 KFf7Rn8sC3vEdCck/qb/t/3so44FcZ45ElJG5j1KFya/EtnV3yU1NDQjrM3Ds0+OziUQ y4prUzF9nU3iByBy/gEakhrFS2GELe7vG9KrM8hthv3bvwgFEL2jPUk8KcvdR9XCQ24a xDEQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=lU2pEAL9; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=gOrCO9K5; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=G1nhM75G; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id a92af1059eb24-1ac19795d21si29986392c88.49.2026.11.02.06.17.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Nov 2026 06:17:25 -0800 (PST) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=lU2pEAL9; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=gOrCO9K5; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=G1nhM75G; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Unsubscribe-Post: List-Owner; bh=OsMx1vSL1G9ROg0nJsVolOiksyys4O4XInoa6z0YU20=; b=lU2pEAL9Bwezlq bg/13m5oRSO/Wm4bqULcg5+Ccij7kAc5n7Q/WTLF+8B4l6XExcsuxZc5wrNrbIMMwySOhaRHs6j3O hvd5C7FLCTZrgFDa8QpFEjRyEdP6KsldR+eC0XqeQFktF8xdhP3FB2rfBwHLVgsMB+1wOxZ7Dq8An qtU=; Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.100.1) (envelope-from ) id 1xNsqh-000000005Dz-2diA; Mon, 02 Nov 2026 14:17:23 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.100.1) (envelope-from ) id 1xNsqf-000000005Dq-2PPe for openvpn-devel@lists.sourceforge.net; Mon, 02 Nov 2026 14:17:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Unsubscribe-Post:List-Subscribe:List-Post:List-Owner:List-Archive; bh=GMkhp7T0/8xFLaxgOcXP+dDMGriCla2eZILKMxnm3Io=; b=gOrCO9K5ZrZ8fLTRaSf/OZQrHd Woq1VuxUYNFlF29Trirql38geq9Jw7Hr5NEc++rGdIOjfofu/k7VMRprj55QdFBFX26J8WRxEPtG6 U672QoZp/19QJZ3Rn5eaNtCVKqXOYSw/7EncbVWjeJRWKnFhqElKF4CGPxMkPpHIxW58=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Unsubscribe-Post: List-Subscribe:List-Post:List-Owner:List-Archive; bh=GMkhp7T0/8xFLaxgOcXP+dDMGriCla2eZILKMxnm3Io=; b=G1nhM75G1MZJubw/7J5+oH3hzf MtNaM2yEcW/4aAhtDC1zOApOB4piuTWgoqvojwq9NAQZaCYZ1Yxn0e490G8X9miHasvbeXxiUfZ8w lY2gPT7QhkTr+tzGBkU+p1jaq64GH7QHsWB7J2ejL+kiYUvT7j27eChwajp/wchg4yrY=; Received: from [193.149.48.129] (helo=blue.greenie.muc.de) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.100.1) id 1xNsqa-000000001KZ-38zp for openvpn-devel@lists.sourceforge.net; Mon, 02 Nov 2026 14:17:21 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.18.1/8.18.1) with ESMTP id 6A2EHAIL030034 for ; Mon, 2 Nov 2026 15:17:10 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.2/8.18.1/Submit) id 6A2EHAeE030033 for openvpn-devel@lists.sourceforge.net; Mon, 2 Nov 2026 15:17:10 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Mon, 2 Nov 2026 15:17:04 +0100 Message-ID: <20261102141709.30018-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.55.0 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "sfi-spamd-1.hosts.colo.sdot.me", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Arne Schwabe OpenSSL 4.1 introduced ASN1_STRING_get_length and at the same time deprecated the ASN1_STRING_length method. Use the new method and keep and compat macro for older versions and other OpenSSL like libr [...] Content analysis details: (1.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Headers-End: 1xNsqa-000000001KZ-38zp Subject: [Openvpn-devel] [PATCH v2] Use ASN1_STRING_get_length instead of ASN1_STRING_length X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: 1880756370386833063 X-GMAIL-MSGID: 1880756370386833063 From: Arne Schwabe OpenSSL 4.1 introduced ASN1_STRING_get_length and at the same time deprecated the ASN1_STRING_length method. Use the new method and keep and compat macro for older versions and other OpenSSL like libraries. Change-Id: I1bff3107f95b403d554bea4262c2dda270a1fc79 Signed-off-by: Arne Schwabe Acked-by: Razvan Cojocaru Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2087 --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2087 This mail reflects revision 2 of this Change. Acked-by according to Gerrit (reflected above): Razvan Cojocaru diff --git a/src/openvpn/openssl_compat.h b/src/openvpn/openssl_compat.h index 4305fea..8309cee 100644 --- a/src/openvpn/openssl_compat.h +++ b/src/openvpn/openssl_compat.h @@ -204,4 +204,9 @@ #define EVP_CIPH_FLAG_ENC_THEN_MAC 0x10000000 #endif +/* Introduced in OpenSSL 4.1.0 */ +#if OPENSSL_VERSION_NUMBER < 0x40100000 +#define ASN1_STRING_get_length (size_t)ASN1_STRING_length +#endif + #endif /* OPENSSL_COMPAT_H_ */ diff --git a/src/openvpn/ssl_verify_openssl.c b/src/openvpn/ssl_verify_openssl.c index 146a384..0c36cf2 100644 --- a/src/openvpn/ssl_verify_openssl.c +++ b/src/openvpn/ssl_verify_openssl.c @@ -154,7 +154,7 @@ { continue; } - if ((ssize_t)strlen(buf) != ASN1_STRING_length(name->d.rfc822Name)) + if (strlen(buf) != ASN1_STRING_get_length(name->d.rfc822Name)) { msg(D_TLS_ERRORS, "ASN1 ERROR: string contained terminating zero"); }