core: Enhance gpgme_data_identify to detect binary PGP messages.
authorWerner Koch <wk@gnupg.org>
Tue, 21 Jun 2016 14:14:02 +0000 (16:14 +0200)
committerWerner Koch <wk@gnupg.org>
Tue, 21 Jun 2016 14:18:00 +0000 (16:18 +0200)
commit32d4bbf5e3e5f88e4a6852d72a35ee30df9d5279
tree00d3c8b3919be831b1e331169666e7405e3c768e
parent8997d88bf97d1784706becbf8e9dc74e4656e311
core: Enhance gpgme_data_identify to detect binary PGP messages.

* src/gpgme.h.in (GPGME_DATA_TYPE_PGP_ENCRYPTED): New.
(GPGME_DATA_TYPE_PGP_SIGNATURE): New.
* src/data-identify.c: Add enum for OpenPGP packet types.
(buf32_to_ulong): New.
(next_openpgp_packet): New.  Based on the gnupg/kbx/keybox-openpgp.c
implementation and relicensed to LGPL by g10 Code.
(pgp_binary_detection): New.
(basic_detection): Call pgp_binary_detection instead of returning
unknown.

Signed-off-by: Werner Koch <wk@gnupg.org>
NEWS
src/data-identify.c
src/gpgme.h.in