Skip to content

Commit

Permalink
parity-crypto: remove UB test (#484)
Browse files Browse the repository at this point in the history
* parity-crypto: remove UB test

* rlp: fix unused import
  • Loading branch information
ordian authored Dec 28, 2020
1 parent da4262d commit 6560949
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
18 changes: 0 additions & 18 deletions parity-crypto/src/hmac/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,21 +232,3 @@ fn ietf_test_vectors() {
),
);
}

#[test]
fn secrets_are_zeroed_on_drop() {
let ptr: *const KeyInner;
let zeros = KeyInner::Sha256(DisposableBox::from_slice(&[0u8; 6][..]));
let expected = KeyInner::Sha256(DisposableBox::from_slice(b"sikrit"));
{
let secret = b"sikrit";
let signing_key = SigKey::sha256(secret);
ptr = &signing_key.0;
unsafe {
assert_eq!(*ptr, expected);
}
}
unsafe {
assert_eq!(*ptr, zeros);
}
}
2 changes: 0 additions & 2 deletions rlp/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
// except according to those terms.

//! Common RLP traits
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
use bytes::BytesMut;

use crate::{error::DecoderError, rlpin::Rlp, stream::RlpStream};
Expand Down

0 comments on commit 6560949

Please sign in to comment.