Re: Decrypting openpgp data created by gpg

Peter Gutmann <[email protected]> Mon, 25 Feb 2013 13:34:14 +1300
Newsgroups gmane.comp.encryption.cryptlib
Message-ID <[email protected]>
Lahiru Dissanayake <[email protected]> writes:

>I still don't get it. If you included CAST5 in Cryptlib because GPG uses it,
>why can't I set it as the algorithm of an OpenPGP envelope? (Note that I'm
>not trying to set it as a *Cryptlib configuration option*, but just on an
>envelope, as mentioned in page 279 of the Cryptlib manual).

It's to do with the way the attribtes are handled, there's no way for 
cryptSetAttribute to distinguish from "allowed values when 
CRYPT_OPTION_ENCR_ALGO is set for the default user object" vs. "allowed values 
when CRYPT_OPTION_ENCR_ALGO is set for PGP encryption envelopes if the PGP 
format is enabled at compile time", there's only a single check for the 
attribute as a whole.  If you really need to use CAST5 then you can change the 
allowedEncrAlgoSubranges table at line 278 of kernel/attr_acl.c, changing:

{ CRYPT_ALGO_AES, CRYPT_ALGO_BLOWFISH },	/* No IDEA, CAST, RC2, RC4, RC5 */

to:

{ CRYPT_ALGO_CAST, CRYPT_ALGO_BLOWFISH },	/* No IDEA */

>I've attached the code that I used to test these functions. It also contains
>the libcl.a file that is created on my mac when running make.

Thanks.  This is a bit of a complex fix, for now the quickest workaround is to 
change line 1290 of envelope/env_attr.c from:

{ CRYPT_ENVINFO_PRIVATEKEY,	formatAllDeenv,	ACTION_CRYPT,	MESSAGE_CHECK_PKC_DECRYPT, 0 },

to:

{ CRYPT_ENVINFO_PRIVATEKEY,	formatAll,		ACTION_CRYPT,	MESSAGE_CHECK_PKC_DECRYPT, 0 },

I'll get a more complete fix into the next release.  I'll check the 
CRYPT_ENVINFO_INTEGRITY issue in a minute, I'm on my way to the RSA conference 
so it's a bit tricky finding Internet access and time, I'll do it as soon as I 
can.

Peter.

_______________________________________________
Cryptlib mailing list
[email protected] via Mail: [email protected]
Archive: ftp://ftp.franken.de/pub/crypt/cryptlib/archives/
http://news.gmane.org/gmane.comp.encryption.cryptlib
Posts from non-subscribed addresses are blocked to prevent spam, please
subscribe in order to post messages.