diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2019-06-27 17:12:26 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2019-06-27 17:12:26 +0200 |
commit | 0e026f8ac794a70012d36e662a0b54ad0888d890 (patch) | |
tree | 0c905dc768cea33dd3cd416398c00f489af953e9 /openpgp/src/packet/pkesk.rs | |
parent | 9ce35cc2c757fae1338a356354608cf1d6fa563f (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/src/packet/pkesk.rs')
-rw-r--r-- | openpgp/src/packet/pkesk.rs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/openpgp/src/packet/pkesk.rs b/openpgp/src/packet/pkesk.rs index 3a5188a1..1088d848 100644 --- a/openpgp/src/packet/pkesk.rs +++ b/openpgp/src/packet/pkesk.rs @@ -204,7 +204,6 @@ mod tests { use super::*; use TPK; use PacketPile; - use packet::key::SecretKey; use Packet; use parse::Parse; use serialize::SerializeInto; @@ -362,9 +361,7 @@ mod tests { PublicKeyAlgorithm::ECDH, public_mpis, None) .unwrap().into(); - key.set_secret(Some(SecretKey::Unencrypted { - mpis: private_mpis, - })); + key.set_secret(Some(private_mpis.into())); let mut rng = Yarrow::default(); let sess_key = SessionKey::new(&mut rng, 32); let pkesk = PKESK3::for_recipient(SymmetricAlgorithm::AES256, &sess_key, |