-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Rust: Update StreamCipherInit to use getCanonicalPath. #20238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
aafdf1a
a9650e0
402e901
fdec780
bf33d1b
ab49c33
9f04de8
401315c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,7 +42,7 @@ fn test_stream_cipher( | |
|
||
fn test_block_cipher( | ||
key: &[u8], key128: &[u8;16], key192: &[u8;24], key256: &[u8;32], | ||
data: &mut [u8], input: &[u8], block128: &mut [u8;16] | ||
data: &mut [u8], input: &[u8], block128: &mut [u8;16], des_key : &cipher::Key<Des> | ||
) { | ||
// aes | ||
let aes_cipher1 = Aes128::new(key128.into()); | ||
|
@@ -56,6 +56,10 @@ fn test_block_cipher( | |
aes_cipher3.decrypt_block(block128.into()); | ||
|
||
// des (broken) | ||
let des_cipher0 : Des = Des::new(des_key); // $ Alert[rust/weak-cryptographic-algorithm] | ||
des_cipher0.encrypt_block(data.into()); | ||
des_cipher0.decrypt_block(data.into()); | ||
|
||
let des_cipher1 = Des::new(key.into()); // $ Alert[rust/weak-cryptographic-algorithm] | ||
des_cipher1.encrypt_block(data.into()); | ||
des_cipher1.decrypt_block(data.into()); | ||
|
@@ -129,15 +133,15 @@ fn test_cbc( | |
_ = aes_cipher1.encrypt_padded_mut::<aes::cipher::block_padding::Pkcs7>(data, data_len).unwrap(); | ||
|
||
// des (broken) | ||
let des_cipher1 = cbc::Encryptor::<des::Des>::new(key.into(), iv.into()); // $ Alert[rust/weak-cryptographic-algorithm] | ||
let des_cipher1 = cbc::Encryptor::<des::Des>::new(key.into(), iv.into()); // $ MISSING: Alert[rust/weak-cryptographic-algorithm] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I note that this call and the two below (also) do not resolve because we currently do not support blanket implementations. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see, and I note the issue tracking this. 👍 |
||
_ = des_cipher1.encrypt_padded_mut::<des::cipher::block_padding::Pkcs7>(data, data_len).unwrap(); | ||
|
||
let des_cipher2 = MyDesEncryptor::new(key.into(), iv.into()); // $ MISSING: Alert[rust/weak-cryptographic-algorithm] | ||
_ = des_cipher2.encrypt_padded_mut::<des::cipher::block_padding::Pkcs7>(data, data_len).unwrap(); | ||
|
||
let des_cipher3 = cbc::Encryptor::<des::Des>::new_from_slices(&key, &iv).unwrap(); // $ Alert[rust/weak-cryptographic-algorithm] | ||
let des_cipher3 = cbc::Encryptor::<des::Des>::new_from_slices(&key, &iv).unwrap(); // $ MISSING: Alert[rust/weak-cryptographic-algorithm] | ||
_ = des_cipher3.encrypt_padded_mut::<des::cipher::block_padding::Pkcs7>(data, data_len).unwrap(); | ||
|
||
let des_cipher4 = cbc::Encryptor::<des::Des>::new(key.into(), iv.into()); // $ Alert[rust/weak-cryptographic-algorithm] | ||
let des_cipher4 = cbc::Encryptor::<des::Des>::new(key.into(), iv.into()); // $ MISSING: Alert[rust/weak-cryptographic-algorithm] | ||
_ = des_cipher4.encrypt_padded_b2b_mut::<des::cipher::block_padding::Pkcs7>(input, data).unwrap(); | ||
} |
Check warning
Code scanning / CodeQL
Omittable 'exists' variable Warning