Re: Decrypting openpgp data created by gpg
Lahiru Dissanayake <[email protected]> Thu, 28 Feb 2013 00:07:47 +0800
| Newsgroups | gmane.comp.encryption.cryptlib |
|---|---|
| Message-ID | <CAHeAcfA1gkvJ2Q6F7SJGqGikpTApC63Wx1TvqV6bqo3h0iOWHw@mail.gmail.com> |
Hi Peter, Another small issue that I found related to PGP: I need to use nested enveloping to encrypt a compressed envelope (and set the CRYPT_ENVINFO_CONTENTTYPE attribute of the encrypting envelope to CRYPT_CONTENT_COMPRESSEDDATA in the process). However when I decrypt such an encrypted envelope (which contains compressed data), the content type I get back from the envelope is CRYPT_CONTENT_DATA instead of CRYPT_CONTENT_COMPRESSEDDATA. Again, this works properly when the envelope type is set to CRYPT_FORMAT_CRYPTLIB. I think this is a problem in the enveloping step (as opposed to the de-enveloping step), as I have successfully de-enveloped PGP messages with the same structure that were created by a different program (for example, when solving the original problem I had). Thanks, Lahiru On Wed, Feb 27, 2013 at 2:28 PM, Lahiru Dissanayake <[email protected]>wrote: > Hi Peter, > > Found another issue similar to this when specifying the > CRYPT_ENVINFO_SIGNATURE attribute to verify a digitally signed PGP > envelope. The following line returns -2 in the de-enveloping process: > > status = cryptSetAttribute(cryptEnvelope, CRYPT_ENVINFO_SIGNATURE, > publicKeyContext); > > You don't get this error when the envelope type is CRYPT_FORMAT_CRYPTLIB. > Similar to the issue with the private key context, directly specifying a > keyset instead of the above line works. > > I'd appreciate it if you could provide a simple workaround as before, > rather than having to wait for the next release. > > Thanks, > Lahiru > > > On Mon, Feb 25, 2013 at 10:47 AM, Peter Gutmann <[email protected] > > wrote: > >> Lahiru Dissanayake <[email protected]> writes: >> >> >Are you sure this works? Because the line >> >{ CRYPT_ENVINFO_PRIVATEKEY, formatAll, ACTION_CRYPT, >> MESSAGE_CHECK_PKC_DECRYPT, 0 }, >> >fixed the error, but the new one >> >{ CRYPT_ENVINFO_PRIVATEKEY, formatAllDeenv, ACTION_CRYPT, >> MESSAGE_CHECK_PKC_DECRYPT, ENVELOPE_ISDEENVELOPE }, >> >brought it back. >> >> Ah, you also need to change formatAllDeenv to: >> >> static const CRYPT_FORMAT_TYPE formatAllDeenv[] = { >> CRYPT_FORMAT_AUTO, CRYPT_FORMAT_CMS, CRYPT_FORMAT_PGP, >> CRYPT_FORMAT_NONE, CRYPT_FORMAT_NONE }; >> >> but then there are changes elsewhere as well... for now just leave it at >> formatAll and it should work, the next release will contain the full set >> of >> changes. >> >> 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.