From patchwork Mon Feb 16 15:07:05 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4766 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7001:ab03:b0:838:aef6:1aff with SMTP id xi3csp7072mab; Mon, 16 Feb 2026 07:07:23 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWHykLF6PgLiuOcUcit28kd0H7aLgbi2OGkpVjlz9+PqCX3SzeeZDXVPIAphOwUvYKtsdtvBtDTz90=@openvpn.net X-Received: by 2002:a05:6808:c1aa:b0:462:a915:31aa with SMTP id 5614622812f47-4639f2b7054mr6478164b6e.63.1771254443654; Mon, 16 Feb 2026 07:07:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1771254443; cv=none; d=google.com; s=arc-20240605; b=GDkOfF80Z763rro72KWtkX3PvF2elMa14l15IKPHXhlSqQE4awv/AskuoVhpUiyfPD CUxIqTSTzWo05wRnauKfmOrdlvOKZLVpl42fpVklUYuZNrk335I6KL4xUaWajPh3OFgr vEmR/Y6ct+cxOO8b7BJRkXdF+s0dH99Ycfzpa/zKg2zeQtKbZlLeKJfD3gIPy17xfIsB kWNJidC6YuafZpDDYnPalAjrgae8BJ0VAaF20ueq1/gxGCQ96RHBr+/OwgN9LiyBlRxC EhpaHISIn8uh9eTf5LElWtgbRaoEgi1hcFPjrvTa6RHkwCaz3YEnAQaqmbyETLMEsQSk ljyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=PVcsPWAiX7FIByNBtKTkbSX72OKrML6/0ksLr1Zrj9M=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=TnMzG9s0Lpan23eToM7GsAHPEPi/NrN7GJuLJKE9syg2BdCiBIreO1ljjjG47KJIdU 5EwnLLiXmWUNDjn+G7cDLOJGPggpIGegdobIuVaEfLvAuIvb9fP3WGWPGVYPigkAgmsh yVJ6QMUgoxrtN/S1KUnK0EGZ4qSHKg1FNat9OniiMp1aVfAaHJnc2+O/P0VcPpKB6YtI +mce80ftHD9bRGEXuDsdlGi3YjnnnmR0zueaDZn1HxtBR1b+RR8eDLI72VaJ4X8cVGZP dfdA2Z2ZhtkFy63HfvEDEn+9XOHSD1k6l2Pk6FPw6t+DiNepJcEBZ7rH9OmOXeDRYWZg PKgw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=aTWp70XY; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=SIgdOwJM; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=UGjYMwi6; 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 586e51a60fabf-40ef325bc8fsi7236238fac.171.2026.02.16.07.07.23 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Feb 2026 07:07:23 -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=aTWp70XY; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=SIgdOwJM; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=UGjYMwi6; 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-Owner; bh=PVcsPWAiX7FIByNBtKTkbSX72OKrML6/0ksLr1Zrj9M=; b=aTWp70XYCViaSr83mR/RO6/tOq kDQaiSqfDTVpghxy8tQSeqECIAz+cOpk0rMNYGNcXZXQemLDrU6DW3QdPTEPm2U2nIAtH50+1cR31 9+FQTXdz9EVZDuIUv2ie5uIS+jWAT7qkLrEwkf7loleaufWJHH8sYpJ+RJzurbOPbUiI=; 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.95) (envelope-from ) id 1vs0C1-0004Z6-Bv; Mon, 16 Feb 2026 15:07:21 +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.95) (envelope-from ) id 1vs0C0-0004Z0-Ah for openvpn-devel@lists.sourceforge.net; Mon, 16 Feb 2026 15:07:20 +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-Subscribe:List-Post:List-Owner:List-Archive; bh=k4QwqSTxhitTDKV/FMLey5ZNt0tMB00eLuZEVKft8tI=; b=SIgdOwJMFIKy1/dvhSNKMRcwcg sAP+h9CKcmaBYDHritgrv6rN6H5u8kLGkA1LS9WTkrWh2aXOb2CjP/OCDCoofwien7AkTzxhCz8ft KZ8PucCNThLJpUnfHYFlUV2oKpq5Qgx8vS5oGbCsDYvPHzupHDUL7CLgCzvKyz0PvPW4=; 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-Subscribe: List-Post:List-Owner:List-Archive; bh=k4QwqSTxhitTDKV/FMLey5ZNt0tMB00eLuZEVKft8tI=; b=UGjYMwi6NTToANNlpZqDxaU6Nr wrqCsXtoSoIoxpzYHcFgj5ZCkL0b6v7IPnaakVtxNKBVDgE32hrIPZ1ljdMDY9T93MHMrCuqiVclb 3B06mUx3ssynFzaJMQ5ExMU+ixIuDKn6UknqU7QvD+MC52yCPdEaNc0rsBqaE1lmcM5g=; 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.95) id 1vs0Bz-0008No-9f for openvpn-devel@lists.sourceforge.net; Mon, 16 Feb 2026 15:07:20 +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 61GF7B2l016146 for ; Mon, 16 Feb 2026 16:07:11 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.1/8.18.1/Submit) id 61GF7BfV016145 for openvpn-devel@lists.sourceforge.net; Mon, 16 Feb 2026 16:07:11 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Mon, 16 Feb 2026 16:07:05 +0100 Message-ID: <20260216150711.16130-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.52.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-2.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: Frank Lichtenheld Change-Id: I201abb9ef013c061fb568823098edcca32cb2df3 Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/open [...] Content analysis details: (1.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_DNSWL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to DNSWL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#DnsBlocklists-dnsbl-block for more information. [193.149.48.129 listed in list.dnswl.org] 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Headers-End: 1vs0Bz-0008No-9f Subject: [Openvpn-devel] [PATCH v1] crypto_backend: Improve signature of md_full to avoid conversions 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: =?utf-8?q?1857294899847414527?= X-GMAIL-MSGID: =?utf-8?q?1857294899847414527?= From: Frank Lichtenheld Change-Id: I201abb9ef013c061fb568823098edcca32cb2df3 Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1512 --- 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/+/1512 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering diff --git a/src/openvpn/crypto_backend.h b/src/openvpn/crypto_backend.h index 5248614..7f5507a 100644 --- a/src/openvpn/crypto_backend.h +++ b/src/openvpn/crypto_backend.h @@ -557,9 +557,9 @@ * @param src_len The length of the incoming buffer. * @param dst Buffer to write the message digest to. May not be NULL. * - * @return \c 1 on success, \c 0 on failure + * @return true on success, false on failure */ -int md_full(const char *mdname, const uint8_t *src, int src_len, uint8_t *dst); +bool md_full(const char *mdname, const uint8_t *src, size_t src_len, uint8_t *dst); /* * Allocate a new message digest context diff --git a/src/openvpn/crypto_mbedtls.c b/src/openvpn/crypto_mbedtls.c index 02735cd..cba6bb5 100644 --- a/src/openvpn/crypto_mbedtls.c +++ b/src/openvpn/crypto_mbedtls.c @@ -696,13 +696,13 @@ return ctx; } -int -md_full(const char *mdname, const uint8_t *src, int src_len, uint8_t *dst) +bool +md_full(const char *mdname, const uint8_t *src, size_t src_len, uint8_t *dst) { const md_info_t *md = md_get(mdname); if (md == NULL || src_len < 0) { - return 0; + return false; } /* We depend on the caller to ensure that dst has enough room for the hash, @@ -710,12 +710,12 @@ size_t dst_size = PSA_HASH_LENGTH(md->psa_alg); size_t hash_length = 0; - psa_status_t status = psa_hash_compute(md->psa_alg, src, (size_t)src_len, dst, dst_size, &hash_length); + psa_status_t status = psa_hash_compute(md->psa_alg, src, src_len, dst, dst_size, &hash_length); if (status != PSA_SUCCESS || hash_length != dst_size) { - return 0; + return false; } - return 1; + return true; } void diff --git a/src/openvpn/crypto_mbedtls_legacy.c b/src/openvpn/crypto_mbedtls_legacy.c index a991349..0dad284 100644 --- a/src/openvpn/crypto_mbedtls_legacy.c +++ b/src/openvpn/crypto_mbedtls_legacy.c @@ -835,8 +835,8 @@ * */ -int -md_full(const char *mdname, const uint8_t *src, int src_len, uint8_t *dst) +bool +md_full(const char *mdname, const uint8_t *src, size_t src_len, uint8_t *dst) { const mbedtls_md_info_t *kt = md_get(mdname); return 0 == mbedtls_md(kt, src, src_len, dst); diff --git a/src/openvpn/crypto_openssl.c b/src/openvpn/crypto_openssl.c index ed39efa..0c6de18 100644 --- a/src/openvpn/crypto_openssl.c +++ b/src/openvpn/crypto_openssl.c @@ -1104,15 +1104,15 @@ * */ -int -md_full(const char *mdname, const uint8_t *src, int src_len, uint8_t *dst) +bool +md_full(const char *mdname, const uint8_t *src, size_t src_len, uint8_t *dst) { unsigned int in_md_len = 0; evp_md_type *kt = md_get(mdname); int ret = EVP_Digest(src, src_len, dst, &in_md_len, kt, NULL); EVP_MD_free(kt); - return ret; + return ret == 1; } EVP_MD_CTX *