secret-handshake
Advanced tools
Comparing version 1.1.2 to 1.1.4
33
index.js
@@ -1,38 +0,11 @@ | ||
var handshake = require('./handshake') | ||
var secure = require('./secure') | ||
var cl = require('chloride') | ||
'use strict' | ||
module.exports = require('./protocol')(require('./crypto')) | ||
function isBuffer(buf, len) { | ||
return Buffer.isBuffer(buf) && buf.length === len | ||
} | ||
exports.client = | ||
exports.createClient = function (alice, app_key, timeout) { | ||
var create = handshake.client(alice, app_key, timeout) | ||
return function (bob, seed, cb) { | ||
if(!isBuffer(bob, 32)) | ||
throw new Error('createClient *must* be passed a public key') | ||
if('function' === typeof seed) | ||
return create(bob, secure(seed)) | ||
else | ||
return create(bob, seed, secure(cb)) | ||
} | ||
} | ||
exports.server = | ||
exports.createServer = function (bob, authorize, app_key, timeout) { | ||
var create = handshake.server(bob, authorize, app_key, timeout) | ||
return function (cb) { | ||
return create(secure(cb)) | ||
} | ||
} | ||
exports.toKeys = function (keys) { | ||
if(isBuffer(keys, 32)) | ||
return cl.crypto_sign_seed_keypair(keys) | ||
return keys | ||
} | ||
{ | ||
"name": "secret-handshake", | ||
"description": "a simple and highly private secure-channel protocol", | ||
"version": "1.1.2", | ||
"version": "1.1.4", | ||
"homepage": "https://github.com/dominictarr/secret-handshake", | ||
@@ -18,7 +18,8 @@ "repository": { | ||
"devDependencies": { | ||
"pull-bitflipper": "~0.1.0", | ||
"pull-defer": "^0.2.2", | ||
"pull-bitflipper": "~0.1.0", | ||
"pull-hang": "0.0.0", | ||
"stream-to-pull-stream": "~1.6.1", | ||
"tape": "~4.0.0" | ||
"tape": "~4.0.0", | ||
"test-secret-handshake": "^1.0.0" | ||
}, | ||
@@ -25,0 +26,0 @@ "scripts": { |
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
32064
13
812
6