diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2019-05-09 15:19:24 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2019-05-09 15:19:24 +0200 |
commit | 75d4e6dda12e8b7ae8573227e61e718ede3f2cfc (patch) | |
tree | c6b9e3f177d8c65d134acfd889c236203b2ac13f /openpgp-ffi/include/sequoia/openpgp | |
parent | 8e0f817f312f469871a5fbed6bb961f6117ba742 (diff) |
openpgp: Communicate message structure from the decryptor.
- Fixes #100.
Diffstat (limited to 'openpgp-ffi/include/sequoia/openpgp')
-rw-r--r-- | openpgp-ffi/include/sequoia/openpgp/types.h | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/openpgp-ffi/include/sequoia/openpgp/types.h b/openpgp-ffi/include/sequoia/openpgp/types.h index c6572346..40c926d0 100644 --- a/openpgp-ffi/include/sequoia/openpgp/types.h +++ b/openpgp-ffi/include/sequoia/openpgp/types.h @@ -464,18 +464,38 @@ typedef enum pgp_encryption_mode { PGP_ENCRYPTION_MODE_FOR_TRANSPORT = 1, } pgp_encryption_mode_t; -typedef struct pgp_verification_results *pgp_verification_results_t; +/// Communicates the message structure to the VerificationHelper. +typedef struct pgp_message_structure *pgp_message_structure_t; + +/// Iterates over the message structure. +typedef struct pgp_message_structure_iter *pgp_message_structure_iter_t; + +/// Represents a layer of the message structure. +typedef struct pgp_message_layer *pgp_message_layer_t; + +typedef enum pgp_message_layer_variant { + PGP_MESSAGE_LAYER_COMPRESSION = 1, + PGP_MESSAGE_LAYER_ENCRYPTION = 2, + PGP_MESSAGE_LAYER_SIGNATURE_GROUP = 3, + + /* Dummy value to make sure the enumeration has a defined size. Do + not use this value. */ + PGP_MESSAGE_LAYER_CODE_FORCE_WIDTH = INT_MAX, +} pgp_message_layer_variant_t; + typedef struct pgp_verification_result *pgp_verification_result_t; -typedef enum pgp_verification_result_code { - PGP_VERIFICATION_RESULT_CODE_GOOD_CHECKSUM = 1, - PGP_VERIFICATION_RESULT_CODE_MISSING_KEY = 2, - PGP_VERIFICATION_RESULT_CODE_BAD_CHECKSUM = 3, +typedef struct pgp_verification_result_iter *pgp_verification_result_iter_t; + +typedef enum pgp_verification_result_variant { + PGP_VERIFICATION_RESULT_GOOD_CHECKSUM = 1, + PGP_VERIFICATION_RESULT_MISSING_KEY = 2, + PGP_VERIFICATION_RESULT_BAD_CHECKSUM = 3, /* Dummy value to make sure the enumeration has a defined size. Do not use this value. */ PGP_VERIFICATION_RESULT_CODE_FORCE_WIDTH = INT_MAX, -} pgp_verification_result_code_t; +} pgp_verification_result_variant_t; typedef pgp_status_t (*pgp_decryptor_get_public_keys_cb_t) (void *, pgp_keyid_t *, size_t, @@ -494,8 +514,7 @@ typedef pgp_status_t (*pgp_decryptor_decrypt_cb_t) (void *, void *, pgp_fingerprint_t *); -typedef pgp_status_t (*pgp_decryptor_check_signatures_cb_t) (void *, - pgp_verification_results_t, - size_t); +typedef pgp_status_t (*pgp_decryptor_check_cb_t) (void *, + pgp_message_structure_t); #endif |