summaryrefslogtreecommitdiffstats
path: root/openpgp-ffi/examples
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2020-05-06 13:32:13 +0200
committerJustus Winter <justus@sequoia-pgp.org>2020-05-06 18:38:19 +0200
commit320884d10326fe186e974352391d51caa5cde571 (patch)
tree141d749c79f46183dfb2bd01e7cd7ae659292921 /openpgp-ffi/examples
parentc575a9b4d3d0644457d3a2ddfbfa0160d3490f19 (diff)
openpgp: Streamline iteration over MessageStructure.
- Implement IntoIter and Deref to &'a [MessageLayer<'a>], drop the custom iteration structs.
Diffstat (limited to 'openpgp-ffi/examples')
-rw-r--r--openpgp-ffi/examples/decrypt-with.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/openpgp-ffi/examples/decrypt-with.c b/openpgp-ffi/examples/decrypt-with.c
index 8bdb2d9d..4519a2f1 100644
--- a/openpgp-ffi/examples/decrypt-with.c
+++ b/openpgp-ffi/examples/decrypt-with.c
@@ -41,7 +41,8 @@ get_certs_cb (void *cookie_raw,
static pgp_status_t
check_cb (void *cookie_opaque, pgp_message_structure_t structure)
{
- pgp_message_structure_iter_t iter = pgp_message_structure_iter (structure);
+ pgp_message_structure_iter_t iter =
+ pgp_message_structure_into_iter (structure);
for (pgp_message_layer_t layer = pgp_message_structure_iter_next (iter);
layer;
@@ -142,7 +143,6 @@ check_cb (void *cookie_opaque, pgp_message_structure_t structure)
}
pgp_message_structure_iter_free (iter);
- pgp_message_structure_free (structure);
/* Implement your verification policy here. */
return PGP_STATUS_SUCCESS;