How to Determine Digest Algorithm
patrick at mozilla-enigmail.org
Wed Dec 20 17:40:41 CET 2006
-----BEGIN PGP SIGNED MESSAGE-----
David Shaw wrote:
> On Tue, Dec 19, 2006 at 09:33:25AM +0100, Patrick Brunschwig wrote:
>> I'm trying to find a good way to determine the digest algorithm that
>> GnuPG uses for a signed message. My problem is this: for PGP/MIME signed
>> messages, I need to know the algorithm before the message is created.
>> Therefore I create a signed dummy message, and extract from it the hash
>> algorithm. However, the problem is that this requires the user to type
>> the passphrase twice, which I would like to avoid.
> What mutt does for this is to make the signature first and grab the
> digest algorithm from that to make the micalg field. Does that method
> not work given the way Enigmail ties into the mail code?
Unfortunately not, or at least not without a major rewrite of a large part.
>> Is there a better way to determine the hash algorithm without actually
>> creating a signed message?
> At the moment, not really, but it's not impossible to add a way to ask
> GPG the question "if you were going to make a signature, which hash
> algorithm would you use".
That would be nice for the future, but I think in short term, I'll find
a way to cache the passphrase for the 2nd call to gpg.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
More information about the Gnupg-devel