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 committed Aug 6, 2016
1 parent 0b07ffe commit a2a8ef9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ function decryptAudioData(data,audioAesKey,audioAesIv) {
const encrypted_length = block_count * BLOCK_SIZE;
const remainder = data.length - encrypted_length;

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

const encrypted_data = data.slice(0,encrypted_length);
Expand All @@ -162,4 +163,3 @@ function decryptAudioData(data,audioAesKey,audioAesIv) {

return output;
};

0 comments on commit a2a8ef9

Please sign in to comment.