Detect and download the public key automatically #1
Labels
No Label
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: yarmo/opsv#1
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
Hi,
Thanks for your verification page, this looks really nice!
I think it could be improved further: as signatures contain signing key ID that could be used to try to automatically download the key from keys.openpgp.org.
Signatures can also have embedded "signer's UID" that's usually e-mail embedded by GnuPG when using
--sender
or--default-key $EMAIL
options. This allows fetching the key via WKD when verifying the signature.This can be seen in practice using the following command:
As the signature at that address contains Signers UID packet
gpg --auto-key-retrieve
will fetch the key using WKD instead of user's configured keyserver.I hope this looks like something in scope for opsv :)
Have a nice day!
That's a great idea, truly get a one-click solution going on! Looking into it
Glad that you like it!
I remember extracting Signer's UID once with:
Maybe you can re-purpose this code. Either way OpenPGP.js is easy to hack on so I'm sure you'll find a way :)
See you later! 👋
Working on it right now, interestingly
signersUserId
is equal tonull
for all signatures I tested with, including those by other people. Maybe I need to add some option at signing time? Will try now.Had to use an extra .toHex(), got it working!
Yes, exactly. You can either use
gpg --default-key $EMAIL
orgpg --sender $EMAIL --clearsign
(or sign etc.).You can check if you got that right by using
gpg --list-packets $FILE
and seeing if you got "Signers UID" packet there (the value won't be shown, sadly).Hope that helps!
For testing you can check out my clearsigned file that has this packet: https://metacode.biz/.well-known/security.txt
I tried the clearsigned message from https://metacode.biz/.well-known/security.txt and it worked!
I suppose I should add a message to incite the user to verify the fingerprint as right now, we could very well proving a forged message was indeed signed by an impostor with a completely different key!
Oh, I know see in your clearsigned message that indeed the "signersUserId" is now filled in! Awesome! Will add support now for this use-case.
Yes, definitely! I'd suggest printing primary key fingerprint if verification succeeds so that the user can double-check if that's the correct key. That's what GnuPG does too.
Cool! Can't wait to test it! Thanks for your work :)
Thanks for your help and your time!
Here's a signature without sender:
and one with:
All should work now and different messages appear depending on whether a userId and/or a keyId is found.
Oh, by the way - how could I've forgotten 🤦 There is a really cool site for debugging OpenPGP messages: https://dump.sequoia-pgp.org/
If you paste your second message you'll see:
Much better than
gpg --list-packets
!See you later! 👋
Awesome tool! (sequoia-pgp rocks 👍 )