Skip to content

Commit

Permalink
Remove casting a pointer to a u64 in sensitive_data_cleanup()
Browse files Browse the repository at this point in the history
Fix #215

Signed-off-by: Wei Liu <[email protected]>
  • Loading branch information
liuw1 authored and gaojiaqi7 committed Apr 29, 2024
1 parent f3c3001 commit b85160f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/crypto/src/rustls_impl/ecdsa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ pub fn ecdsa_verify(public_key: &[u8], data: &[u8], signature: &[u8]) -> Result<
// See https://github.com/briansmith/ring/issues/15
fn sensitive_data_cleanup<T: Sized>(t: &mut T) {
let bytes = unsafe {
core::slice::from_raw_parts_mut(t as *mut T as u64 as *mut u8, core::mem::size_of::<T>())
core::slice::from_raw_parts_mut(t as *mut T as *mut u8, core::mem::size_of::<T>())
};
bytes.zeroize();
}

0 comments on commit b85160f

Please sign in to comment.