summaryrefslogtreecommitdiffstats
path: root/openpgp-ffi/src/crypto.rs
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2019-06-27 17:12:26 +0200
committerJustus Winter <justus@sequoia-pgp.org>2019-06-27 17:12:26 +0200
commit0e026f8ac794a70012d36e662a0b54ad0888d890 (patch)
tree0c905dc768cea33dd3cd416398c00f489af953e9 /openpgp-ffi/src/crypto.rs
parent9ce35cc2c757fae1338a356354608cf1d6fa563f (diff)
openpgp: Rework secret key handling.
- Introduce two new types, `Encrypted` and `Unencrypted`, to make the fields of enum `SecretKey` private. Add accessors, implement From<..> to make the new types ergonomic to use, update callsites.
Diffstat (limited to 'openpgp-ffi/src/crypto.rs')
-rw-r--r--openpgp-ffi/src/crypto.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/openpgp-ffi/src/crypto.rs b/openpgp-ffi/src/crypto.rs
index 2e3ef661..94e1a81d 100644
--- a/openpgp-ffi/src/crypto.rs
+++ b/openpgp-ffi/src/crypto.rs
@@ -67,7 +67,8 @@ pub extern "C" fn pgp_signer_free
/// Creates a new key pair.
#[::sequoia_ffi_macros::extern_fn] #[no_mangle]
pub extern "C" fn pgp_key_pair_new
- (errp: Option<&mut *mut ::error::Error>, public: *mut Key, secret: *mut crypto::mpis::SecretKey)
+ (errp: Option<&mut *mut ::error::Error>, public: *mut Key,
+ secret: *mut openpgp::packet::key::Unencrypted)
-> *mut crypto::KeyPair
{
ffi_make_fry_from_errp!(errp);