Socket
Socket
Sign inDemoInstall

hap-proxy

Package Overview
Dependencies
71
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.3.7 to 0.3.9

8

lib/crypto/encryption.js

@@ -12,3 +12,3 @@ "use strict";

const tweetnacl_1 = __importDefault(require("tweetnacl"));
const debug = debug_1.default('encryption');
const debug = (0, debug_1.default)('encryption');
if (!crypto_1.default.getCiphers().includes("chacha20-poly1305")) {

@@ -19,3 +19,3 @@ assert_1.default.fail("The cipher 'chacha20-poly1305' is not supported with your current running nodejs version v" + process.version + ". " +

function HKDF(hashAlg, salt, ikm, info, size) {
return futoin_hkdf_1.default(ikm, size, { hash: hashAlg, salt: salt, info: info });
return (0, futoin_hkdf_1.default)(ikm, size, { hash: hashAlg, salt: salt, info: info });
}

@@ -111,4 +111,4 @@ exports.HKDF = HKDF;

function uintHighLow(number) {
assert_1.default(number > -1 && number <= MAX_INT53, "number out of range");
assert_1.default(Math.floor(number) === number, "number must be an integer");
(0, assert_1.default)(number > -1 && number <= MAX_INT53, "number out of range");
(0, assert_1.default)(Math.floor(number) === number, "number must be an integer");
let high = 0;

@@ -115,0 +115,0 @@ const signbit = number & 0xFFFFFFFF;

@@ -31,3 +31,3 @@ "use strict";

const DataStreamConnection_1 = require("./DataStreamConnection");
const debug = debug_1.default('DataStream:Client');
const debug = (0, debug_1.default)('DataStream:Client');
class DataStreamClient {

@@ -34,0 +34,0 @@ constructor() {

@@ -31,3 +31,3 @@ "use strict";

const debug_1 = __importDefault(require("debug"));
const debug = debug_1.default('DataStream:Connection');
const debug = (0, debug_1.default)('DataStream:Connection');
var ConnectionState;

@@ -64,3 +64,3 @@ (function (ConnectionState) {

setKeys(encryptionKey, decryptionKey) {
assert_1.default(this.state === ConnectionState.UNINITIALIZED);
(0, assert_1.default)(this.state === ConnectionState.UNINITIALIZED);
this.encryptionKey = encryptionKey;

@@ -67,0 +67,0 @@ this.decryptionKey = decryptionKey;

@@ -32,3 +32,3 @@ "use strict";

// in this file lies madness and frustration. and its not only about HDS. also JavaScript is hell
const debug = debug_1.default("DataStream:Parser");
const debug = (0, debug_1.default)("DataStream:Parser");
class Magics {

@@ -69,3 +69,3 @@ }

constructor(value) {
assert_1.default(uuid_1.uuid.isValid(value), "invalid uuid format");
(0, assert_1.default)(uuid_1.uuid.isValid(value), "invalid uuid format");
super(value);

@@ -836,3 +836,3 @@ }

writeUUID(uuid_string) {
assert_1.default(uuid_1.uuid.isValid(uuid_string), "supplied uuid is invalid");
(0, assert_1.default)(uuid_1.uuid.isValid(uuid_string), "supplied uuid is invalid");
if (this.checkDeduplication(new UUID(uuid_string))) {

@@ -839,0 +839,0 @@ return;

@@ -12,3 +12,3 @@ "use strict";

const DataStreamConnection_1 = require("./DataStreamConnection");
const debug = debug_1.default('DataStream:Proxy');
const debug = (0, debug_1.default)('DataStream:Proxy');
class DataStreamProxy {

@@ -15,0 +15,0 @@ constructor() {

@@ -33,3 +33,3 @@ "use strict";

const DataStreamConnection_1 = require("./DataStreamConnection");
const debug = debug_1.default('DataStream:Server');
const debug = (0, debug_1.default)('DataStream:Server');
var ServerState;

@@ -36,0 +36,0 @@ (function (ServerState) {

@@ -38,4 +38,4 @@ "use strict";

const tlv = __importStar(require("./utils/tlv"));
const debug = debug_1.default("HAPClient");
const debugCon = debug_1.default("HAPClient:Connection");
const debug = (0, debug_1.default)("HAPClient");
const debugCon = (0, debug_1.default)("HAPClient:Connection");
var HAPClientEvents;

@@ -95,3 +95,3 @@ (function (HAPClientEvents) {

const state = objects[hap_proxy_1.TLVValues.STATE][0];
assert_1.default(state === hap_proxy_1.HAPStates.M2, "Response was not in state M2");
(0, assert_1.default)(state === hap_proxy_1.HAPStates.M2, "Response was not in state M2");
if (objects[hap_proxy_1.TLVValues.ERROR]) {

@@ -124,3 +124,3 @@ debugCon("M2: received error code " + hap_proxy_1.TLVErrors[objects[hap_proxy_1.TLVValues.ERROR][0]]);

const state = objects[hap_proxy_1.TLVValues.STATE][0];
assert_1.default(state === hap_proxy_1.HAPStates.M4, "Response was not in state M4");
(0, assert_1.default)(state === hap_proxy_1.HAPStates.M4, "Response was not in state M4");
if (objects[hap_proxy_1.TLVValues.ERROR]) {

@@ -186,3 +186,3 @@ debugCon("M4: received error code " + hap_proxy_1.TLVErrors[objects[hap_proxy_1.TLVValues.ERROR][0]]);

const state = objects[hap_proxy_1.TLVValues.STATE][0];
assert_1.default(state === hap_proxy_1.HAPStates.M6, "Response was not in state M6");
(0, assert_1.default)(state === hap_proxy_1.HAPStates.M6, "Response was not in state M6");
if (objects[hap_proxy_1.TLVValues.ERROR]) {

@@ -189,0 +189,0 @@ debugCon("M6: received error code " + hap_proxy_1.TLVErrors[objects[hap_proxy_1.TLVValues.ERROR][0]]);

@@ -97,3 +97,3 @@ "use strict";

// something heavily went wrong if this entry is not in the cache
assert_1.default(serviceIid !== undefined, "Corrupted identifierCache. iid of service not found");
(0, assert_1.default)(serviceIid !== undefined, "Corrupted identifierCache. iid of service not found");
const serviceFilter = this.serviceFilters[aid + "." + serviceIid];

@@ -100,0 +100,0 @@ if (!serviceFilter) {

@@ -41,4 +41,4 @@ "use strict";

const fast_srp_hap_1 = require("fast-srp-hap");
const debug = debug_1.default("HAPServer");
const debugCon = debug_1.default("HAPProxy");
const debug = (0, debug_1.default)("HAPServer");
const debugCon = (0, debug_1.default)("HAPProxy");
var HAPServerEvents;

@@ -162,3 +162,3 @@ (function (HAPServerEvents) {

connection: connection,
nextState: hap_proxy_1.HAPStates.M1,
nextState: hap_proxy_1.HAPStates.M1, // expecting M1 as first state
};

@@ -336,3 +336,3 @@ }

connection.pairVerifySession = {
nextState: hap_proxy_1.HAPStates.M1,
nextState: hap_proxy_1.HAPStates.M1, // expecting M1 as first state
};

@@ -343,3 +343,3 @@ }

connection.pairVerifySession = {
nextState: hap_proxy_1.HAPStates.M1,
nextState: hap_proxy_1.HAPStates.M1, // expecting M1 as first state
};

@@ -571,6 +571,6 @@ }

if (this.listenerCount(HAPServerEvents.ACCESSORIES) === 0) {
return exports.NOT_FOUND_HANDLER(connection, request); // TODO adjust response
return (0, exports.NOT_FOUND_HANDLER)(connection, request); // TODO adjust response
}
return new Promise((resolve, reject) => {
this.emit(HAPServerEvents.ACCESSORIES, connection, once_1.once((error, response) => {
this.emit(HAPServerEvents.ACCESSORIES, connection, (0, once_1.once)((error, response) => {
if (error || !response) {

@@ -595,7 +595,7 @@ reject(error || new Error("Response was undefined!"));

if (this.listenerCount(HAPServerEvents.GET_CHARACTERISTICS) === 0) {
return exports.NOT_FOUND_HANDLER(connection, request); // TODO adjust response
return (0, exports.NOT_FOUND_HANDLER)(connection, request); // TODO adjust response
}
const query = url.parse(request.uri, true).query;
return new Promise((resolve, reject) => {
this.emit(HAPServerEvents.GET_CHARACTERISTICS, connection, query, once_1.once((error, response) => {
this.emit(HAPServerEvents.GET_CHARACTERISTICS, connection, query, (0, once_1.once)((error, response) => {
if (error || !response) {

@@ -612,6 +612,6 @@ reject(error || new Error("Response was undefined!"));

if (this.listenerCount(HAPServerEvents.SET_CHARACTERISTICS) === 0) {
return exports.NOT_FOUND_HANDLER(connection, request); // TODO adjust response
return (0, exports.NOT_FOUND_HANDLER)(connection, request); // TODO adjust response
}
return new Promise((resolve, reject) => {
this.emit(HAPServerEvents.SET_CHARACTERISTICS, connection, request.body, once_1.once((error, response) => {
this.emit(HAPServerEvents.SET_CHARACTERISTICS, connection, request.body, (0, once_1.once)((error, response) => {
if (error || !response) {

@@ -641,3 +641,3 @@ reject(error || new Error("Response was undefined!"));

if (this.listenerCount(HAPServerEvents.PREPARE_WRITE) === 0) {
return exports.NOT_FOUND_HANDLER(connection, request); // TODO adjust response
return (0, exports.NOT_FOUND_HANDLER)(connection, request); // TODO adjust response
}

@@ -670,3 +670,3 @@ return new Promise((resolve, reject) => {

if (this.listenerCount(HAPServerEvents.RESOURCE) === 0) {
return exports.NOT_FOUND_HANDLER(connection, request); // TODO adjust response
return (0, exports.NOT_FOUND_HANDLER)(connection, request); // TODO adjust response
}

@@ -695,3 +695,3 @@ return new Promise((resolve, reject) => {

})(HAPServerConnectionEvents = exports.HAPServerConnectionEvents || (exports.HAPServerConnectionEvents = {}));
exports.NOT_FOUND_HANDLER = (connection, request) => {
const NOT_FOUND_HANDLER = (connection, request) => {
// TODO log connection name

@@ -704,2 +704,3 @@ debugCon("Encountered 404 while accessing '%s'", request.uri);

};
exports.NOT_FOUND_HANDLER = NOT_FOUND_HANDLER;
class HAPServerConnection extends EventEmitter_1.EventEmitter {

@@ -766,3 +767,3 @@ constructor(socket, routeHandler) {

this.httpWorkingQueue = this.httpWorkingQueue
.then(() => requestHandler ? requestHandler(this, request) : exports.NOT_FOUND_HANDLER(this, request))
.then(() => requestHandler ? requestHandler(this, request) : (0, exports.NOT_FOUND_HANDLER)(this, request))
.catch(reason => {

@@ -769,0 +770,0 @@ debugCon("Encountered error when handling response: " + reason);

@@ -29,3 +29,3 @@ "use strict";

this.clientInfo = clientInfo;
this.bonjourService = bonjour_hap_1.default(mdnsConfig);
this.bonjourService = (0, bonjour_hap_1.default)(mdnsConfig);
this.browser = this.bonjourService.find({

@@ -32,0 +32,0 @@ type: "hap",

@@ -8,3 +8,3 @@ "use strict";

const debug_1 = __importDefault(require("debug"));
const debug = debug_1.default("HTTP:ResponseParser");
const debug = (0, debug_1.default)("HTTP:ResponseParser");
var ParsingState;

@@ -11,0 +11,0 @@ (function (ParsingState) {

{
"name": "hap-proxy",
"version": "0.3.7",
"version": "0.3.9",
"description": "An HAP proxy tool written in Typescript",

@@ -17,24 +17,24 @@ "main": "lib/index.js",

"dependencies": {
"@homebridge/ciao": "^1.1.0-beta.23",
"bonjour-hap": "^3.5.11",
"fast-srp-hap": "2.0.2",
"debug": "^4.3.0",
"@homebridge/ciao": "^1.1.2",
"bonjour-hap": "^3.6.3",
"fast-srp-hap": "2.0.4",
"debug": "^4.3.2",
"ip": "^1.1.5",
"node-persist": "^3.1.0",
"tweetnacl": "^1.0.3",
"futoin-hkdf": "~1.3.2",
"futoin-hkdf": "~1.4.2",
"commander": "~5.1.0"
},
"devDependencies": {
"@types/debug": "^4.1.5",
"@types/debug": "^4.1.7",
"@types/ip": "^1.1.0",
"@types/jest": "^26.0.14",
"@types/node": "^12.0.12",
"@types/node-persist": "^3.1.0",
"jest": "^26.5.2",
"@types/jest": "^27.0.2",
"@types/node": "^12.20.33",
"@types/node-persist": "^3.1.2",
"jest": "^27.2.5",
"rimraf": "^3.0.2",
"simple-plist": "1.1.1",
"ts-jest": "^26.4.1",
"ts-node": "^9.0.0",
"typescript": "^4.0.3"
"ts-jest": "^27.0.6",
"ts-node": "^10.3.0",
"typescript": "^4.4.4"
},

@@ -41,0 +41,0 @@ "scripts": {

@@ -44,3 +44,3 @@ # hap-proxy

In order to start up a basic proxy you must supply `--target-name` and `target-pincode`.
In order to start up a basic proxy you must supply `--target-name` and `--target-pincode`.
The first name give the **Instance Name** of the accessory. The easiest way to get that is to open the Home App,

@@ -58,3 +58,3 @@ open the pairing menu and copy the name of the desired accessory.

This project is heavily inspired by the code base of [HAP-NodeJS](https://github.com/KhaosT/HAP-NodeJS)
This project is heavily inspired by the code base of [HAP-NodeJS](https://github.com/homebridge/HAP-NodeJS)
(most of the encryption and decryption layers) and [hap-client](https://github.com/forty2/hap-client).

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc