From patchwork Thu May 28 17:58:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tremer X-Patchwork-Id: 3138 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 49XwSF3gSJz43rk for ; Thu, 28 May 2020 17:59:09 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 49XwSC440qz25P; Thu, 28 May 2020 17:59:07 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 49XwSC23bnz303J; Thu, 28 May 2020 17:59:07 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 49XwS93dpGz2ysJ for ; Thu, 28 May 2020 17:59:05 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 49XwS931yGz1dJ; Thu, 28 May 2020 17:59:05 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1590688745; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MEU5EL67ydCPbeEiJMq/8y8sUtpINHM8HReATsuhVuU=; b=/MrGAtfz62B9Vg23i4bgY+ZAiRXjfdaQxoeiN/Aflblh6gO0JDrnMURxtxY2IZSttp5jvs lHuO+X1y/P8ytqDw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1590688745; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MEU5EL67ydCPbeEiJMq/8y8sUtpINHM8HReATsuhVuU=; b=BG6rbxaQLAXtr6Qxg3Gp7pqBA828NoOypqBS89MpIMXBgTJsUVjw1DnE4JLhBJQ+u9OkB6 tWUDmbQzIvq3JADsJorqDGmY6HEh7EcXSchZcHw6Fe9YA0dzP3o5VvlQUhm4dtRzArRMd2 U7sbekkpeoOlycDB+KMD1LDE7worzcvf6riEVVgVUmdQH5WoxyBa/FNJsf3pixyf2GyV9Z TSpL5VrjbDmuPRXC0wz5fJ4ix91OxyHlDkD5Qs5Fg7Ku43uLGSihtruJW8+Qw0lU0mUMgx zgQRnkCvi7J/r8oDbzaUMIYnbCYgxqmjTqQvNn8+hgm5FexRrD39JHDiS5HcYw== From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH 04/16] vpnmain.cgi: Generate random UUIDs Date: Thu, 28 May 2020 17:58:38 +0000 Message-Id: <20200528175850.12638-5-michael.tremer@ipfire.org> In-Reply-To: <20200528175850.12638-1-michael.tremer@ipfire.org> References: <20200528175850.12638-1-michael.tremer@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Tremer Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Signed-off-by: Michael Tremer --- html/cgi-bin/vpnmain.cgi | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/html/cgi-bin/vpnmain.cgi b/html/cgi-bin/vpnmain.cgi index 9c0d72c88..c004b6087 100644 --- a/html/cgi-bin/vpnmain.cgi +++ b/html/cgi-bin/vpnmain.cgi @@ -19,6 +19,7 @@ # # ############################################################################### +use Data::UUID; use MIME::Base64; use Net::DNS; use File::Copy; @@ -1184,11 +1185,14 @@ END &General::readhasharray("${General::swroot}/vpn/config", \%confighash); my $key = $cgiparams{'KEY'}; - my $uuid1 = "AAAABBBB"; - my $uuid2 = "CCCCDDDD"; + # Create a UUID generator + my $uuid = Data::UUID->new(); + + my $uuid1 = $uuid->create_str(); + my $uuid2 = $uuid->create_str(); my $cert = ""; - my $cert_uuid = "123456789"; + my $cert_uuid = $uuid->create_str(); # Read and encode certificate if ($confighash{$key}[4] eq "cert") {