| Message ID | 20261202115302.879-1-gert@greenie.muc.de |
|---|---|
| State | New |
| Headers |
Return-Path: <openvpn-devel-bounces@lists.sourceforge.net>
Delivered-To: patchwork@openvpn.net
Received: by 2002:a05:6022:91c9:10b0:11b:d6c:f273 with SMTP id
tl9-n1csp16152536lad;
Wed, 2 Dec 2026 03:53:15 -0800 (PST)
X-Forwarded-Encrypted: i=2;
AL+hErElLcU7gSk5fDQRsXfT85W7iM3TTdAzz9Shj47uot8FA0k9g1XnO31Y9gsy5WM0hgb8OSopfdaftZ8=@openvpn.net
X-Received: by 2002:a05:701b:204a:10b0:16d:1e24:5cc3 with SMTP id
a92af1059eb24-1b5568c0e83mr42570675c88.19.1796212395481;
Wed, 02 Dec 2026 03:53:15 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; t=1796212395; cv=none;
d=google.com; s=arc-20260327;
b=R3u2S+vdYLsED0fX5eQBmleiqbU/E4efdsNIMMXwzNWkZQF7HX6AZDz0STg95A22pO
6BG5s6MDoNXB1NFY9qP00QXDOOjvXxNio88im37nRQ3HWiKp9x4wlHBvVpWsTc7yVnKb
3GJWSM2/Ki+klHSgmXyGBbx1zJL8DJjkhPLO8HQbj/ZOk0gDEY+sEbQaVM4/08YyqRjt
zhDi1OOi3buPiDFH7FNpFZlFaZNSZ62g6rBOeCcJnvv78bkkG5SdAoOe6UAt5oGgF6wf
vddUKmEFKt9cFRW1u+9pMmi57R+s+s/5kzD/OUVLUVZ9BdrF/IaJrPKNaFrMfhtZsleX
zklA==
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=XOqbtD0DIAKt9mcoRaKCCZROmjwC3Gicj5RWYbHGHxQ=;
fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=;
b=QRGowwwu4FrD40aOOSAr/VHbu3GkHVIioXcNK+mmSQoVGSQ2ymBVAietvZRL9TQu00
+GG5zSL93eLGsQOQ//oDrYNqfUGimTICQtx1r2XFaxjkJDutrLcBupUIXEJyi4LQVg84
LB1OKyBB/X0sUnhdasCU6VyuOUQD7RPFZHji9aaxua4rmruRKjZUlSv/cyPvKz0gvxXS
gCCv3HlI5HTd+muGuCOybPKLZS5+bTLWq2mpjbyrVibdaU4hh9Z6P2QwkDeRjcgG/AjF
KWsUS8evkEM2OsjunydKk7CkIU22icwklLmfseDkvm7dMWIs1AeSD+M63IEP8qrD7ieF
YdMw==;
dara=google.com
ARC-Authentication-Results: i=1; mx.google.com;
dkim=pass header.i=@lists.sourceforge.net header.s=beta
header.b=RaiUd+P2;
dkim=neutral (body hash did not verify) header.i=@sourceforge.net
header.s=x header.b=Kig3vVt5;
dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x
header.b=gw4SGUSR;
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-1b556803d19si95875157c88.42.2026.12.02.03.53.15
(version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
Wed, 02 Dec 2026 03:53:15 -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=RaiUd+P2;
dkim=neutral (body hash did not verify) header.i=@sourceforge.net
header.s=x header.b=Kig3vVt5;
dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x
header.b=gw4SGUSR;
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=XOqbtD0DIAKt9mcoRaKCCZROmjwC3Gicj5RWYbHGHxQ=; b=RaiUd+P2xzGsIT
DPRjpBCdm276N8nARZXF2wqPD9dFS1E6FxNpnWElF/8YEXzxN3w+mWnNZow6Dps4pADmN2jklYXq1
WT7VsXOvwNYWSGVc5wiZ4/I7kCrnvSDquyUv2ejj7M9ZeYNMb2X9p6L5nOvDR10uiKVBONYVUTsuW
vIA=;
Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com)
by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.100.1)
(envelope-from <openvpn-devel-bounces@lists.sourceforge.net>)
id 1xYitc-000000005jl-3cV8;
Wed, 02 Dec 2026 11:53:12 +0000
Received: from [172.30.29.66] (helo=mx.sourceforge.net)
by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.100.1)
(envelope-from <gert@blue4.greenie.muc.de>)
id 1xYitb-000000005jf-3DWn for openvpn-devel@lists.sourceforge.net;
Wed, 02 Dec 2026 11:53:11 +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=pZOYYwMKBpTF//MkqS3YRpQkWCRcQrOaU/WUG4ixh0k=; b=Kig3vVt5lk/jGs/9HN2Ep4R4Xl
fM+vlsoMvC40TNrE7ygx1tr6jBpi08qUotkc5S3ymQRvCT0m25+I6bjRqHljvk8iUVC2dLwRDYNfG
4J29t2HUep3MCY2q/MVUIzSfKp60bE5aiHKGsNu2Ynr43YQczMigZlGVhw/2Fw8zd8nY=;
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=pZOYYwMKBpTF//MkqS3YRpQkWCRcQrOaU/WUG4ixh0k=; b=gw4SGUSRB2eD9S490B+ncTsGTm
NEcBc4nfu0PHxZ7P85I/Y3e2nQfPsjfZzBg8Z2EGEhyPKM/N6Q/KbZT4BmF6LENaz4OHwaFZExen9
jFpmW/x21C+2kzSYED2XFulSw1hGJqAS18jNEGGj6Nb21zoN+SuJ6utHb9B+/gapV77k=;
Received: from [193.149.48.129] (helo=blue.greenie.muc.de)
by sfi-mx-1.v28.lw.sourceforge.com with esmtps
(TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.100.1)
id 1xYita-0000000027Y-01Ps for openvpn-devel@lists.sourceforge.net;
Wed, 02 Dec 2026 11:53:11 +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 6B2Br3Fk000896
for <openvpn-devel@lists.sourceforge.net>; Wed, 2 Dec 2026 12:53:03 +0100
Received: (from gert@localhost)
by blue.greenie.muc.de (8.18.2/8.18.1/Submit) id 6B2Br358000894
for openvpn-devel@lists.sourceforge.net; Wed, 2 Dec 2026 12:53:03 +0100
From: Gert Doering <gert@greenie.muc.de>
To: openvpn-devel@lists.sourceforge.net
Date: Wed, 2 Dec 2026 12:52:56 +0100
Message-ID: <20261202115302.879-1-gert@greenie.muc.de>
X-Mailer: git-send-email 2.55.0
In-Reply-To:
<gerrit.1796205990000.I24d3e80182e4121b3d84c3bdc07d3172f872da8f@gerrit.openvpn.net>
References:
<gerrit.1796205990000.I24d3e80182e4121b3d84c3bdc07d3172f872da8f@gerrit.openvpn.net>
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: Max Fillinger <maximilian.fillinger@sentyron.com> The
return value of BN_num_bytes is int in OpenSSL but unsigned int in AWS-LC.
This caused a compiler warning,
and causes builds with -Werror=sign-conversion
to fail. This commit casts the return valu [...]
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: 1xYita-0000000027Y-01Ps
Subject: [Openvpn-devel] [PATCH v1] Add cast to BN_num_bytes return value
for AWS-LC
X-BeenThere: openvpn-devel@lists.sourceforge.net
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <openvpn-devel.lists.sourceforge.net>
List-Unsubscribe: <https://lists.sourceforge.net/lists/options/openvpn-devel>,
<mailto:openvpn-devel-request@lists.sourceforge.net?subject=unsubscribe>
List-Archive:
<http://sourceforge.net/mailarchive/forum.php?forum_name=openvpn-devel>
List-Post: <mailto:openvpn-devel@lists.sourceforge.net>
List-Help: <mailto:openvpn-devel-request@lists.sourceforge.net?subject=help>
List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/openvpn-devel>,
<mailto:openvpn-devel-request@lists.sourceforge.net?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: openvpn-devel-bounces@lists.sourceforge.net
X-getmail-retrieved-from-mailbox: Inbox
X-GMAIL-THRID: 1883465208633387349
X-GMAIL-MSGID: 1883465208633387349
|
| Series |
[Openvpn-devel,v1] Add cast to BN_num_bytes return value for AWS-LC
|
|
Commit Message
Gert Doering
Dec. 2, 2026, 11:52 a.m. UTC
From: Max Fillinger <maximilian.fillinger@sentyron.com> The return value of BN_num_bytes is int in OpenSSL but unsigned int in AWS-LC. This caused a compiler warning, and causes builds with -Werror=sign-conversion to fail. This commit casts the return value to unsigned int. Change-Id: I24d3e80182e4121b3d84c3bdc07d3172f872da8f Signed-off-by: Max Fillinger <maximilian.fillinger@sentyron.com> Acked-by: Razvan Cojocaru <razvanc@mailbox.org> Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2389 --- 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/+/2389 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Razvan Cojocaru <razvanc@mailbox.org>
Comments
Good & integer-safe patch for the AWS LC annoyance... thanks.
Since the original patch went to "all the branches", it makes sense to
fix this too ("considered part of the original bugfix") - even though
I assume nobody would build 2.6 with AWS-LC *and* -Werror.
Our GH Action setup tests 2.7 and master on aws-lc, and that is now
back to "all green".
Your patch has been applied to the master, release/2.7, release/2.6 branch.
The list archive is acting up again, so referring to lore.kernel.org.
commit 731de6fed960f5a874ba1802ec261717485833b1 (master)
commit 9933a6ab1234888a9a4ec3b8cc5419463d49f9a4 (release/2.7)
commit f72eb19b1d9b8689af9eb2c1370c9dbc9e8357ac (release/2.6)
Author: Max Fillinger
Date: Wed Dec 2 12:52:56 2026 +0100
Add cast to BN_num_bytes return value for AWS-LC
Signed-off-by: Max Fillinger <maximilian.fillinger@sentyron.com>
Acked-by: Razvan Cojocaru <razvanc@mailbox.org>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2389
Message-Id: <20261202115302.879-1-gert@greenie.muc.de>
URL: https://lore.kernel.org/openvpn-devel/20261202115302.879-1-gert@greenie.muc.de
Signed-off-by: Gert Doering <gert@greenie.muc.de>
--
kind regards,
Gert Doering
diff --git a/src/openvpn/ssl_verify_openssl.c b/src/openvpn/ssl_verify_openssl.c index ee29691..ab3c872 100644 --- a/src/openvpn/ssl_verify_openssl.c +++ b/src/openvpn/ssl_verify_openssl.c @@ -61,7 +61,11 @@ BIGNUM *bn_serial = ASN1_INTEGER_to_BN(asn1_i, NULL); if (bn_serial != NULL) { - int size = BN_num_bytes(bn_serial); + /* Cast the return value of BN_num_bytes to unsigned int because it is + * int in OpenSSL and unsigned int in AWS-LC. The return value of + * BN_num_bytes should never be negative, and if it is, the cast will + * turn it into an unacceptably large value which will fail this check. */ + unsigned int size = (unsigned int)BN_num_bytes(bn_serial); size_ok = size <= MAX_SERIAL_SIZE; } BN_free(bn_serial);