summaryrefslogtreecommitdiffstats
path: root/openpgp/src/serialize.rs
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2020-08-12 16:19:50 +0200
committerJustus Winter <justus@sequoia-pgp.org>2020-08-20 17:43:21 +0200
commit27c1b9c65700d3781512858e1c86db1f5737ab60 (patch)
treeed0764624508aa2cba8fc1dec0b0c8436eb8b7a5 /openpgp/src/serialize.rs
parent95df35ef7a29f92aba2769e11026b998ad8590bf (diff)
openpgp: Make key::Encrypted::ciphertext fail with unknown S2K.
Diffstat (limited to 'openpgp/src/serialize.rs')
-rw-r--r--openpgp/src/serialize.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/openpgp/src/serialize.rs b/openpgp/src/serialize.rs
index fe1d36cc..a9fa5385 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.raw_ciphertext())?;
},
}
}
@@ -1848,7 +1848,7 @@ impl<P, R> Key4<P, R>
+ 2, // Two octet checksum.
SecretKeyMaterial::Encrypted(ref e) =>
1 + e.s2k().serialized_len()
- + e.ciphertext().unwrap().len(),
+ + e.raw_ciphertext().len(),
}
} else {
0