airsonos
airsonos copied to clipboard
Invalid key length error
Hello... mostly worked but run into this error when I try to stream from my phone over aiplay. Running iOS 10 beta and OSX El Capitain 10.11.6. Any thoughts?
Error: Invalid key length
at Error (native)
at new Decipheriv (crypto.js:232:16)
at Object.Decipheriv (crypto.js:229:12)
at Object.decryptAudioData (/usr/local/lib/node_modules/airsonos/node_modules/nodetunes/lib/helper.js:141:25)
at RtpServer.
Have you attempted to stream with an apple product running IOS 9? If so, have you reproduced your issue?
+1, on iOS 9. Tested using node 4.5 and 6.4, on Arch Linux. The exception is triggered as soon as I hit play on my iDevice.
Search complete. Set up 4 device tunnels.
crypto.js:238
this._handle.initiv(cipher, toBuf(key), toBuf(iv));
^
Error: Invalid key length
at Error (native)
at new Decipheriv (crypto.js:238:16)
at Object.Decipheriv (crypto.js:235:12)
at Object.decryptAudioData (/home/silvio/.nvm/versions/node/v6.4.0/lib/node_modules/airsonos/node_modules/nodetunes/lib/helper.js:141:25)
at RtpServer.<anonymous> (/home/silvio/.nvm/versions/node/v6.4.0/lib/node_modules/airsonos/node_modules/nodetunes/lib/rtp.js:32:23)
at emitTwo (events.js:106:13)
at Socket.emit (events.js:191:7)
at UDP.onMessage (dgram.js:550:8)
Same issue here on macOS Sierra beta: crypto.js:238 this._handle.initiv(cipher, toBuf(key), toBuf(iv)); ^
Error: Invalid key length
at Error (native)
at new Decipheriv (crypto.js:238:16)
at Object.Decipheriv (crypto.js:235:12)
at Object.decryptAudioData (/usr/local/lib/node_modules/airsonos/node_modules/nodetunes/lib/helper.js:141:25)
at RtpServer.
#302 + Nodetunes fix
Yes! that solves the issue
I'm a bit new to this and have no idea how to apply this fix...can anyone help?
when ths fix will be available on airsonos ?
I think the issue is that the pull request above has not yet been merged into nodetunes...
I am seeing a similar issue:
Error: Invalid key length
at Error (native)
at new Decipheriv (crypto.js:239:16)
at Object.Decipheriv (crypto.js:236:12)
at Object.decryptAudioData (/usr/local/lib/node_modules/airsonos/node_modules/nodetunes/lib/helper.js:141:25)
at RtpServer.
And I have updated the helper.js folder to reflect the #302 fix but still not working
+1
+1
The fix works for me. Edit the file, ~/{user}/.nvm/versions/node/v6.2.1/lib/node_modules/airsonos/node_modules/nodetunes/lib/helper.js
Worked for me: Editing
/usr/local/lib/node_modules/airsonos/node_modules/nodetunes/lib/helper.js
replacing
var decipher = crypto.createDecipheriv('aes-128-cbc', audioAesKey, audioAesIv);
with
var audioAesKeyBuffer = new Buffer(audioAesKey, 'binary');
var decipher = crypto.createDecipheriv('aes-128-cbc', audioAesKeyBuffer, audioAesIv);
Thanks @isidore this worked for me!
Worked for me too!
I'm not a proficient programmer at all but could probably figure it out with a little help. Would appreciate if someone could advise how I can edit /usr/local/lib/node_modules/airsonos/node_modules/nodetunes/lib/helper.js
and replace
var decipher = crypto.createDecipheriv('aes-128-cbc', audioAesKey, audioAesIv);
with
var audioAesKeyBuffer = new Buffer(audioAesKey, 'binary'); var decipher = crypto.createDecipheriv('aes-128-cbc', audioAesKeyBuffer, audioAesIv);
Thank you very much
+1 Worked for me as well.
@psieyes Open terminal.
Type vim /usr/local/lib/node_modules/airsonos/node_modules/nodetunes/lib/helper.js
to open the file.
Type /decipher
to search for the string "decipher" and hit enter when it finds the line.
Type dd
to delete that line.
Copy the two new lines:
var audioAesKeyBuffer = new Buffer(audioAesKey, 'binary');
var decipher = crypto.createDecipheriv('aes-128-cbc', audioAesKeyBuffer, audioAesIv);
Back in the terminal, type i
to enter insert mode.
cmd
+ v
to paste the new lines.
Hit ESC
to exist insert mode.
Type :wq
to save the file and quit.
Works like a charm. Thanks guys
perfect, thx a lot!
Only worked with extra decipher.setAutoPadding(false)
idk why
var audioAesKeyBuffer = new Buffer(audioAesKey, 'binary');
var decipher = crypto.createDecipheriv('aes-128-cbc', audioAesKeyBuffer, audioAesIv);
decipher.setAutoPadding(false);
Had the same issue, and it worked with
var audioAesKeyBuffer = new Buffer(audioAesKey, 'binary');
var decipher = crypto.createDecipheriv('aes-128-cbc', audioAesKeyBuffer, audioAesIv);
decipher.setAutoPadding(false);
Me too, experiencing this issue.
~$ airsonos
Searching for Sonos devices on network...
Family Room (@ 192.168.2.9:1400, RINCON_5CAxxxxx)
Search complete. Set up 1 device tunnel.
crypto.js:238
this._handle.initiv(cipher, toBuf(key), toBuf(iv));
^
Error: Invalid key length
at Error (native)
at new Decipheriv (crypto.js:238:16)
at Object.Decipheriv (crypto.js:235:12)
at Object.decryptAudioData (/usr/local/lib/node_modules/airsonos/node_modules/nodetunes/lib/helper.js:141:25)
at RtpServer.<anonymous> (/usr/local/lib/node_modules/airsonos/node_modules/nodetunes/lib/rtp.js:32:23)
at emitTwo (events.js:106:13)
at Socket.emit (events.js:191:7)
at UDP.onMessage (dgram.js:540:8)
This error is thrown as soon as I select the device in Preferences, Audio Output. MacOs Sierra 10.12.3
Same as @meglio on macOS Sierra 10.12.6