Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPG message with multiple signatures #21

Closed
vsajip opened this issue Oct 28, 2014 · 12 comments
Closed

GPG message with multiple signatures #21

vsajip opened this issue Oct 28, 2014 · 12 comments
Labels
enhancement New feature or request minor

Comments

@vsajip
Copy link
Owner

vsajip commented Oct 28, 2014

Original report by Anonymous.


From what I understant gpg.verify will return a result with information about the last valid signature it encounters while parsing GPG's output.

Any suggestions on how to handle this if I were to write a patch?

@vsajip
Copy link
Owner Author

vsajip commented Oct 28, 2014

Sorry, I don't quite understand. A patch to do what, exactly?

@vsajip
Copy link
Owner Author

vsajip commented Oct 29, 2014

Original comment by Anonymous.


A patch that makes gpg.verify give me an array of keyids/fingerprints.

Some examples of multiple signing: http://lists.gnupg.org/pipermail/gnupg-users/2013-July/047118.html

I haven't really tested anything yet, but reading the code makes me think I can't do this with the current version. Please correct me if I'm wrong.

@vsajip
Copy link
Owner Author

vsajip commented Oct 30, 2014

Is this an officially supported feature of GnuPG? How does one use GnuPG to add multiple signatures?

@vsajip
Copy link
Owner Author

vsajip commented Oct 30, 2014

Original comment by Ben McGinnes (Bitbucket: benmcginnes, ).


Yes it is an officially supported feature of GPG and it is used to handle transitioning from one key to another (e.g. the shift from DSA keys back to RSA a few years ago).

BTW, since GPG 2.1 is nearly at the end of the beta cycle, this will become more of an issue soon when people start adopting EC keys in the not too distant future.

@vsajip
Copy link
Owner Author

vsajip commented Oct 30, 2014

Original comment by Anonymous.


Vinay, you could do it like this if you have two keys on your secring : gpg --sign -u me@home -u me@work

@vsajip
Copy link
Owner Author

vsajip commented Oct 30, 2014

Then I suppose to be consistent, this functionality would also need to be supported (currently, only one signer is assumed both for signing and verification). Tests and docs would need updating. For backward compatibility, the existing API shouldn't change, but the object that collects results could grow a new list attribute to which all collected signatures are added. The keyid and passphrase parameters in the signing APIs would need to accept sequences of key ids and corresponding passphrases, with error checking for equal lengths etc.

@vsajip
Copy link
Owner Author

vsajip commented Oct 30, 2014

Also, if this functionality is available for GPG2 only, we would need to check for that.

@vsajip
Copy link
Owner Author

vsajip commented Oct 31, 2014

Original comment by Ben McGinnes (Bitbucket: benmcginnes, ).


No, it's available in 1.4.x and has been available for a long time. I still use the 1.4 branch because it's easier to customise before compiling (I tweak the max key sizes and secure memory). Anyway, I transitioned from my DSA/ElGamal key a bit over 2 years ago to my current RSA/ElGamal key (yeah, that's possible too) and created a transition document with just such a double signature. It's here:

http://www.adversary.org/keyswitch.txt.asc

Feel free to test with it, but verification should show good signatures from 0x371AC5BFA04AE313 (the old key) and 0x321E4E2373590E5D (the current one), though as it is a message the latter key will have used the 0x7FF2D37135C7553C signing subkey.

Yeah, here it is:

bash4-4.3$ gpg -v --verify keyswitch.txt.asc 
gpg: armor header: Hash: SHA512
gpg: original file name=''
gpg: Signature made Sun 29 Jul 12:08:05 2012 AEST
gpg:                using DSA key 0x371AC5BFA04AE313
gpg: Good signature from "Ben McGinnes <ben@adversary.org>"
gpg:                 aka "Ben McGinnes <ben-work@adversary.org>"
gpg:                 aka "Ben McGinnes (A secondary address - primary address is still ben@adversary.org) <benmcginnes@gmail.com>"
gpg: textmode signature, digest algorithm SHA512
gpg: Signature made Sun 29 Jul 12:08:05 2012 AEST
gpg:                using RSA key 0x7FF2D37135C7553C
gpg: using subkey 0x7FF2D37135C7553C instead of primary key 0x321E4E2373590E5D
gpg: Good signature from "Ben McGinnes <ben@adversary.org>"
gpg:                 aka "Ben McGinnes (backup email address) <benmcginnes@gmail.com>"
gpg:                 aka "Ben McGinnes <ben.mcginnes@pirateparty.org.au>"
gpg:                 aka "Ben McGinnes <ben.mcginnes@pirate.org.au>"
gpg: textmode signature, digest algorithm SHA512
bash4-4.3$ 

Obviously the time is local to me, but you should see the same thing.

@vsajip
Copy link
Owner Author

vsajip commented Oct 31, 2014

@benmcginnes Thanks, this is helpful. I'm a little busy at the moment but I hope to look at this soon. If @abfg wants to have a go at a patch along the lines I suggested above, I'll be happy to have a look at it.

@vsajip
Copy link
Owner Author

vsajip commented Dec 7, 2014

Original changes by Vinay Sajip (Bitbucket: vinay.sajip, GitHub: vsajip).


removed "0.3.7" milestone

@vsajip
Copy link
Owner Author

vsajip commented Oct 27, 2018

Should be fixed in b72bbe0.

@vsajip
Copy link
Owner Author

vsajip commented Oct 27, 2018

Original changes by Vinay Sajip (Bitbucket: vinay.sajip, GitHub: vsajip).


changed content from "From what I understant gpg.verify will return a result with information about the last valid signature it encounters while parsing GPG's output.

Any suggestions on how to handle this if I were to write a patch?
" to "From what I understant gpg.verify will return a result with information about the last valid signature it encounters while parsing GPG's output.

Any suggestions on how to handle this if I were to write a patch?"; changed state from "new" to "resolved"

@vsajip vsajip closed this as completed Oct 27, 2018
vsajip added a commit that referenced this issue Dec 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request minor
Projects
None yet
Development

No branches or pull requests

1 participant