From 5f912bdeae0d2f95b5be972bc1dea02c0d373dc0 Mon Sep 17 00:00:00 2001 From: Steven Roose Date: Mon, 22 Oct 2018 00:06:46 +0100 Subject: [PATCH] Implement Debug for PrivKey It returns a fixed string to prevent accidental data leakage. --- src/util/privkey.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/util/privkey.rs b/src/util/privkey.rs index d622be79..65c1c568 100644 --- a/src/util/privkey.rs +++ b/src/util/privkey.rs @@ -153,6 +153,12 @@ impl fmt::Display for Privkey { } } +impl fmt::Debug for Privkey { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "[private key data]") + } +} + impl FromStr for Privkey { type Err = encode::Error; fn from_str(s: &str) -> Result {