mirror of
https://github.com/shadowsocks/shadowsocks-rust.git
synced 2026-11-06 08:14:07 +00:00
fix: replaced deprecated from_slice
This commit is contained in:
@@ -566,7 +566,8 @@ impl EncryptedWriter {
|
||||
let enc_key = &sub_key[0..16];
|
||||
let cipher = Aes128::new_from_slice(enc_key).expect("AES-128");
|
||||
|
||||
let ipsk_plain_text = Block::from_slice(ipsk_plain_text);
|
||||
let ipsk_plain_text =
|
||||
<&Block as TryFrom<&[u8]>>::try_from(ipsk_plain_text).expect("ipsk length mismatch");
|
||||
let mut block = Block::from([0u8; 16]);
|
||||
cipher.encrypt_block_b2b(ipsk_plain_text, &mut block);
|
||||
|
||||
@@ -581,7 +582,8 @@ impl EncryptedWriter {
|
||||
let enc_key = &sub_key[0..32];
|
||||
let cipher = Aes256::new_from_slice(enc_key).expect("AES-256");
|
||||
|
||||
let ipsk_plain_text = Block::from_slice(ipsk_plain_text);
|
||||
let ipsk_plain_text =
|
||||
<&Block as TryFrom<&[u8]>>::try_from(ipsk_plain_text).expect("ipsk length mismatch");
|
||||
let mut block = Block::from([0u8; 16]);
|
||||
cipher.encrypt_block_b2b(ipsk_plain_text, &mut block);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user