diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2019-01-17 17:58:28 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2019-01-17 17:58:28 +0100 |
commit | ddf8b43b70e9b89237fe8a8f946582ed7878e367 (patch) | |
tree | 5616fde0bf51e9a903140cfc289cff68892dd872 /openpgp-ffi | |
parent | 72f7f83fa697ac44d962dc65ef9329dcfe6fd3e8 (diff) |
openpgp-ffi: Rename 'pgp_p_key*' to 'pgp_key*'.
- This is the result of the following command:
git grep -il pgp_p_key | while read F ; do sed -E -i -e 's/pgp_p_key/pgp_key/g' $F ; done
- Fixes #155.
Diffstat (limited to 'openpgp-ffi')
-rw-r--r-- | openpgp-ffi/include/sequoia/openpgp.h | 36 | ||||
-rw-r--r-- | openpgp-ffi/include/sequoia/openpgp/crypto.h | 4 | ||||
-rw-r--r-- | openpgp-ffi/src/common.rs | 26 | ||||
-rw-r--r-- | openpgp-ffi/src/tpk.rs | 12 |
4 files changed, 39 insertions, 39 deletions
diff --git a/openpgp-ffi/include/sequoia/openpgp.h b/openpgp-ffi/include/sequoia/openpgp.h index 368eab2e..7289e021 100644 --- a/openpgp-ffi/include/sequoia/openpgp.h +++ b/openpgp-ffi/include/sequoia/openpgp.h @@ -417,7 +417,7 @@ const char *pgp_tag_to_string (pgp_tag_t tag); typedef struct pgp_unknown *pgp_unknown_t; typedef struct pgp_signature *pgp_signature_t; typedef struct pgp_one_pass_sig *pgp_one_pass_sig_t; -typedef struct pgp_p_key *pgp_p_key_t; +typedef struct pgp_key *pgp_key_t; typedef struct pgp_user_id *pgp_user_id_t; typedef struct pgp_user_attribute *pgp_user_attribute_t; typedef struct pgp_literal *pgp_literal_t; @@ -448,7 +448,7 @@ typedef union pgp_packet { pgp_unknown_t unknown; pgp_signature_t signature; pgp_one_pass_sig_t one_pass_sig; - pgp_p_key_t key; + pgp_key_t key; pgp_user_id_t user_id; pgp_user_attribute_t user_attribute; pgp_literal_t literal; @@ -653,7 +653,7 @@ pgp_keyid_t pgp_pkesk_recipient(pgp_pkesk_t pkesk); /// the session key. /*/ pgp_status_t pgp_pkesk_decrypt (pgp_error_t *errp, pgp_pkesk_t pkesk, - pgp_p_key_t secret_key, + pgp_key_t secret_key, uint8_t *algo, /* XXX */ uint8_t *key, size_t *key_len); @@ -744,7 +744,7 @@ typedef struct pgp_tpk_key_iter *pgp_tpk_key_iter_t; /// If rso is not NULL, this stores the key's revocation status in /// *rso. /*/ -pgp_p_key_t pgp_tpk_key_iter_next (pgp_tpk_key_iter_t iter, +pgp_key_t pgp_tpk_key_iter_next (pgp_tpk_key_iter_t iter, pgp_signature_t *signature, pgp_revocation_status_t *rev); @@ -882,7 +882,7 @@ pgp_tsk_t pgp_tpk_into_tsk (pgp_tpk_t tpk); /// The tpk still owns the key. The caller should neither modify nor /// free the key. /*/ -pgp_p_key_t pgp_tpk_primary (pgp_tpk_t tpk); +pgp_key_t pgp_tpk_primary (pgp_tpk_t tpk); /*/ /// Returns the TPK's revocation status. @@ -1075,19 +1075,19 @@ pgp_status_t pgp_tsk_serialize (pgp_error_t *errp, /*/ /// Clones the key. /*/ -pgp_p_key_t pgp_p_key_clone (pgp_p_key_t key); +pgp_key_t pgp_key_clone (pgp_key_t key); /*/ /// Computes and returns the key's fingerprint as per Section 12.2 /// of RFC 4880. /*/ -pgp_fingerprint_t pgp_p_key_fingerprint (pgp_p_key_t p); +pgp_fingerprint_t pgp_key_fingerprint (pgp_key_t p); /*/ /// Computes and returns the key's key ID as per Section 12.2 of RFC /// 4880. /*/ -pgp_keyid_t pgp_p_key_keyid (pgp_p_key_t p); +pgp_keyid_t pgp_key_keyid (pgp_key_t p); /*/ /// Returns whether the key is expired according to the provided @@ -1097,12 +1097,12 @@ pgp_keyid_t pgp_p_key_keyid (pgp_p_key_t p); /// checked for validity. That is, we do not check whether the /// signature is a valid self-signature for the given key. /*/ -int pgp_p_key_expired(pgp_p_key_t key, pgp_signature_t self_signature); +int pgp_key_expired(pgp_key_t key, pgp_signature_t self_signature); /*/ -/// Like pgp_p_key_expired, but at a specific time. +/// Like pgp_key_expired, but at a specific time. /*/ -int pgp_p_key_expired_at(pgp_p_key_t key, pgp_signature_t self_signature, +int pgp_key_expired_at(pgp_key_t key, pgp_signature_t self_signature, time_t when); /*/ @@ -1116,12 +1116,12 @@ int pgp_p_key_expired_at(pgp_p_key_t key, pgp_signature_t self_signature, /// checked for validity. That is, we do not check whether the /// signature is a valid self-signature for the given key. /*/ -int pgp_p_key_alive(pgp_p_key_t key, pgp_signature_t self_signature); +int pgp_key_alive(pgp_key_t key, pgp_signature_t self_signature); /*/ -/// Like pgp_p_key_alive, but at a specific time. +/// Like pgp_key_alive, but at a specific time. /*/ -int pgp_p_key_alive_at(pgp_p_key_t key, pgp_signature_t self_signature, +int pgp_key_alive_at(pgp_key_t key, pgp_signature_t self_signature, time_t when); typedef enum pgp_public_key_algorithm { @@ -1178,12 +1178,12 @@ typedef enum pgp_public_key_algorithm { /*/ /// Returns the key's public key algorithm. /*/ -sq_public_key_algo_t pgp_p_key_public_key_algo(pgp_p_key_t key); +sq_public_key_algo_t pgp_key_public_key_algo(pgp_key_t key); /*/ /// Returns the public key's size in bits. /*/ -int pgp_p_key_public_key_bits(pgp_p_key_t key); +int pgp_key_public_key_bits(pgp_key_t key); /*/ /// Creates a new key pair from a Key packet with an unencrypted @@ -1193,7 +1193,7 @@ int pgp_p_key_public_key_bits(pgp_p_key_t key); /// /// Fails if the secret key is missing, or encrypted. /*/ -pgp_key_pair_t pgp_p_key_into_key_pair (pgp_error_t *errp, pgp_p_key_t key); +pgp_key_pair_t pgp_key_into_key_pair (pgp_error_t *errp, pgp_key_t key); /*/ /// Returns the value of the User ID Packet. @@ -1229,7 +1229,7 @@ pgp_status_t pgp_skesk_decrypt (pgp_error_t *errp, pgp_skesk_t skesk, /*/ /// Returns the key's creation time. /*/ -uint32_t pgp_p_key_creation_time (pgp_p_key_t p); +uint32_t pgp_key_creation_time (pgp_key_t p); /* openpgp::parse. */ diff --git a/openpgp-ffi/include/sequoia/openpgp/crypto.h b/openpgp-ffi/include/sequoia/openpgp/crypto.h index 6e7fb0ca..00d49466 100644 --- a/openpgp-ffi/include/sequoia/openpgp/crypto.h +++ b/openpgp-ffi/include/sequoia/openpgp/crypto.h @@ -27,12 +27,12 @@ void pgp_signer_free (pgp_signer_t s); typedef struct pgp_key_pair *pgp_key_pair_t; /* Forward declaration. */ -typedef struct pgp_p_key *pgp_p_key_t; +typedef struct pgp_key *pgp_key_t; /*/ /// Creates a new key pair. /*/ -void pgp_key_pair_new (pgp_p_key_t public, pgp_mpi_t secret); +void pgp_key_pair_new (pgp_key_t public, pgp_mpi_t secret); /*/ /// Frees a key pair. diff --git a/openpgp-ffi/src/common.rs b/openpgp-ffi/src/common.rs index c09b2f74..f3f674e4 100644 --- a/openpgp-ffi/src/common.rs +++ b/openpgp-ffi/src/common.rs @@ -555,7 +555,7 @@ pub extern "system" fn pgp_signature_expired_at(sig: *const packet::Signature, /// Clones the key. #[::ffi_catch_abort] #[no_mangle] -pub extern "system" fn pgp_p_key_clone(key: *const packet::Key) +pub extern "system" fn pgp_key_clone(key: *const packet::Key) -> *mut packet::Key { let key = ffi_param_ref!(key); box_raw!(key.clone()) @@ -564,7 +564,7 @@ pub extern "system" fn pgp_p_key_clone(key: *const packet::Key) /// Computes and returns the key's fingerprint as per Section 12.2 /// of RFC 4880. #[::ffi_catch_abort] #[no_mangle] -pub extern "system" fn pgp_p_key_fingerprint(key: *const packet::Key) +pub extern "system" fn pgp_key_fingerprint(key: *const packet::Key) -> *mut Fingerprint { let key = ffi_param_ref!(key); box_raw!(key.fingerprint()) @@ -573,7 +573,7 @@ pub extern "system" fn pgp_p_key_fingerprint(key: *const packet::Key) /// Computes and returns the key's key ID as per Section 12.2 of RFC /// 4880. #[::ffi_catch_abort] #[no_mangle] -pub extern "system" fn pgp_p_key_keyid(key: *const packet::Key) +pub extern "system" fn pgp_key_keyid(key: *const packet::Key) -> *mut KeyID { let key = ffi_param_ref!(key); box_raw!(key.keyid()) @@ -586,7 +586,7 @@ pub extern "system" fn pgp_p_key_keyid(key: *const packet::Key) /// checked for validity. That is, we do not check whether the /// signature is a valid self-signature for the given key. #[::ffi_catch_abort] #[no_mangle] -pub extern "system" fn pgp_p_key_expired(key: *const packet::Key, +pub extern "system" fn pgp_key_expired(key: *const packet::Key, sig: *const packet::Signature) -> bool { @@ -596,9 +596,9 @@ pub extern "system" fn pgp_p_key_expired(key: *const packet::Key, sig.key_expired(key) } -/// Like pgp_p_key_expired, but at a specific time. +/// Like pgp_key_expired, but at a specific time. #[::ffi_catch_abort] #[no_mangle] -pub extern "system" fn pgp_p_key_expired_at(key: *const packet::Key, +pub extern "system" fn pgp_key_expired_at(key: *const packet::Key, sig: *const packet::Signature, when: time_t) -> bool @@ -619,7 +619,7 @@ pub extern "system" fn pgp_p_key_expired_at(key: *const packet::Key, /// checked for validity. That is, we do not check whether the /// signature is a valid self-signature for the given key. #[::ffi_catch_abort] #[no_mangle] -pub extern "system" fn pgp_p_key_alive(key: *const packet::Key, +pub extern "system" fn pgp_key_alive(key: *const packet::Key, sig: *const packet::Signature) -> bool { @@ -629,9 +629,9 @@ pub extern "system" fn pgp_p_key_alive(key: *const packet::Key, sig.key_alive(key) } -/// Like pgp_p_key_alive, but at a specific time. +/// Like pgp_key_alive, but at a specific time. #[::ffi_catch_abort] #[no_mangle] -pub extern "system" fn pgp_p_key_alive_at(key: *const packet::Key, +pub extern "system" fn pgp_key_alive_at(key: *const packet::Key, sig: *const packet::Signature, when: time_t) -> bool @@ -644,7 +644,7 @@ pub extern "system" fn pgp_p_key_alive_at(key: *const packet::Key, /// Returns the key's creation time. #[::ffi_catch_abort] #[no_mangle] -pub extern "system" fn pgp_p_key_creation_time(key: *const packet::Key) +pub extern "system" fn pgp_key_creation_time(key: *const packet::Key) -> u32 { let key = ffi_param_ref!(key); @@ -655,7 +655,7 @@ pub extern "system" fn pgp_p_key_creation_time(key: *const packet::Key) /// Returns the key's public key algorithm. #[::ffi_catch_abort] #[no_mangle] -pub extern "system" fn pgp_p_key_public_key_algo(key: *const packet::Key) +pub extern "system" fn pgp_key_public_key_algo(key: *const packet::Key) -> c_int { let key = ffi_param_ref!(key); @@ -665,7 +665,7 @@ pub extern "system" fn pgp_p_key_public_key_algo(key: *const packet::Key) /// Returns the public key's size in bits. #[::ffi_catch_abort] #[no_mangle] -pub extern "system" fn pgp_p_key_public_key_bits(key: *const packet::Key) +pub extern "system" fn pgp_key_public_key_bits(key: *const packet::Key) -> c_int { use self::openpgp::crypto::mpis::PublicKey::*; @@ -689,7 +689,7 @@ pub extern "system" fn pgp_p_key_public_key_bits(key: *const packet::Key) /// /// Fails if the secret key is missing, or encrypted. #[::ffi_catch_abort] #[no_mangle] -pub extern "system" fn pgp_p_key_into_key_pair(errp: Option<&mut *mut failure::Error>, +pub extern "system" fn pgp_key_into_key_pair(errp: Option<&mut *mut failure::Error>, key: *mut packet::Key) -> *mut self::openpgp::crypto::KeyPair { diff --git a/openpgp-ffi/src/tpk.rs b/openpgp-ffi/src/tpk.rs index 58cb90b2..df41a93e 100644 --- a/openpgp-ffi/src/tpk.rs +++ b/openpgp-ffi/src/tpk.rs @@ -249,7 +249,7 @@ fn int_to_reason_for_revocation(code: c_int) -> ReasonForRevocation { /// pgp_tpk_builder_t builder; /// pgp_tpk_t tpk; /// pgp_signature_t revocation; -/// pgp_p_key_t primary_key; +/// pgp_key_t primary_key; /// pgp_key_pair_t primary_keypair; /// pgp_signer_t primary_signer; /// @@ -260,9 +260,9 @@ fn int_to_reason_for_revocation(code: c_int) -> ReasonForRevocation { /// assert (revocation); /// pgp_signature_free (revocation); /* Free the generated one. */ /// -/// primary_key = pgp_p_key_clone (pgp_tpk_primary (tpk)); +/// primary_key = pgp_key_clone (pgp_tpk_primary (tpk)); /// assert (primary_key); -/// primary_keypair = pgp_p_key_into_key_pair (NULL, primary_key); +/// primary_keypair = pgp_key_into_key_pair (NULL, primary_key); /// assert (primary_keypair); /// primary_signer = pgp_key_pair_as_signer (primary_keypair); /// revocation = pgp_tpk_revoke (NULL, tpk, primary_signer, @@ -316,7 +316,7 @@ pub extern "system" fn pgp_tpk_revoke(errp: Option<&mut *mut failure::Error>, /// pgp_tpk_builder_t builder; /// pgp_tpk_t tpk; /// pgp_signature_t revocation; -/// pgp_p_key_t primary_key; +/// pgp_key_t primary_key; /// pgp_key_pair_t primary_keypair; /// pgp_signer_t primary_signer; /// @@ -327,9 +327,9 @@ pub extern "system" fn pgp_tpk_revoke(errp: Option<&mut *mut failure::Error>, /// assert (revocation); /// pgp_signature_free (revocation); /* Free the generated one. */ /// -/// primary_key = pgp_p_key_clone (pgp_tpk_primary (tpk)); +/// primary_key = pgp_key_clone (pgp_tpk_primary (tpk)); /// assert (primary_key); -/// primary_keypair = pgp_p_key_into_key_pair (NULL, primary_key); +/// primary_keypair = pgp_key_into_key_pair (NULL, primary_key); /// assert (primary_keypair); /// primary_signer = pgp_key_pair_as_signer (primary_keypair); /// tpk = pgp_tpk_revoke_in_place (NULL, tpk, primary_signer, |