File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -224,6 +224,12 @@ pub struct KeyPair([c_uchar; 96]);
224
224
impl_array_newtype ! ( KeyPair , c_uchar, 96 ) ;
225
225
impl_raw_debug ! ( KeyPair ) ;
226
226
227
+ impl Drop for KeyPair {
228
+ fn drop ( & mut self ) {
229
+ self . 0 . copy_from_slice ( & [ 0u8 ; 96 ] ) ;
230
+ }
231
+ }
232
+
227
233
impl KeyPair {
228
234
/// Creates an "uninitialized" FFI keypair which is zeroed out
229
235
///
Original file line number Diff line number Diff line change @@ -32,6 +32,12 @@ pub struct SecretKey(pub(crate) [u8; constants::SECRET_KEY_SIZE]);
32
32
impl_ptr_newtype ! ( SecretKey , u8 ) ;
33
33
impl_safe_debug ! ( SecretKey ) ;
34
34
35
+ impl Drop for SecretKey {
36
+ fn drop ( & mut self ) {
37
+ self . 0 . copy_from_slice ( & [ 0u8 ; constants:: SECRET_KEY_SIZE ] ) ;
38
+ }
39
+ }
40
+
35
41
impl str:: FromStr for SecretKey {
36
42
type Err = Error ;
37
43
fn from_str ( s : & str ) -> Result < SecretKey , Error > {
You can’t perform that action at this time.
0 commit comments