Page MenuHome GnuPG

GPGME cannot decode all messages starting with -----BEGIN PGP MESSAGE-----
Closed, InvalidPublic

Description

I cannot find any way to decode this message with GPGME:

-----BEGIN PGP MESSAGE-----
Version: GnuPG v1.2.1 (AIX)

rDViDWNoay4yNTg0MC5kYXQ+P/27SGFsbG8sCmRpZXMgaXN0CmVpbiBUZXN0LgpU
c2No/N8hCg==

6JJ3

-----END PGP MESSAGE-----

This message is neither signed nor encrypted, only compressed.

Running gpg -o- filename.asc writes the plain message on the screen.

gpgme_op_verify(ctx,inputdata,NULL,outputdata) returns successful, but does
not return any data in outputdata.

gpgme_op_decrypt_verify(ctx,inputdata,outputdata) and
gpgme_op_decrypt(ctx,inputdata,outputdata) both fail with GPG_ERR_DECRYPT_FAILED.

Each of these results is somewhat reasonable. Thus another function is needed
to be able to get the plaintext from any valid OpenPGP message.

Because you even don't know which of the functions gpgme_op_verify(),
gpgme_op_decrypt(), or gpgme_op_decrypt_verify() should be called when you see
the line -----BEGIN PGP MESSAGE-----, the new function should be a generic one
that works for any message beginning with this line, always returning the
plaintext (unless decryption fails, of course).

Such a function is a prerequisite for GPGME being used by an e-mail program.
(Or am I missing something?)

Thanks in advance

Details

Due Date
Jan 15 2009, 1:00 AM
Version
1.1.6

Event Timeline

perske added projects: Feature Request, gpgme.
perske added a subscriber: perske.
werner added a subscriber: werner.

I was not aware that such OpenPGP messages are actually used. We need to see how
to implement that.

Such a fucntion is not required for email software becuase such packets are not
allwoed by PGP/MIME and I doubt that inline PGP message without encryption and
signatures have been used in the past at all. New software should not support
the creation of inline PGP messages but create PGP/MIME messages.

Thanks!

Background info: My e-mail program is currently calling gpg via fork() and
exec() and is thus very GnuPG version dependent. It does not create such
messages, but can display them. Trying to get rid of the version dependency,
I've tried to switch to GPGME and stumbled about a test message I've received
years ago. Unfortunately the header lines do not mention what mail program was
used for sending.

Marcus: Can you please check whether we can easily add this to gpgme_op_decrypt?

Works fine for me with gpgme_op_verify, which actually runs the gpgme -o command
as you gave it. Did you rewind the output data object before trying to
read the data?

$ gcc -Wall -o t-decompress t-decompress.c
$ ./t-decompress
result = 0x80538d0
Hallo,
dies ist
ein Test.
Tsch

See attachment for source file.

marcus added a project: Restricted Project.
marcus removed a project: Feature Request.

Note: It also works for gpgme_op_decrypt_verify, but the error code
GPG_ERR_NO_DATA needs to be ignored in this case. This is because we didn't get
a DECRYPTION_OKAY status message, and this is semantically the same as for a
signed but not decrypted file. We can consider making this case better in a
major upgrade when we change the ABI anyway, but not now.

werner set Due Date to Jan 15 2009, 1:00 AM.Dec 8 2008, 11:01 AM
werner added a project: Info Needed.
werner removed a project: Restricted Project.

Closing this report. If further support is required, please reopen.