diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2020-08-12 15:39:39 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2020-08-20 12:17:20 +0200 |
commit | bb447441a4a94563736760e28f368e1186064c57 (patch) | |
tree | 48f3ed194a2a356bc7e59fac8233336960ecadad /openpgp/src/serialize.rs | |
parent | 837192beb3700d8fb110560261036c856f4bf13e (diff) |
openpgp: Make key::Encrypted::ciphertext fallible.
Diffstat (limited to 'openpgp/src/serialize.rs')
-rw-r--r-- | openpgp/src/serialize.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/openpgp/src/serialize.rs b/openpgp/src/serialize.rs index 87c12cd6..4aababcd 100644 --- a/openpgp/src/serialize.rs +++ b/openpgp/src/serialize.rs @@ -1826,7 +1826,7 @@ impl<P, R> Key4<P, R> write_byte(o, 254)?; write_byte(o, e.algo().into())?; e.s2k().serialize(o)?; - o.write_all(e.ciphertext())?; + o.write_all(e.ciphertext()?)?; }, } } @@ -1847,7 +1847,8 @@ impl<P, R> Key4<P, R> u.map(|mpis| mpis.serialized_len()) + 2, // Two octet checksum. SecretKeyMaterial::Encrypted(ref e) => - 1 + e.s2k().serialized_len() + e.ciphertext().len(), + 1 + e.s2k().serialized_len() + + e.ciphertext().unwrap().len(), } } else { 0 |