GpgME: gpgme_op_import_result() for crap data
Albrecht Dreß
albrecht.dress at arcor.de
Sat Jan 12 16:52:11 CET 2019
Hi all,
when I call gpg to import some crap data, a proper error message is returned, e.g.:
<snip>
user at host:~$ gpg --import <<< 'some crap'
gpg: no valid OpenPGP data found.
gpg: Total number processed: 0
</snip>
However, calling gpgme_op_import() on the same data, and then reading gpgme_op_import_result(), no usable error information is returned. E.g. running the attached simple code, the result is
<snip>
user at host:~$ ./gpgme-import
GpgME version: 1.12.0
gpgme_new: 0
gpgme_set_protocol: 0
gpgme_data_new_from_mem: 0
gpgme_op_import: 0
gpgme_op_import_result: imported=0, not imported=0, imports=(nil)
</snip>
I would expect that imports is not NULL, and imports->result indicate the error (probably GPG_ERR_INV_DATA).
Did I miss something here (i.e. I have to read the error information somewhere else), or is this information left out intentionally?
Thanks
Albrecht.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gpgme-import.c
Type: text/x-csrc
Size: 735 bytes
Desc: not available
URL: <https://lists.gnupg.org/pipermail/gnupg-devel/attachments/20190112/9c9e29d2/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <https://lists.gnupg.org/pipermail/gnupg-devel/attachments/20190112/9c9e29d2/attachment.sig>
More information about the Gnupg-devel
mailing list