From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id CEvOCwTTYWKDNgEAbAwnHQ (envelope-from ) for ; Thu, 21 Apr 2022 23:56:20 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id IIftCwTTYWJUeAAA9RJhRA (envelope-from ) for ; Thu, 21 Apr 2022 23:56:20 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id BC9B3198DD for ; Thu, 21 Apr 2022 23:56:19 +0200 (CEST) Received: from localhost ([::1]:59866 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhemg-0007Uh-Ex for larch@yhetil.org; Thu, 21 Apr 2022 17:56:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42344) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhemQ-0007T5-0z for guix-patches@gnu.org; Thu, 21 Apr 2022 17:56:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:57137) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nhemP-0001A9-Nu for guix-patches@gnu.org; Thu, 21 Apr 2022 17:56:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nhemP-00077o-M1 for guix-patches@gnu.org; Thu, 21 Apr 2022 17:56:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55055] Fwd: [bug#55055] [PATCH] gnu: wireguard: Add support for PresharedKey Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 21 Apr 2022 21:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55055 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Paul Alesius , 55055@debbugs.gnu.org Received: via spool by 55055-submit@debbugs.gnu.org id=B55055.165057812127334 (code B ref 55055); Thu, 21 Apr 2022 21:56:01 +0000 Received: (at 55055) by debbugs.gnu.org; 21 Apr 2022 21:55:21 +0000 Received: from localhost ([127.0.0.1]:51034 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nhell-00076n-Fo for submit@debbugs.gnu.org; Thu, 21 Apr 2022 17:55:21 -0400 Received: from baptiste.telenet-ops.be ([195.130.132.51]:53318) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nhelj-00076c-O4 for 55055@debbugs.gnu.org; Thu, 21 Apr 2022 17:55:20 -0400 Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by baptiste.telenet-ops.be with bizsmtp id MZvJ270034UW6Th01ZvJ6M; Thu, 21 Apr 2022 23:55:18 +0200 Message-ID: <1e133ca9f5e9570cca8f07ff104673d1fce463e4.camel@telenet.be> From: Maxime Devos Date: Thu, 21 Apr 2022 23:55:17 +0200 In-Reply-To: References: <274c06a235949ebbdd3f90e31afea1189f207ea0.camel@telenet.be> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-bC5DBkVSukE3QWpoONv4" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1650578118; bh=LE45RwBmcDZ8KRVN2ay0/iyspBRfnJLU2O+4/fkeCVg=; h=Subject:From:To:Date:In-Reply-To:References; b=i/1UlAFShIa/bBLzn5ucr9ArI4EC5VE6WtqV+8wxYYSv5jzvPcF4W2O9awoxiYf6Z m2ouJLPvPH+nNmr5nf9B0xDTWu1roND9H0NphbT3sXY92OhXt+sRydElmTrLGIKM3I Escx3K0SdfYGJ7QCvJtSorgZRVFC88z79sFPQYKLwunf9Aai5ZwlKjLyt+cydW1Nlj GgfCu5f/6oKIQV8U6gZnSgzF4PQMPudib8BQgNxGTZ8u6gmFH5O8e2zGPheccP1JxB h6u5pXMNGZvsdzk3zET+GjXlDFKuPWGAwYmiAuWgRwcM7/llBgrelkujjGdPXA5rPZ ZcRM02gecv22Q== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1650578180; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=LE45RwBmcDZ8KRVN2ay0/iyspBRfnJLU2O+4/fkeCVg=; b=mTs71oYx9vhBVDrq8As5D/imcxezuPK/xjOdHttM0A+OPMffuvOouu29kbOgKs4qBVJjoZ +g9PBbDq6Ysd14KIT/HiA6QXQnKvZmuA7mz+XSa8iEN7oSVH5KFXq1/Y0KfR1jJRTnXw0v oV98AahKeN27dYAkx1OxmZCbjkaYXidnKcVi22M1K33xTHM0wPXWbSgaLTWn+riEb+OeT4 6Rk5bj15xN6M10IMgqvxJCjgDoFCjjoVFa59Ohv5kb4U2X4Rl3xr42PtXcuCSiBdGUFiyf yExMiwVU944LVNlu00aN0cviWlOj5ifJJLwoSSgXeeVgmeNDpPSUATC4JrhMMw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1650578180; a=rsa-sha256; cv=none; b=a3fudp2sxSVwm0xxR80ARVjurPGZqwx7S1JkkwaeVnPmM8YIyV5zuHk5c62o4OLafro5mq 4mTVD/2aRSn8lEopCRqWDnku/kEUzGKMPgyZOI50bK2k2103G78/oUygdODkC0sv9Vx9LI +DEllISuUE5MxJqeSEed61bkus5CDO4uNKtKGcUcSYygL29uixhpedKlcB+fDlwz53vjK4 Oyn5j5VowwKs52qhwOgiYQLOpC5lvKqUCXe5QbjfRRsfOhyDGO9wwHAs6/7Yc0jwr6bLV9 UqBVahvzEP+KPKuILghSqMeHxixNc3PFRUo93/KmF1am7f/NpXwSOqP7JtdQEw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r22 header.b="i/1UlAFS"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 3.87 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r22 header.b="i/1UlAFS"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: BC9B3198DD X-Spam-Score: 3.87 X-Migadu-Scanner: scn1.migadu.com X-TUID: i5Kty2/NoAH+ --=-bC5DBkVSukE3QWpoONv4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Paul Alesius schreef op do 21-04-2022 om 22:41 [+0200]: > > * WDYT of verifying that the preshared key looks =E2=80=98reasonable=E2= =80=99 (I > > guess only a-z0-9 characters, no spaces or newlines, not a > > bytevector ...) >=20 > I could develop a subsystem for validating the fields of the > wireguard but isn't it better to provide validations from the guix > framework more broadly? With my level of Guile scripting right now, I > doubt that it would be accepted. There's already a basic system for this: field sanitisers. Have a look at and its 'assert-valid-address'. Long term, there were some ideas for a contract system =C3=A0 la racket, there was some e- mail thread about that. Also, some very basic validation could be replacing (format #f "PresharedKey =3D ~a\n" preshared-key) by (string-append "PresharedKey =3D " preshared-key "\n") -- basically, let string-append do some basic type checking. This only checks that it's a string though. 'make-regexp' and friends may be useful for more complete validation. Greetings, Maxime. --=-bC5DBkVSukE3QWpoONv4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYmHSxRccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7ns4AP9p9cHFYz6/2tAjy3ylsebQR29b 4mRWYbGRytI1WieUQwD/cQu6iM1O6LAvnv9psSc23s50q1pIa5eNLyL4Gm53uwM= =ExUI -----END PGP SIGNATURE----- --=-bC5DBkVSukE3QWpoONv4--