all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Maxime Devos <maximedevos@telenet.be>
To: Paul Alesius <paul@unnservice.com>, 55055@debbugs.gnu.org
Subject: [bug#55055] Fwd: [bug#55055] [PATCH] gnu: wireguard: Add support for PresharedKey
Date: Thu, 21 Apr 2022 23:55:17 +0200	[thread overview]
Message-ID: <1e133ca9f5e9570cca8f07ff104673d1fce463e4.camel@telenet.be> (raw)
In-Reply-To: <CAL8jUGV9v_G=CoSJbXeXMn2DCL-=-Z-J8THJQ5G4RpTnAyXZyA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1082 bytes --]

Paul Alesius schreef op do 21-04-2022 om 22:41 [+0200]:
> > * WDYT of verifying that the preshared key looks ‘reasonable’ (I
> > guess only a-z0-9 characters, no spaces or newlines, not a
> > bytevector ...)
> 
> 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 <network-address> and its 'assert-valid-address'.  Long term, there
were some ideas for a contract system à la racket, there was some e-
mail thread about that.

Also, some very basic validation could be replacing

  (format #f "PresharedKey = ~a\n" preshared-key)

by

  (string-append "PresharedKey = " 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.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

  reply	other threads:[~2022-04-21 21:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-21 13:26 [bug#55055] [PATCH] gnu: wireguard: Add support for PresharedKey Paul Alesius
2022-04-21 14:25 ` Maxime Devos
     [not found]   ` <CAL8jUGUyedoy+9va2qGJR5QpXn5B6cn7dWODyBJ0kxq1HQ+GYQ@mail.gmail.com>
2022-04-21 20:41     ` [bug#55055] Fwd: " Paul Alesius
2022-04-21 21:55       ` Maxime Devos [this message]
2022-04-21 21:59       ` Maxime Devos
2022-04-21 21:48     ` Maxime Devos
2022-12-26 16:53 ` bug#55055: " Mathieu Othacehe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1e133ca9f5e9570cca8f07ff104673d1fce463e4.camel@telenet.be \
    --to=maximedevos@telenet.be \
    --cc=55055@debbugs.gnu.org \
    --cc=paul@unnservice.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.