summaryrefslogtreecommitdiff
path: root/tests/git-authenticate.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2020-06-08 16:34:53 +0200
committerLudovic Courtès <ludo@gnu.org>2020-06-16 16:10:46 +0200
commit1e2b9bf2d4ed4edc9ed70c51f414bb2890074a21 (patch)
tree2812fef2c1c0fca46a1bea6796930785c4e69a4e /tests/git-authenticate.scm
parent41946b79f10d9b18e66c81f4eb35e1fde132c3ef (diff)
tests: Move OpenPGP helpers to (guix tests gnupg).
* tests/git-authenticate.scm (key-id): Remove. (%ed25519-public-key-file, %ed25519-secret-key-file) (%ed25519bis-public-key-file, %ed25519bis-secret-key-file) (read-openpgp-packet, key-fingerprint): Move to... * guix/tests/gnupg.scm: ... here.
Diffstat (limited to 'tests/git-authenticate.scm')
-rw-r--r--tests/git-authenticate.scm25
1 files changed, 0 insertions, 25 deletions
diff --git a/tests/git-authenticate.scm b/tests/git-authenticate.scm
index 97990acaea5..a06176c16ba 100644
--- a/tests/git-authenticate.scm
+++ b/tests/git-authenticate.scm
@@ -32,31 +32,6 @@
32 32
33;; Test the (guix git-authenticate) tools. 33;; Test the (guix git-authenticate) tools.
34 34
35(define %ed25519-public-key-file
36 (search-path %load-path "tests/ed25519.key"))
37(define %ed25519-secret-key-file
38 (search-path %load-path "tests/ed25519.sec"))
39(define %ed25519bis-public-key-file
40 (search-path %load-path "tests/ed25519bis.key"))
41(define %ed25519bis-secret-key-file
42 (search-path %load-path "tests/ed25519bis.sec"))
43
44(define (read-openpgp-packet file)
45 (get-openpgp-packet
46 (open-bytevector-input-port
47 (call-with-input-file file read-radix-64))))
48
49(define key-fingerprint
50 (compose openpgp-format-fingerprint
51 openpgp-public-key-fingerprint
52 read-openpgp-packet))
53
54(define (key-id file)
55 (define id
56 (openpgp-public-key-id (read-openpgp-packet)))
57
58 (string-pad (number->string id 16) 16 #\0))
59
60(define (gpg+git-available?) 35(define (gpg+git-available?)
61 (and (which (git-command)) 36 (and (which (git-command))
62 (which (gpg-command)) (which (gpgconf-command)))) 37 (which (gpg-command)) (which (gpgconf-command))))