Skip to content

Commit

Permalink
Update protocols/v2/noise-sv2/src/responder.rs
Browse files Browse the repository at this point in the history
Co-authored-by: RJ Rybarczyk <[email protected]>
  • Loading branch information
Shourya742 and rrybarczyk authored Sep 2, 2024
1 parent d34b5f0 commit ee1cf02
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions protocols/v2/noise-sv2/src/responder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,12 @@ impl Responder {
ret
}

/// Erases sensitive data from the responder's memory, including encryption keys,
/// chaining keys, and ephemeral keys, to prevent any potential leakage of
/// cryptographic material.
/// Securely erases sensitive data in the responder's memory.
///
/// Clears all sensitive cryptographic material within the `Responder` to prevent any
/// accidental leakage or misuse. It overwrites the stored keys, chaining key, handshake hash,
/// and session ciphers with zeros or other non-sensitive values. This function is typically
/// called when the `Responder` instance is no longer needed or before deallocation.
fn erase(&mut self) {
if let Some(k) = self.k.as_mut() {
for b in k {
Expand Down

0 comments on commit ee1cf02

Please sign in to comment.