mirror of
https://github.com/oSumAtrIX/free-librespot.git
synced 2025-12-20 18:34:23 +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 decrypted = {
|
||||||
let mut data = vec![0u8; encrypted.len()];
|
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);
|
cipher.process(&encrypted, &mut data);
|
||||||
String::from_utf8(data).unwrap()
|
String::from_utf8(data).unwrap()
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue