Comparing version 0.7.1 to 0.7.2
15
ece.js
@@ -333,3 +333,3 @@ 'use strict'; | ||
var i = data.length - 1; | ||
while(i > 0) { | ||
while(i >= 0) { | ||
if (data[i]) { | ||
@@ -437,2 +437,6 @@ if (last) { | ||
ciphertext.push(gcm.update(buffer)); | ||
if (!last && padding.length + buffer.length < header.rs) { | ||
throw new Error('Unable to pad to record size'); | ||
} | ||
} else { | ||
@@ -525,2 +529,5 @@ ciphertext.push(gcm.update(buffer)); | ||
} | ||
if (pad > 0 && recordPad === 0) { | ||
++recordPad; // Deal with perverse case of rs=overhead+1 with padding. | ||
} | ||
pad -= recordPad; | ||
@@ -534,4 +541,5 @@ | ||
} else { | ||
last = end >= buffer.length && pad <= 0; | ||
last = end >= buffer.length; | ||
} | ||
last = last && pad <= 0; | ||
var block = encryptRecord(key, counter, buffer.slice(start, end), | ||
@@ -544,5 +552,2 @@ recordPad, header, last); | ||
} | ||
if (pad) { | ||
throw new Error('Unable to pad by requested amount, ' + pad + ' remaining'); | ||
} | ||
return result; | ||
@@ -549,0 +554,0 @@ } |
{ | ||
"name": "http_ece", | ||
"version": "0.7.1", | ||
"version": "0.7.2", | ||
"description": "Encrypted Content-Encoding for HTTP", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/martinthomson/encrypted-content-encoding", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21266
6
520