(keyring (get-openpgp-keyring
(open-bytevector-input-port
(call-with-input-file key read-radix-64)))))
- (match (lookup-key-by-id keyring %civodul-key-id)
- (((? openpgp-public-key? primary) packets ...)
- (let ((fingerprint (openpgp-public-key-fingerprint primary)))
- (and (= (openpgp-public-key-id primary) %civodul-key-id)
- (not (openpgp-public-key-subkey? primary))
- (string=? (openpgp-format-fingerprint fingerprint)
- %civodul-fingerprint)
- (string=? (openpgp-user-id-value (find openpgp-user-id? packets))
- "Ludovic Courtès <ludo@gnu.org>")
- (equal? (lookup-key-by-id keyring %civodul-key-id)
- (lookup-key-by-fingerprint keyring fingerprint))))))))
+ (let-values (((primary packets)
+ (lookup-key-by-id keyring %civodul-key-id)))
+ (let ((fingerprint (openpgp-public-key-fingerprint primary)))
+ (and (= (openpgp-public-key-id primary) %civodul-key-id)
+ (not (openpgp-public-key-subkey? primary))
+ (string=? (openpgp-format-fingerprint fingerprint)
+ %civodul-fingerprint)
+ (string=? (openpgp-user-id-value (find openpgp-user-id? packets))
+ "Ludovic Courtès <ludo@gnu.org>")
+ (eq? (lookup-key-by-fingerprint keyring fingerprint)
+ primary))))))
(test-equal "get-openpgp-detached-signature/ascii"
(list `(,%dsa-key-id ,%dsa-key-fingerprint dsa sha256)
(test-equal "verify-openpgp-signature, missing key"
`(missing-key ,%rsa-key-fingerprint)
(let* ((keyring (get-openpgp-keyring (%make-void-port "r")))
- (signature (get-openpgp-packet
- (open-bytevector-input-port
- (call-with-input-string %hello-signature/rsa
- read-radix-64)))))
+ (signature (string->openpgp-packet %hello-signature/rsa)))
(let-values (((status key)
(verify-openpgp-signature signature keyring
(open-input-string "Hello!\n"))))
(keyring (get-openpgp-keyring
(open-bytevector-input-port
(call-with-input-file key read-radix-64))))
- (signature (get-openpgp-packet
- (open-bytevector-input-port
- (call-with-input-string signature
- read-radix-64)))))
+ (signature (string->openpgp-packet signature)))
(let-values (((status key)
(verify-openpgp-signature signature keyring
(open-input-string "Hello!\n"))))
"tests/ed25519.key" "tests/ed25519.key"
"tests/ed25519.key"))))
(map (lambda (signature)
- (let ((signature (get-openpgp-packet
- (open-bytevector-input-port
- (call-with-input-string signature
- read-radix-64)))))
+ (let ((signature (string->openpgp-packet signature)))
(let-values (((status key)
(verify-openpgp-signature signature keyring
(open-input-string "What?!"))))