diff options
| -rw-r--r-- | talpid-types/src/net/wireguard.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/talpid-types/src/net/wireguard.rs b/talpid-types/src/net/wireguard.rs index a6acb6fc6f..e248a2f4f9 100644 --- a/talpid-types/src/net/wireguard.rs +++ b/talpid-types/src/net/wireguard.rs @@ -267,7 +267,7 @@ impl fmt::Display for PublicKey { } /// A WireGuard preshared key (PSK). Used to make the tunnel quantum-resistant. -#[derive(Debug, Clone, PartialEq, Eq, Hash, Zeroize, ZeroizeOnDrop)] +#[derive(Clone, PartialEq, Eq, Hash, Zeroize, ZeroizeOnDrop)] pub struct PresharedKey(Box<[u8; 32]>); impl PresharedKey { @@ -285,6 +285,12 @@ impl From<Box<[u8; 32]>> for PresharedKey { } } +impl fmt::Debug for PresharedKey { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{}", &base64::encode(self.as_bytes())) + } +} + fn serialize_key<S>(key: &[u8; 32], serializer: S) -> Result<S::Ok, S::Error> where S: Serializer, |
