Skip to content

Commit

Permalink
Fix for nodestunes crypto crash; 302. (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
npwalker authored Aug 3, 2016
1 parent 5e04b3b commit 73767dd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ var decryptAudioData = function(data, audioAesKey, audioAesIv, headerSize) {
var remainder = (data.length - 12) % 16;
var endOfEncodedData = data.length - remainder;

var decipher = crypto.createDecipheriv('aes-128-cbc', audioAesKey, audioAesIv);
var audioAesKeyBuffer = new Buffer(audioAesKey, 'binary');
var decipher = crypto.createDecipheriv('aes-128-cbc', audioAesKeyBuffer, audioAesIv);
decipher.setAutoPadding(false);

for (var i = headerSize, l = endOfEncodedData - 16; i <= l; i += 16) {
Expand Down

0 comments on commit 73767dd

Please sign in to comment.