summaryrefslogtreecommitdiffstats
path: root/openpgp/src/serialize
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2021-03-18 17:21:45 +0100
committerJustus Winter <justus@sequoia-pgp.org>2021-03-19 11:48:38 +0100
commit963f060e5e3f300770bec3f844d35cde9496402f (patch)
treefddf56affb8a015b25f24c4d3e4fbe922339dbdb /openpgp/src/serialize
parente0f82bfdccde09712ff704ee17d3f0f6e73af5fe (diff)
openpgp: Simplify key serialization code.
Diffstat (limited to 'openpgp/src/serialize')
-rw-r--r--openpgp/src/serialize/cert.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/openpgp/src/serialize/cert.rs b/openpgp/src/serialize/cert.rs
index ab57457d..a3aa4cba 100644
--- a/openpgp/src/serialize/cert.rs
+++ b/openpgp/src/serialize/cert.rs
@@ -5,6 +5,7 @@ use crate::seal;
use crate::serialize::{
PacketRef,
Marshal, MarshalInto,
+ NetLength,
generic_serialize_into, generic_export_into,
};
@@ -546,7 +547,7 @@ impl<'a> MarshalInto for TSK<'a> {
|| tag == Tag::PublicSubkey) {
// Emit a GnuPG-style secret key stub. The stub
// extends the public key by 8 bytes.
- let l = key.net_len_key(false) + 8;
+ let l = key.parts_as_public().net_len() + 8;
return 1 // CTB
+ BodyLength::Full(l as u32).serialized_len()
+ l;