From 0e026f8ac794a70012d36e662a0b54ad0888d890 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Thu, 27 Jun 2019 17:12:26 +0200 Subject: 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. --- openpgp-ffi/src/crypto.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'openpgp-ffi/src/crypto.rs') 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); -- cgit v1.2.3