unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#46185] [PATCH] services: knot: Fix an acl and a key verification.
@ 2021-01-30  8:19 Alexey Abramov
  2021-02-11  3:17 ` bug#46185: " 宋文武
  0 siblings, 1 reply; 2+ messages in thread
From: Alexey Abramov @ 2021-01-30  8:19 UTC (permalink / raw)
  To: 46185

* gnu/services/dns.scm (verify-knot-key-configuration): Change the order of memq attributes.
(verify-knot-keystore-configuration): Likewise.
(verify-knot-acl-configuration): Replace fold with every procedure.
---
 gnu/services/dns.scm | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/gnu/services/dns.scm b/gnu/services/dns.scm
index b339eb0619..d4aefe6285 100644
--- a/gnu/services/dns.scm
+++ b/gnu/services/dns.scm
@@ -256,9 +256,9 @@
   (let ((id (knot-key-configuration-id key)))
     (unless (and (string? id) (not (equal? id "")))
       (error-out "key id must be a non empty string.")))
-  (unless (memq '(#f hmac-md5 hmac-sha1 hmac-sha224 hmac-sha256 hmac-sha384 hmac-sha512)
-                (knot-key-configuration-algorithm key))
-          (error-out "algorithm must be one of: #f, 'hmac-md5, 'hmac-sha1,
+  (unless (memq (knot-key-configuration-algorithm key)
+                '(#f hmac-md5 hmac-sha1 hmac-sha224 hmac-sha256 hmac-sha384 hmac-sha512))
+    (error-out "algorithm must be one of: #f, 'hmac-md5, 'hmac-sha1,
 'hmac-sha224, 'hmac-sha256, 'hmac-sha384 or 'hmac-sha512")))
 
 (define (verify-knot-keystore-configuration keystore)
@@ -267,9 +267,9 @@
   (let ((id (knot-keystore-configuration-id keystore)))
     (unless (and (string? id) (not (equal? id "")))
       (error-out "keystore id must be a non empty string.")))
-  (unless (memq '(pem pkcs11)
-                (knot-keystore-configuration-backend keystore))
-          (error-out "backend must be one of: 'pem or 'pkcs11")))
+  (unless (memq (knot-keystore-configuration-backend keystore)
+                '(pem pkcs11))
+    (error-out "backend must be one of: 'pem or 'pkcs11")))
 
 (define (verify-knot-policy-configuration policy)
   (unless (knot-policy-configuration? policy)
@@ -288,7 +288,7 @@
     (unless (and (string? id) (not (equal? id "")))
       (error-out "acl id must be a non empty string."))
     (unless (and (list? address)
-                 (fold (lambda (x1 x2) (and (string? x1) (string? x2))) "" address))
+                 (every string? address))
       (error-out "acl address must be a list of strings.")))
   (unless (boolean? (knot-acl-configuration-deny? acl))
     (error-out "deny? must be #t or #f.")))
-- 
2.30.0





^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#46185: [PATCH] services: knot: Fix an acl and a key verification.
  2021-01-30  8:19 [bug#46185] [PATCH] services: knot: Fix an acl and a key verification Alexey Abramov
@ 2021-02-11  3:17 ` 宋文武
  0 siblings, 0 replies; 2+ messages in thread
From: 宋文武 @ 2021-02-11  3:17 UTC (permalink / raw)
  To: Alexey Abramov; +Cc: 46185-done

Alexey Abramov <levenson@mmer.org> writes:

> * gnu/services/dns.scm (verify-knot-key-configuration): Change the
> order of memq attributes.
> (verify-knot-keystore-configuration): Likewise.
> (verify-knot-acl-configuration): Replace fold with every procedure.
> ---
>  gnu/services/dns.scm | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
>

I adjust the commit message a bit and pushed, thank you!




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-02-11  3:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-30  8:19 [bug#46185] [PATCH] services: knot: Fix an acl and a key verification Alexey Abramov
2021-02-11  3:17 ` bug#46185: " 宋文武

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).