summaryrefslogtreecommitdiff
path: root/guix/scripts/authenticate.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-12-27 23:32:26 +0100
committerLudovic Courtès <ludo@gnu.org>2013-12-29 15:57:23 +0100
commitb0a33ac157ce99688b6d668124377fdd81bf413e (patch)
tree9b5e2c553a7b969b45f753f0b18c73519a692856 /guix/scripts/authenticate.scm
parent557813760d0dc74d5e5afba8aa4ea0310378eec2 (diff)
downloadguix-patches-b0a33ac157ce99688b6d668124377fdd81bf413e.tar
guix-patches-b0a33ac157ce99688b6d668124377fdd81bf413e.tar.gz
pk-crypto: Rename 'gcry-sexp' to 'canonical-sexp'.
* guix/pk-crypto.scm: Rename procedures, variables, etc. from 'gcry-sexp' to 'canonical-sexp'. Add comment with references. * guix/scripts/authenticate.scm, tests/pk-crypto.scm: Adjust accordingly.
Diffstat (limited to 'guix/scripts/authenticate.scm')
-rw-r--r--guix/scripts/authenticate.scm18
1 files changed, 9 insertions, 9 deletions
diff --git a/guix/scripts/authenticate.scm b/guix/scripts/authenticate.scm
index cbafed79d0..70ba7cb88e 100644
--- a/guix/scripts/authenticate.scm
+++ b/guix/scripts/authenticate.scm
@@ -33,10 +33,10 @@
;;;
;;; Code:
-(define (read-gcry-sexp file)
+(define (read-canonical-sexp file)
"Read a gcrypt sexp from FILE and return it."
(call-with-input-file file
- (compose string->gcry-sexp get-string-all)))
+ (compose string->canonical-sexp get-string-all)))
(define (read-hash-data file)
"Read sha256 hash data from FILE and return it as a gcrypt sexp."
@@ -56,18 +56,18 @@
(("rsautl" "-sign" "-inkey" key "-in" hash-file)
;; Sign the hash in HASH-FILE with KEY, and return an sexp that includes
;; both the hash and the actual signature.
- (let* ((secret-key (read-gcry-sexp key))
+ (let* ((secret-key (read-canonical-sexp key))
(data (read-hash-data hash-file)))
(format #t
"(guix-signature ~a (payload ~a))"
- (gcry-sexp->string (sign data secret-key))
- (gcry-sexp->string data))
+ (canonical-sexp->string (sign data secret-key))
+ (canonical-sexp->string data))
#t))
(("rsautl" "-verify" "-inkey" key "-pubin" "-in" signature-file)
;; Read the signature as produced above, check it against KEY, and print
;; the signed data to stdout upon success.
- (let* ((public-key (read-gcry-sexp key))
- (sig+data (read-gcry-sexp signature-file))
+ (let* ((public-key (read-canonical-sexp key))
+ (sig+data (read-canonical-sexp signature-file))
(data (find-sexp-token sig+data 'payload))
(signature (find-sexp-token sig+data 'sig-val)))
(if (and data signature)
@@ -79,12 +79,12 @@
(begin
(format (current-error-port)
"error: invalid signature: ~a~%"
- (gcry-sexp->string signature))
+ (canonical-sexp->string signature))
(exit 1)))
(begin
(format (current-error-port)
"error: corrupt signature data: ~a~%"
- (gcry-sexp->string sig+data))
+ (canonical-sexp->string sig+data))
(exit 1)))))
(("--help")
(display (_ "Usage: guix authenticate OPTION...