civodul pushed a commit to branch wip-openpgp
in repository guix.
commit aaeed0a2c602b7f6420da91546ed0bd4d5b3f753
Author: Ludovic Courtès <[email protected]>
AuthorDate: Sat May 2 23:11:35 2020 +0200
squash! git-authenticate: Load the list of authorized keys from the tree.
'load-keyring-from-blob' accepts binary keyrings.
---
build-aux/git-authenticate.scm | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/build-aux/git-authenticate.scm b/build-aux/git-authenticate.scm
index 9774960..632471a 100644
--- a/build-aux/git-authenticate.scm
+++ b/build-aux/git-authenticate.scm
@@ -323,11 +323,13 @@ key: ~a")
signing-key)
(define (load-keyring-from-blob repository oid keyring)
- "Augment KEYRING with the keyring available in the blob at OID."
+ "Augment KEYRING with the keyring available in the blob at OID, which may or
+may not be ASCII-armored."
(let* ((blob (blob-lookup repository oid))
- (bv (read-radix-64
- (open-bytevector-input-port (blob-content blob)))))
- (get-openpgp-keyring (open-bytevector-input-port bv)
+ (port (open-bytevector-input-port (blob-content blob))))
+ (get-openpgp-keyring (if (port-ascii-armored? port)
+ (open-bytevector-input-port (read-radix-64 port))
+ port)
keyring)))
(define (load-keyring-from-reference repository reference)