From patchwork Sun Mar 22 11:11:15 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4847 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:8796:b0:83c:d90d:321 with SMTP id cq22csp307586mab; Sun, 22 Mar 2026 04:12:05 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVPBSrZl04g/owJ7e8IYgvboX2YIvrNAkaai6VHyRw8G8qZHIzRuMOmVgDTeQB5Zt6BHmkQN/tWKRQ=@openvpn.net X-Received: by 2002:a05:6820:1908:b0:67c:ed6:d9c0 with SMTP id 006d021491bc7-67c22bbf418mr6854538eaf.5.1774177925449; Sun, 22 Mar 2026 04:12:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774177925; cv=none; d=google.com; s=arc-20240605; b=PC6wa4grxAOmipeCGDPSjcsnbeIgV3AJxjvTl8uUsBjkOZf4t0xNyWwJIp4gOu5dYz +Ok9p/lcheOISC76qddeKXgD4+cwhJhzFbDK+CuRd0toGjAiIRaUUhn/tXwld8QHa3X8 /kcZLwRYyYqj47yIoY39i5bkBiNp4xh18sqfS+3FYosE2HH78PtaQ68GL5jrqD2xPNyH EEEejSwLf8yI6N9VIU8u1+OZmmf5aYdzWU0H2k++hZC2sobDPOg6OZs+7o6tDFHDNo01 xgm+cwk+u8gHOTeI44TPJ2A3/D1OJ+kfc5n7VR84elohFOytiUt83Ul4LyNv0hE2d7tx rkcw== 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=ebcg6wMssEdhFX38k7fxCSiwrQR1IliL8JgkZgTkqKc=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=eYRUON4Q4z7/+AsYNkloMGPNB1hU0I00RTVDr+X7CqkOS7z1gj262dCEsYWYyPYDGs j4XAquNHZ4AHaGgKpTQOgHbH+2n9fIFE72q5LWIpicq/1QViy5RfXnZUOaoJ8Mz77GV/ oWggAEonOVnMxBe90gei6gtMClwvi2MgVDtCsgkE/wjWnYkqdpOwkxFMnpPFUQo+2qIP fnno6W04OyO/Cp6W9nmVWzMHxXuW9Crw7pHEqXjq98AospHloKUUK6o8jp+0hqFBmdRD KOtpM9XObcoULLHiQMrDrGr+KSP0/KF1vucOrfQ0Wca/nZXx+gbOqAP8lu+2T5nf9wQX bzpA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=cr5qVYPc; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=DUminRHC; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=DSNWF6fw; 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 006d021491bc7-67c25300897si3650063eaf.37.2026.03.22.04.12.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Mar 2026 04:12:05 -0700 (PDT) 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=cr5qVYPc; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=DUminRHC; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=DSNWF6fw; 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=ebcg6wMssEdhFX38k7fxCSiwrQR1IliL8JgkZgTkqKc=; b=cr5qVYPcw/0AgSZSJGofXNFicv 52qskOsKo5eN9nJOWxYG4wrt7r9dfwEgwlCrvFK++jzoci6Ox4RGcSIh54AFYeW8N/Fibogy+CT1l rSJrA1ourjchH9qaRDuk/PabYYcVd/2R31p0OHV9YHuQQ979bGwOXr8SQ+MzBEZYoUaI=; 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 1w4Git-0005sx-C0; Sun, 22 Mar 2026 11:11:59 +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 1w4Gia-0005sZ-T0 for openvpn-devel@lists.sourceforge.net; Sun, 22 Mar 2026 11:11:40 +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=gB2rkVqnNfvdkLKA+AGNpfHjRGZKc5zwwPuFZ8c6oqs=; b=DUminRHCue4IEfmDFPcXKpzHfk ozGxaJ+Yv13OOzjcfmAfbT5jShH1yj++3G/7lhgNpVDSvErheu7ud7t6ZoVh+y6yjyKJBSsBlGbvh AgeQ9yoIBFhfVX3O1oyHmA5n4JQtwgeH3VPqnsZXVAgoqs3s6Dj4bBq01ThW3Jrtw2Hc=; 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=gB2rkVqnNfvdkLKA+AGNpfHjRGZKc5zwwPuFZ8c6oqs=; b=DSNWF6fwD59W6ETyfqcRGT/kI/ mN9QkIEnLY8CA99WlBGpg2ZytTxnHAliVGsTGbWtP5cQ5LOqsC7Ce90TpJ19RULEEi+7j0v7auSX2 cMPlJmPMfPXRKKfeHwdkRhhiNNS7xviN6DES6ZfmtUKebYHfeN6oZ7UeuAR+vpt9YZ3M=; 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 1w4GiY-0002Y6-Rq for openvpn-devel@lists.sourceforge.net; Sun, 22 Mar 2026 11:11:39 +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 62MBBWpB008303 for ; Sun, 22 Mar 2026 12:11:32 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.1/8.18.1/Submit) id 62MBBVD8008302 for openvpn-devel@lists.sourceforge.net; Sun, 22 Mar 2026 12:11:31 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Sun, 22 Mar 2026 12:11:15 +0100 Message-ID: <20260322111131.8251-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-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 AWS-LC and OpenSSL disagree on the type of that errors are reported in. Instead of having a lot of glue code and casting back and forth, use a typedef to always use the right type. 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: 1w4GiY-0002Y6-Rq Subject: [Openvpn-devel] [PATCH v1] Use openssl_err_t typedef to deal with difference between TLS libraries 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?1860360392175260869?= X-GMAIL-MSGID: =?utf-8?q?1860360392175260869?= From: Arne Schwabe AWS-LC and OpenSSL disagree on the type of that errors are reported in. Instead of having a lot of glue code and casting back and forth, use a typedef to always use the right type. Change-Id: I4adbdf0c8b82fd7de309aa5f6f3b0c8157c5ffe7 Signed-off-by: Arne Schwabe Acked-by: Frank Lichtenheld Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1578 --- 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/+/1578 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Frank Lichtenheld diff --git a/src/openvpn/crypto_openssl.c b/src/openvpn/crypto_openssl.c index 19cb9a9..9900d06 100644 --- a/src/openvpn/crypto_openssl.c +++ b/src/openvpn/crypto_openssl.c @@ -229,7 +229,7 @@ void crypto_print_openssl_errors(const unsigned int flags) { - unsigned long err = 0; + openssl_err_t err = 0; int line, errflags; const char *file, *data, *func; diff --git a/src/openvpn/openssl_compat.h b/src/openvpn/openssl_compat.h index ab011d3..8fdb39a 100644 --- a/src/openvpn/openssl_compat.h +++ b/src/openvpn/openssl_compat.h @@ -45,6 +45,15 @@ #include #include +/* Define the type of error. This is something that is less + * intrusive than casts everywhere */ +#if defined(OPENSSL_IS_AWSLC) +typedef uint32_t openssl_err_t; +#else +typedef unsigned long openssl_err_t; +#endif + + /* Functionality missing in 1.1.0 */ #if OPENSSL_VERSION_NUMBER < 0x10101000L && !defined(ENABLE_CRYPTO_WOLFSSL) #define SSL_CTX_set1_groups SSL_CTX_set1_curves @@ -157,12 +166,12 @@ /* OpenSSL 1.1.1 and lower use only const EVP_MD, nothing to free */ } -static inline unsigned long +static inline openssl_err_t ERR_get_error_all(const char **file, int *line, const char **func, const char **data, int *flags) { static const char *empty = ""; *func = empty; - unsigned long err = ERR_get_error_line_data(file, line, data, flags); + openssl_err_t err = ERR_get_error_line_data(file, line, data, flags); return err; }