guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/06: publish: Export 'signed-string'.


From: guix-commits
Subject: 01/06: publish: Export 'signed-string'.
Date: Thu, 16 Jan 2020 12:31:25 -0500 (EST)

civodul pushed a commit to branch master
in repository guix.

commit 4fe01b09ea0b304b963b7fd9f168439ddfb515c1
Author: Ludovic Courtès <address@hidden>
AuthorDate: Thu Jan 16 10:43:29 2020 +0100

    publish: Export 'signed-string'.
    
    * guix/scripts/publish.scm (signed-string): Export and improve docstring.
    * tests/publish.scm ("/*.narinfo")
    ("/*.narinfo with properly encoded '+' sign"): Adjust accordingly.
---
 guix/scripts/publish.scm | 4 +++-
 tests/publish.scm        | 8 +++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/guix/scripts/publish.scm b/guix/scripts/publish.scm
index 71a349d..f5b2f5f 100644
--- a/guix/scripts/publish.scm
+++ b/guix/scripts/publish.scm
@@ -64,6 +64,7 @@
   #:use-module ((guix build syscalls) #:select (set-thread-name))
   #:export (%public-key
             %private-key
+            signed-string
 
             guix-publish))
 
@@ -237,7 +238,8 @@ if ITEM is already compressed."
     ("Priority" . 100)))
 
 (define (signed-string s)
-  "Sign the hash of the string S with the daemon's key."
+  "Sign the hash of the string S with the daemon's key.  Return a canonical
+sexp for the signature."
   (let* ((public-key (%public-key))
          (hash (bytevector->hash-data (sha256 (string->utf8 s))
                                       #:key-type (key-type public-key))))
diff --git a/tests/publish.scm b/tests/publish.scm
index 204cfb4..e43310e 100644
--- a/tests/publish.scm
+++ b/tests/publish.scm
@@ -1,6 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 David Thompson <address@hidden>
-;;; Copyright © 2016, 2017, 2018, 2019 Ludovic Courtès <address@hidden>
+;;; Copyright © 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -153,8 +153,7 @@ References: ~a~%"
          (signature (base64-encode
                      (string->utf8
                       (canonical-sexp->string
-                       ((@@ (guix scripts publish) signed-string)
-                        unsigned-info))))))
+                       (signed-string unsigned-info))))))
     (format #f "~aSignature: 1;~a;~a~%"
             unsigned-info (gethostname) signature))
   (utf8->string
@@ -184,8 +183,7 @@ References: ~%"
          (signature (base64-encode
                      (string->utf8
                       (canonical-sexp->string
-                       ((@@ (guix scripts publish) signed-string)
-                        unsigned-info))))))
+                       (signed-string unsigned-info))))))
     (format #f "~aSignature: 1;~a;~a~%"
             unsigned-info (gethostname) signature))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]