summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2019-06-01 01:22:45 +0200
committerJustus Winter <justus@sequoia-pgp.org>2019-06-01 16:32:00 +0200
commite13933c735e9b7b5ee81643b38723e888f8445b1 (patch)
tree62b3aea9ee5eee094477a84d791e33139cee5461
parentaaaca386bc6e41508ef955c6b27df776be73c24e (diff)
openpgp: Fix key serialization.
- Key4::Serialize calls serialize_key(true), with the intention that if there is a secret key, it is written out, but it should noto fail if there is no secret key.
-rw-r--r--openpgp/src/serialize/mod.rs5
1 files changed, 0 insertions, 5 deletions
diff --git a/openpgp/src/serialize/mod.rs b/openpgp/src/serialize/mod.rs
index 47908560..88aa764e 100644
--- a/openpgp/src/serialize/mod.rs
+++ b/openpgp/src/serialize/mod.rs
@@ -1185,11 +1185,6 @@ impl Key4 {
pub(crate) // For tests in key.
fn serialize_key(&self, o: &mut io::Write, serialize_secrets: bool)
-> Result<()> {
- if serialize_secrets && ! self.secret().is_some() {
- return Err(Error::InvalidOperation(
- "Cannot serialize secret key: No secrets".into()).into());
- }
-
let have_secret_key = self.secret().is_some() && serialize_secrets;
write_byte(o, 4)?; // Version.