GNU bug report logs -
#55055
[PATCH] gnu: wireguard: Add support for PresharedKey
Previous Next
Reported by: Paul Alesius <paul <at> unnservice.com>
Date: Thu, 21 Apr 2022 13:28:02 UTC
Severity: normal
Tags: patch
Done: Mathieu Othacehe <othacehe <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #17 received at 55055 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
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.
[signature.asc (application/pgp-signature, inline)]
This bug report was last modified 2 years and 148 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.