mirror of
https://github.com/librespot-org/librespot.git
synced 2024-12-18 17:11:53 +00:00
discovery: Truncate the AES key to 128
The computed key is 20 bytes long (SHA1 checksum), but it used for AES128. The last 4 bytes should therefore be dropped.
This commit is contained in:
parent
f8956166ea
commit
2c2ff16986
1 changed files with 1 additions and 1 deletions
|
@ -100,7 +100,7 @@ impl DiscoveryManager {
|
|||
|
||||
let decrypted = {
|
||||
let mut data = vec![0u8; encrypted.len()];
|
||||
let mut cipher = crypto::aes::ctr(crypto::aes::KeySize::KeySize128, &encryption_key, &iv);
|
||||
let mut cipher = crypto::aes::ctr(crypto::aes::KeySize::KeySize128, &encryption_key[0..16], &iv);
|
||||
cipher.process(&encrypted, &mut data);
|
||||
String::from_utf8(data).unwrap()
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue