diff options
author | Neal H. Walfield <neal@pep.foundation> | 2020-04-03 11:15:05 +0200 |
---|---|---|
committer | Neal H. Walfield <neal@pep.foundation> | 2020-04-03 11:34:02 +0200 |
commit | 72bb51dc3ba1d368cad1d833a734d39a32ba3149 (patch) | |
tree | f04f5746b41ce4a92058502d3e2868361f7e1150 /openpgp-ffi | |
parent | 8ebaf6e4ada1cea0b9e6f6dfee61c22cfdc9748c (diff) |
openpgp: Rename KeyIter to KeyAmalgamationIter
- Rename `KeyIter` to `KeyAmalgamationIter`, `ValidKeyIter` to
`ValidKeyAmalgamationIter`.
- Rename `cert/keyiter.rs` to `cert/amalgamation/iter.rs`.
Diffstat (limited to 'openpgp-ffi')
-rw-r--r-- | openpgp-ffi/include/sequoia/openpgp.h | 2 | ||||
-rw-r--r-- | openpgp-ffi/src/cert.rs | 80 | ||||
-rw-r--r-- | openpgp-ffi/src/serialize.rs | 8 |
3 files changed, 45 insertions, 45 deletions
diff --git a/openpgp-ffi/include/sequoia/openpgp.h b/openpgp-ffi/include/sequoia/openpgp.h index 09b2f49e..624435a0 100644 --- a/openpgp-ffi/include/sequoia/openpgp.h +++ b/openpgp-ffi/include/sequoia/openpgp.h @@ -681,7 +681,7 @@ pgp_valid_user_id_amalgamation_t pgp_cert_valid_user_id_iter_next (pgp_cert_vali /*/ void pgp_cert_valid_user_id_iter_free (pgp_cert_valid_user_id_iter_t iter); -/* openpgp::cert::KeyIter. */ +/* openpgp::cert::KeyAmalgamationIter. */ /*/ /// Changes the iterator to only return keys that have secret keys. diff --git a/openpgp-ffi/src/cert.rs b/openpgp-ffi/src/cert.rs index 4541c03e..89c61199 100644 --- a/openpgp-ffi/src/cert.rs +++ b/openpgp-ffi/src/cert.rs @@ -446,7 +446,7 @@ pub extern "C" fn pgp_cert_user_id_iter_next<'a>( } } -/// Wraps a ValidKeyIter for export via the FFI. +/// Wraps a ValidKeyAmalgamationIter for export via the FFI. pub struct ValidUserIDIterWrapper<'a> { pub(crate) // For serialize.rs. iter: Option<ValidComponentBundleIter<'a, openpgp::packet::UserID>>, @@ -494,12 +494,12 @@ pub extern "C" fn pgp_cert_valid_user_id_iter_next<'a>( } -/* cert::KeyIter. */ +/* cert::KeyAmalgamationIter. */ -/// Wraps a KeyIter for export via the FFI. -pub struct KeyIterWrapper<'a> { +/// Wraps a KeyAmalgamationIter for export via the FFI. +pub struct KeyAmalgamationIterWrapper<'a> { pub(crate) // For serialize.rs. - iter: Option<KeyIter<'a, openpgp::packet::key::PublicParts, + iter: Option<KeyAmalgamationIter<'a, openpgp::packet::key::PublicParts, openpgp::packet::key::UnspecifiedRole>>, // Whether next has been called. next_called: bool, @@ -511,10 +511,10 @@ pub struct KeyIterWrapper<'a> { /// subkeys. #[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn pgp_cert_key_iter(cert: *const Cert) - -> *mut KeyIterWrapper<'static> + -> *mut KeyAmalgamationIterWrapper<'static> { let cert = cert.ref_raw(); - box_raw!(KeyIterWrapper { + box_raw!(KeyAmalgamationIterWrapper { iter: Some(cert.keys()), next_called: false, }) @@ -523,7 +523,7 @@ pub extern "C" fn pgp_cert_key_iter(cert: *const Cert) /// Frees a pgp_cert_key_iter_t. #[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn pgp_cert_key_iter_free( - iter: Option<&mut KeyIterWrapper>) + iter: Option<&mut KeyAmalgamationIterWrapper>) { ffi_free!(iter) } @@ -533,11 +533,11 @@ pub extern "C" fn pgp_cert_key_iter_free( /// Note: you may not call this function after starting to iterate. #[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn pgp_cert_key_iter_secret<'a>( - iter_wrapper: *mut KeyIterWrapper<'a>) + iter_wrapper: *mut KeyAmalgamationIterWrapper<'a>) { let iter_wrapper = ffi_param_ref_mut!(iter_wrapper); if iter_wrapper.next_called { - panic!("Can't change KeyIter filter after iterating."); + panic!("Can't change KeyAmalgamationIter filter after iterating."); } use std::mem::transmute; @@ -552,11 +552,11 @@ pub extern "C" fn pgp_cert_key_iter_secret<'a>( /// Note: you may not call this function after starting to iterate. #[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn pgp_cert_key_iter_unencrypted_secret<'a>( - iter_wrapper: *mut KeyIterWrapper<'a>) + iter_wrapper: *mut KeyAmalgamationIterWrapper<'a>) { let iter_wrapper = ffi_param_ref_mut!(iter_wrapper); if iter_wrapper.next_called { - panic!("Can't change KeyIter filter after iterating."); + panic!("Can't change KeyAmalgamationIter filter after iterating."); } use std::mem::transmute; @@ -571,19 +571,19 @@ pub extern "C" fn pgp_cert_key_iter_unencrypted_secret<'a>( /// Note: you may not call this function after starting to iterate. #[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn pgp_cert_key_iter_policy<'a>( - iter_wrapper: *mut KeyIterWrapper<'a>, + iter_wrapper: *mut KeyAmalgamationIterWrapper<'a>, policy: *const Policy, when: time_t) - -> *mut ValidKeyIterWrapper<'static> + -> *mut ValidKeyAmalgamationIterWrapper<'static> { let policy = policy.ref_raw(); let iter_wrapper = ffi_param_ref_mut!(iter_wrapper); if iter_wrapper.next_called { - panic!("Can't change KeyIter filter after iterating."); + panic!("Can't change KeyAmalgamationIter filter after iterating."); } use std::mem::transmute; - box_raw!(ValidKeyIterWrapper { + box_raw!(ValidKeyAmalgamationIterWrapper { iter: Some(unsafe { transmute(iter_wrapper.iter.take().unwrap() .with_policy(&**policy, maybe_time(when))) @@ -603,7 +603,7 @@ pub extern "C" fn pgp_cert_key_iter_policy<'a>( /// *rso. #[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn pgp_cert_key_iter_next<'a>( - iter_wrapper: *mut KeyIterWrapper<'a>) + iter_wrapper: *mut KeyAmalgamationIterWrapper<'a>) -> Maybe<KeyAmalgamation<'a>> { let iter_wrapper = ffi_param_ref_mut!(iter_wrapper); @@ -616,10 +616,10 @@ pub extern "C" fn pgp_cert_key_iter_next<'a>( } } -/// Wraps a ValidKeyIter for export via the FFI. -pub struct ValidKeyIterWrapper<'a> { +/// Wraps a ValidKeyAmalgamationIter for export via the FFI. +pub struct ValidKeyAmalgamationIterWrapper<'a> { pub(crate) // For serialize.rs. - iter: Option<ValidKeyIter<'a, openpgp::packet::key::PublicParts, + iter: Option<ValidKeyAmalgamationIter<'a, openpgp::packet::key::PublicParts, openpgp::packet::key::UnspecifiedRole>>, // Whether next has been called. next_called: bool, @@ -633,10 +633,10 @@ pub struct ValidKeyIterWrapper<'a> { #[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn pgp_cert_valid_key_iter(cert: *const Cert, policy: *const Policy, when: time_t) - -> *mut ValidKeyIterWrapper<'static> + -> *mut ValidKeyAmalgamationIterWrapper<'static> { let cert = cert.ref_raw(); - let iter = box_raw!(KeyIterWrapper { + let iter = box_raw!(KeyAmalgamationIterWrapper { iter: Some(cert.keys()), next_called: false, }); @@ -647,7 +647,7 @@ pub extern "C" fn pgp_cert_valid_key_iter(cert: *const Cert, /// Frees a pgp_cert_key_iter_t. #[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn pgp_cert_valid_key_iter_free( - iter: Option<&mut ValidKeyIterWrapper>) + iter: Option<&mut ValidKeyAmalgamationIterWrapper>) { ffi_free!(iter) } @@ -657,11 +657,11 @@ pub extern "C" fn pgp_cert_valid_key_iter_free( /// Note: you may not call this function after starting to iterate. #[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn pgp_cert_valid_key_iter_secret<'a>( - iter_wrapper: *mut ValidKeyIterWrapper<'a>) + iter_wrapper: *mut ValidKeyAmalgamationIterWrapper<'a>) { let iter_wrapper = ffi_param_ref_mut!(iter_wrapper); if iter_wrapper.next_called { - panic!("Can't change ValidKeyIter filter after iterating."); + panic!("Can't change ValidKeyAmalgamationIter filter after iterating."); } use std::mem::transmute; @@ -676,11 +676,11 @@ pub extern "C" fn pgp_cert_valid_key_iter_secret<'a>( /// Note: you may not call this function after starting to iterate. #[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn pgp_cert_valid_key_iter_unencrypted_secret<'a>( - iter_wrapper: *mut ValidKeyIterWrapper<'a>) + iter_wrapper: *mut ValidKeyAmalgamationIterWrapper<'a>) { let iter_wrapper = ffi_param_ref_mut!(iter_wrapper); if iter_wrapper.next_called { - panic!("Can't change ValidKeyIter filter after iterating."); + panic!("Can't change ValidKeyAmalgamationIter filter after iterating."); } use std::mem::transmute; @@ -700,11 +700,11 @@ pub extern "C" fn pgp_cert_valid_key_iter_unencrypted_secret<'a>( /// Note: you may not call this function after starting to iterate. #[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn pgp_cert_valid_key_iter_for_certification<'a>( - iter_wrapper: *mut ValidKeyIterWrapper<'a>) + iter_wrapper: *mut ValidKeyAmalgamationIterWrapper<'a>) { let iter_wrapper = ffi_param_ref_mut!(iter_wrapper); if iter_wrapper.next_called { - panic!("Can't change KeyIter filter after iterating."); + panic!("Can't change KeyAmalgamationIter filter after iterating."); } iter_wrapper.iter = @@ -722,11 +722,11 @@ pub extern "C" fn pgp_cert_valid_key_iter_for_certification<'a>( /// Note: you may not call this function after starting to iterate. #[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn pgp_cert_valid_key_iter_for_signing<'a>( - iter_wrapper: *mut ValidKeyIterWrapper<'a>) + iter_wrapper: *mut ValidKeyAmalgamationIterWrapper<'a>) { let iter_wrapper = ffi_param_ref_mut!(iter_wrapper); if iter_wrapper.next_called { - panic!("Can't change KeyIter filter after iterating."); + panic!("Can't change KeyAmalgamationIter filter after iterating."); } iter_wrapper.iter = @@ -744,11 +744,11 @@ pub extern "C" fn pgp_cert_valid_key_iter_for_signing<'a>( /// Note: you may not call this function after starting to iterate. #[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn pgp_cert_valid_key_iter_for_storage_encryption<'a>( - iter_wrapper: *mut ValidKeyIterWrapper<'a>) + iter_wrapper: *mut ValidKeyAmalgamationIterWrapper<'a>) { let iter_wrapper = ffi_param_ref_mut!(iter_wrapper); if iter_wrapper.next_called { - panic!("Can't change KeyIter filter after iterating."); + panic!("Can't change KeyAmalgamationIter filter after iterating."); } iter_wrapper.iter = @@ -766,11 +766,11 @@ pub extern "C" fn pgp_cert_valid_key_iter_for_storage_encryption<'a>( /// Note: you may not call this function after starting to iterate. #[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn pgp_cert_valid_key_iter_for_transport_encryption<'a>( - iter_wrapper: *mut ValidKeyIterWrapper<'a>) + iter_wrapper: *mut ValidKeyAmalgamationIterWrapper<'a>) { let iter_wrapper = ffi_param_ref_mut!(iter_wrapper); if iter_wrapper.next_called { - panic!("Can't change KeyIter filter after iterating."); + panic!("Can't change KeyAmalgamationIter filter after iterating."); } iter_wrapper.iter = @@ -785,11 +785,11 @@ pub extern "C" fn pgp_cert_valid_key_iter_for_transport_encryption<'a>( /// Note: you may not call this function after starting to iterate. #[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn pgp_cert_valid_key_iter_alive<'a>( - iter_wrapper: *mut ValidKeyIterWrapper<'a>) + iter_wrapper: *mut ValidKeyAmalgamationIterWrapper<'a>) { let iter_wrapper = ffi_param_ref_mut!(iter_wrapper); if iter_wrapper.next_called { - panic!("Can't change KeyIter filter after iterating."); + panic!("Can't change KeyAmalgamationIter filter after iterating."); } iter_wrapper.iter = Some(iter_wrapper.iter.take().unwrap().alive()); @@ -801,12 +801,12 @@ pub extern "C" fn pgp_cert_valid_key_iter_alive<'a>( /// Note: you may not call this function after starting to iterate. #[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn pgp_cert_valid_key_iter_revoked<'a>( - iter_wrapper: *mut ValidKeyIterWrapper<'a>, + iter_wrapper: *mut ValidKeyAmalgamationIterWrapper<'a>, revoked: bool) { let iter_wrapper = ffi_param_ref_mut!(iter_wrapper); if iter_wrapper.next_called { - panic!("Can't change KeyIter filter after iterating."); + panic!("Can't change KeyAmalgamationIter filter after iterating."); } iter_wrapper.iter = @@ -822,7 +822,7 @@ pub extern "C" fn pgp_cert_valid_key_iter_revoked<'a>( /// *rso. #[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn pgp_cert_valid_key_iter_next<'a>( - iter_wrapper: *mut ValidKeyIterWrapper<'a>, + iter_wrapper: *mut ValidKeyAmalgamationIterWrapper<'a>, sigo: Option<&mut *mut Signature>, rso: Option<&mut *mut RevocationStatus<'a>>) -> Maybe<ValidKeyAmalgamation<'a>> diff --git a/openpgp-ffi/src/serialize.rs b/openpgp-ffi/src/serialize.rs index bcd2d6f2..b137a485 100644 --- a/openpgp-ffi/src/serialize.rs +++ b/openpgp-ffi/src/serialize.rs @@ -37,8 +37,8 @@ use self::openpgp::serialize::{ use super::keyid::KeyID; use super::packet::key::Key; -use super::cert::KeyIterWrapper; -use super::cert::ValidKeyIterWrapper; +use super::cert::KeyAmalgamationIterWrapper; +use super::cert::ValidKeyAmalgamationIterWrapper; /// Streams an OpenPGP message. /// @@ -279,7 +279,7 @@ fn pgp_recipient_set_keyid(recipient: *mut Recipient, keyid: *mut KeyID) { /// libc's allocator. #[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn pgp_recipients_from_key_iter<'a>( - iter_wrapper: *mut KeyIterWrapper<'a>, + iter_wrapper: *mut KeyAmalgamationIterWrapper<'a>, result_len: *mut size_t) -> *mut *mut Recipient<'a> { @@ -311,7 +311,7 @@ fn pgp_recipients_from_key_iter<'a>( /// libc's allocator. #[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn pgp_recipients_from_valid_key_iter<'a>( - iter_wrapper: *mut ValidKeyIterWrapper<'a>, + iter_wrapper: *mut ValidKeyAmalgamationIterWrapper<'a>, result_len: *mut size_t) -> *mut *mut Recipient<'a> { |