From patchwork Thu Aug 6 09:09:45 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 5204 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:77c3:b0:87d:ab56:3700 with SMTP id r3csp7415575mau; Thu, 6 Aug 2026 02:10:06 -0700 (PDT) X-Forwarded-Encrypted: i=2; AHgh+RoCmVk44r/tquBjF5rhjNQuUkEAbkfceJF3s2jrJ5sXL4H3wsXwSQAtSivl01KWYDy0rrLM/JzbOyA=@openvpn.net X-Received: by 2002:a05:6871:283:b0:448:6ba8:be6f with SMTP id 586e51a60fabf-4599f0de084mr6692350fac.19.1786007406490; Thu, 06 Aug 2026 02:10:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1786007406; cv=none; d=google.com; s=arc-20260327; b=i+flYc5sT1WSqtslIfvHOeMZScDY7pZ7My9IAZkeBKli9FAxPoWncRnz+qdOTjy7Xz Zd1+wq178B/e1gyegwbcNQnUp2xQzZfq0q80IRrhtD/0pGO6/aTl33i3tIaX7HkkGLZo s1yAgTN1pXQs+ySkcVNnYKag0uHCe7sNtN7bVYiqIqW/r63ufy78+6X7ht47hWT2R1tN Zvq7D6CNOwVI91UDP4Rrl8ZicsYIs5TFZu67iIGXn3e5QsIionrI7CKNstBa4yzNEylp W9I7pgCwWoyOaPBWDSQgpePIHObtFdFOMRGxhYBtSxuQERSr3ccYw8L7Rk6ILqZyGi2l lrkg== 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=jyNBU1eiNLCLJLeZYGv2pr4w1elmF86zzXJWBgAh8rw=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=px9TFVw67TUmD8fDaw9Nti9UUqn8OiNtoZA6/UWRwpd21jgmfVBXH+hKKKK2u/LmvF bLXkj+TQGmjJ1DfIBaF32Vr4vZm9CqUvNg8pNl2OHmu+qT5Un9FahuVeqaIhk1c1sK4J bbdQBdyo53c2fnG6XnJ/GZT/HlRnksRHMiMhLH493Mho8fGAfVOEF89lCu9qfnKNksz+ rDaiEFeT/IXDBFeUGuZ6XDPGyRcAU/2lKMLO6NbRBm9RwqxUY8PeoS/dzV8HNylXKD10 3HMxYLWRokOxJlo0HBfLiz2SUmL/iwFNcGBwHY2HqRaKxsBdcMRgskYzTVcWkaF7r2T8 2Abw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=Lrqts0rf; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=bSoOszb6; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=WRTKQumd; 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-4599e646ad2si2961941fac.195.2026.08.06.02.10.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Aug 2026 02:10:06 -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=Lrqts0rf; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=bSoOszb6; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=WRTKQumd; 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=jyNBU1eiNLCLJLeZYGv2pr4w1elmF86zzXJWBgAh8rw=; b=Lrqts0rfjz87zx0NbAuCEVOkVn KHro94cGhd9tN0eAmBRk/YzHzVu6lhX7186OukRlanqrlqOrIR0WDHp1BzwYHQb8ZTmX6U9bgsZRB 5OyK3l8beYKkfSBZu3jaqY/xE2aXSKAA4JnC/W6LrQB330lK1PB6LlIy+6r4VQzvcffs=; Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1wru6y-0000EO-IF; Thu, 06 Aug 2026 09:10:01 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1wru6x-0000EH-5j for openvpn-devel@lists.sourceforge.net; Thu, 06 Aug 2026 09:09:59 +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=QJMPOnc8sNHcHL/7WXBsr1TnSwomBt07awvTlHkpxmM=; b=bSoOszb6i8brv/iQu88408nnYi 8rSuzf5LDT0dQnLFV5/7yR1OmdRjc94Pfkz9tKJ3Li7P75VInoTU9zM8rbwUzTYR4GO1vQKpZ+RWb 2R6B3fE1jNRf6ugOJ2YBwQgTHfe2OKgEzXnlik5CZ9hPMlXeN24AFEnexTBKEmqI/ocg=; 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=QJMPOnc8sNHcHL/7WXBsr1TnSwomBt07awvTlHkpxmM=; b=WRTKQumdLkJPX/aDI1EBrrohG0 hEhETY4qrXlQmsgziUJ49Rn7r85du15Ck07eWvejvrB8y1lrWd6l0r9uaYih4AV6rtRorWAxOjFo3 5Y2jGcnvCtTei3a8S0gK438RRgThYPboW30Hy3TAAEwgPGoWVF5bjmx2Ple/7PVTdaSI=; 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.95) id 1wru70-0006Ge-9x for openvpn-devel@lists.sourceforge.net; Thu, 06 Aug 2026 09:09:59 +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 67699poD020915 for ; Thu, 6 Aug 2026 11:09:51 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.2/8.18.1/Submit) id 67699pd8020914 for openvpn-devel@lists.sourceforge.net; Thu, 6 Aug 2026 11:09:51 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Thu, 6 Aug 2026 11:09:45 +0200 Message-ID: <20260806090951.20900-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.53.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: Arne Schwabe The get_random in test_misc.c conflicts with the get_random function that OpenVPN defines in crypto.h Also adjust the implementation in mock_get_random.c to match the prototype in crypto.h Content analysis details: (1.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URI: openvpn.net] 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Headers-End: 1wru70-0006Ge-9x Subject: [Openvpn-devel] [PATCH v2] Remove local get_random in test_misc.c 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: 1872691363407005925 X-GMAIL-MSGID: 1872764501898247206 From: Arne Schwabe The get_random in test_misc.c conflicts with the get_random function that OpenVPN defines in crypto.h Also adjust the implementation in mock_get_random.c to match the prototype in crypto.h Change-Id: I3db70001be7f39cf84d562517647f1a305962b42 Signed-off-by: Arne Schwabe Acked-by: Frank Lichtenheld Acked-by: Antonio Quartulli Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1834 --- 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/+/1834 This mail reflects revision 2 of this Change. Acked-by according to Gerrit (reflected above): Frank Lichtenheld Antonio Quartulli diff --git a/tests/unit_tests/openvpn/mock_get_random.c b/tests/unit_tests/openvpn/mock_get_random.c index 0840e31..5cb768b 100644 --- a/tests/unit_tests/openvpn/mock_get_random.c +++ b/tests/unit_tests/openvpn/mock_get_random.c @@ -28,7 +28,7 @@ #include #include -unsigned long +int64_t get_random(void) { /* rand() is not very random, but it's C99 and this is just for testing */ diff --git a/tests/unit_tests/openvpn/test_misc.c b/tests/unit_tests/openvpn/test_misc.c index 501286c..8da7abe 100644 --- a/tests/unit_tests/openvpn/test_misc.c +++ b/tests/unit_tests/openvpn/test_misc.c @@ -38,6 +38,7 @@ #include "test_common.h" #include "list.h" #include "mock_msg.h" +#include "crypto.h" #ifdef _WIN32 #include "win32-util.h" #endif @@ -141,13 +142,6 @@ return strcmp((const char *)key1, (const char *)key2) == 0; } -static uint32_t -get_random(void) -{ - /* rand() is not very random, but it's C99 and this is just for testing */ - return (uint32_t)rand(); -} - static struct hash_element * hash_lookup_by_value(struct hash *hash, void *value) { @@ -263,7 +257,7 @@ { struct hash_iterator hi; struct hash_element *he; - inc = (get_random() % 3) + 1; + inc = ((uint32_t)get_random() % 3) + 1; hash_iterator_init_range(hash, &hi, base, base + inc); while ((he = hash_iterator_next(&hi)))