summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2021-04-07 11:38:55 +0200
committerJustus Winter <justus@sequoia-pgp.org>2021-04-08 12:56:15 +0200
commit6e85d5cb37aac0b36a47ebe9ab42273fcd604dde (patch)
tree77834fca56cae76e9a9024b05822cef77e25d895
parentb7a2d023e1cb3f353da5dcee90e9271531c4f045 (diff)
openpgp: Fix checking for exportability.
-rw-r--r--openpgp/src/serialize.rs12
1 files changed, 2 insertions, 10 deletions
diff --git a/openpgp/src/serialize.rs b/openpgp/src/serialize.rs
index 9d38c736..351d3515 100644
--- a/openpgp/src/serialize.rs
+++ b/openpgp/src/serialize.rs
@@ -1696,20 +1696,12 @@ impl MarshalInto for Signature4 {
}
fn export_into(&self, buf: &mut [u8]) -> Result<usize> {
- if ! self.exportable_certification().unwrap_or(true) {
- return Err(Error::InvalidOperation(
- "Cannot export non-exportable certification".into()).into());
- }
-
+ self.exportable()?;
self.serialize_into(buf)
}
fn export_to_vec(&self) -> Result<Vec<u8>> {
- if ! self.exportable_certification().unwrap_or(true) {
- return Err(Error::InvalidOperation(
- "Cannot export non-exportable certification".into()).into());
- }
-
+ self.exportable()?;
self.to_vec()
}
}