diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2021-03-02 12:56:40 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2021-03-02 12:56:40 +0100 |
commit | 335b4b25cd3c9e25527f790db5ffc97485f7b226 (patch) | |
tree | b9e8864fa385de077019b2ab61830fd549ea959a /sq/src/commands/dump.rs | |
parent | 6c2c6ca241ba499b699e70fa52b598d909a9e59e (diff) |
sq: Hexdump non human-readable notation values.
Diffstat (limited to 'sq/src/commands/dump.rs')
-rw-r--r-- | sq/src/commands/dump.rs | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/sq/src/commands/dump.rs b/sq/src/commands/dump.rs index 4334feb7..97fdb623 100644 --- a/sq/src/commands/dump.rs +++ b/sq/src/commands/dump.rs @@ -761,7 +761,7 @@ impl PacketDumper { Unknown { body, .. } => { writeln!(output, "{} {:?}{}:", i, s.tag(), if s.critical() { " (critical)" } else { "" })?; - hexdump_unknown(output, body)?; + hexdump_unknown(output, body.as_slice())?; }, SignatureCreationTime(t) => write!(output, "{} Signature creation time: {}", i, @@ -802,8 +802,24 @@ impl PacketDumper { }, Issuer(ref is) => write!(output, "{} Issuer: {}", i, is)?, - NotationData(ref n) => - write!(output, "{} Notation: {:?}", i, n)?, + NotationData(n) => if n.flags().human_readable() { + write!(output, "{} Notation: {}", i, n)?; + if s.critical() { + write!(output, " (critical)")?; + } + writeln!(output)?; + } else { + write!(output, "{} Notation: {}", i, n.name())?; + let flags = format!("{:?}", n.flags()); + if ! flags.is_empty() { + write!(output, "{}", flags)?; + } + if s.critical() { + write!(output, " (critical)")?; + } + writeln!(output)?; + hexdump_unknown(output, n.value())?; + }, PreferredHashAlgorithms(ref h) => write!(output, "{} Hash preferences: {}", i, h.iter().map(|h| format!("{:?}", h)) @@ -855,6 +871,7 @@ impl PacketDumper { match s.value() { Unknown { .. } => (), + NotationData { .. } => (), EmbeddedSignature(ref sig) => { if s.critical() { write!(output, " (critical)")?; |