Skip to content

Commit

Permalink
impl Debug for Ikm
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewjstone committed May 3, 2023
1 parent 75d92cf commit 6abfb00
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions key-manager/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
//! A crate used to derive keys useful for the Oxide control plane
use std::collections::BTreeMap;
use std::fmt::Debug;

use async_trait::async_trait;
use hkdf::Hkdf;
Expand All @@ -21,6 +22,14 @@ use zeroize::{Zeroize, ZeroizeOnDrop};
#[derive(Zeroize, ZeroizeOnDrop)]
pub struct Ikm(pub Box<[u8; 32]>);

/// We impl Debug here only to guarantee nobody re-implements this to actually
/// expose the secret.
impl Debug for Ikm {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "Ikm(secret)")
}
}

/// Secret Input Key Material for a given rack reconfiguration epoch
pub struct VersionedIkm {
pub epoch: u64,
Expand Down

0 comments on commit 6abfb00

Please sign in to comment.