mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
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.
This commit is contained in:
parent
9dbe6e43ea
commit
9b0a2233db
2 changed files with 20 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue