aboutsummaryrefslogtreecommitdiff
path: root/guix/scripts
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-03-22 22:46:11 +0100
committerLudovic Courtès <ludo@gnu.org>2014-03-22 22:57:10 +0100
commit9b0a2233dbe8746015b97e97cef890d38fb44b0f (patch)
tree0c488f9d4eee8b85210e5976844b9bc38f3191fd /guix/scripts
parent9dbe6e43ea9f7d2afccc3c9febcd7f399e819f01 (diff)
downloadgnu-guix-9b0a2233dbe8746015b97e97cef890d38fb44b0f.tar
gnu-guix-9b0a2233dbe8746015b97e97cef890d38fb44b0f.tar.gz
authenticate: Support reading the hash or key from stdin.
* guix/scripts/authenticate.scm (guix-authenticate): Add clauses for ("rsautl" "-sign" "-inkey" key) and ("rsautl" "-verify" "-inkey" _ "-pubin"). * tests/guix-authenticate.sh (hash): Add test using -sign and -verify in a pipeline.
Diffstat (limited to 'guix/scripts')
-rw-r--r--guix/scripts/authenticate.scm8
1 files changed, 8 insertions, 0 deletions
diff --git a/guix/scripts/authenticate.scm b/guix/scripts/authenticate.scm
index 8bc148d730..62717bb09c 100644
--- a/guix/scripts/authenticate.scm
+++ b/guix/scripts/authenticate.scm
@@ -90,14 +90,22 @@ to stdout upon success."
(define (guix-authenticate . args)
(match args
+ ;; As invoked by guix-daemon.
(("rsautl" "-sign" "-inkey" key "-in" hash-file)
(call-with-input-file hash-file
(lambda (port)
(sign-with-key key port))))
+ ;; As invoked by Nix/Crypto.pm (used by Hydra.)
+ (("rsautl" "-sign" "-inkey" key)
+ (sign-with-key key (current-input-port)))
+ ;; As invoked by guix-daemon.
(("rsautl" "-verify" "-inkey" _ "-pubin" "-in" signature-file)
(call-with-input-file signature-file
(lambda (port)
(validate-signature port))))
+ ;; As invoked by Nix/Crypto.pm (used by Hydra.)
+ (("rsautl" "-verify" "-inkey" _ "-pubin")
+ (validate-signature (current-input-port)))
(("--help")
(display (_ "Usage: guix authenticate OPTION...
Sign or verify the signature on the given file. This tool is meant to