Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

http_ece

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http_ece - npm Package Compare versions

Comparing version 0.6.3 to 0.6.4

26

ece.js

@@ -261,6 +261,9 @@ 'use strict';

}
if (header.rs <= PAD_SIZE[header.version]) {
throw new Error('The rs parameter has to be greater than ' +
PAD_SIZE[header.version]);
var overhead = PAD_SIZE[header.version];
if (header.version === 'aes128gcm') {
overhead += TAG_LENGTH;
}
if (header.rs <= overhead) {
throw new Error('The rs parameter has to be greater than ' + overhead);
}

@@ -369,4 +372,9 @@ if (params.salt) {

var chunkSize = header.rs;
if (header.version !== 'aes128gcm') {
chunkSize += TAG_LENGTH;
}
for (var i = 0; start < buffer.length; ++i) {
var end = start + header.rs + TAG_LENGTH;
var end = start + chunkSize;
if (end === buffer.length) {

@@ -462,2 +470,6 @@ throw new Error('Truncated payload');

var padSize = PAD_SIZE[header.version];
var overhead = padSize;
if (header.version === 'aes128gcm') {
overhead += TAG_LENGTH;
}
var pad = isNaN(parseInt(params.pad, 10)) ? 0 : parseInt(params.pad, 10);

@@ -470,10 +482,10 @@

var recordPad = Math.min((1 << (padSize * 8)) - 1, // maximum padding
Math.min(header.rs - padSize - 1, pad));
Math.min(header.rs - overhead - 1, pad));
pad -= recordPad;
var end = Math.min(start + header.rs - padSize - recordPad, buffer.length);
var end = Math.min(start + header.rs - overhead - recordPad, buffer.length);
var block = encryptRecord(key, i, buffer.slice(start, end),
recordPad, padSize);
result = Buffer.concat([result, block]);
start += header.rs - padSize - recordPad;
start += header.rs - overhead - recordPad;
}

@@ -480,0 +492,0 @@ if (pad) {

{
"name": "http_ece",
"version": "0.6.3",
"version": "0.6.4",
"description": "Encrypted Content-Encoding for HTTP",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/martinthomson/encrypted-content-encoding",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc