sodium-native
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -5,2 +5,6 @@ # CHANGELOG | ||
## v3.0.1 | ||
* Fixed an issue that caused an assert error if an async callback threw an exception. | ||
## v3.0.0 | ||
@@ -7,0 +11,0 @@ |
{ | ||
"name": "sodium-native", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "Low level bindings for libsodium", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -16,3 +16,3 @@ var test = require('tape') | ||
test('ported from libsodium', function (assert) { /* eslint-disable */ | ||
test('ported from libsodium', function (assert) { /* eslint-disable */ | ||
var mlen = 114 | ||
@@ -19,0 +19,0 @@ var adlen = 12 |
@@ -151,1 +151,75 @@ var tape = require('tape') | ||
}) | ||
tape('crypto_pwhash_scryptsalsa208sha256_async uncaughtException', function (t) { | ||
var output = Buffer.alloc(32) // can be any size | ||
var passwd = Buffer.from('Hej, Verden!') | ||
var salt = Buffer.alloc(sodium.crypto_pwhash_scryptsalsa208sha256_SALTBYTES, 'lo') | ||
var opslimit = sodium.crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_INTERACTIVE | ||
var memlimit = sodium.crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_INTERACTIVE | ||
process.on('uncaughtException', listener) | ||
sodium.crypto_pwhash_scryptsalsa208sha256_async(output, passwd, salt, opslimit, memlimit, exception) | ||
function exception () { | ||
throw new Error('caught') | ||
} | ||
function listener (err) { | ||
if (err.message !== 'caught') { | ||
t.fail() | ||
} else { | ||
t.pass() | ||
} | ||
process.removeListener('uncaughtException', listener) | ||
t.end() | ||
} | ||
}) | ||
tape('crypto_pwhash_scryptsalsa208sha256_str_async uncaughtException', function (t) { | ||
var output = Buffer.alloc(sodium.crypto_pwhash_scryptsalsa208sha256_STRBYTES) // can be any size | ||
var passwd = Buffer.from('Hej, Verden!') | ||
var opslimit = sodium.crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_INTERACTIVE | ||
var memlimit = sodium.crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_INTERACTIVE | ||
process.on('uncaughtException', listener) | ||
sodium.crypto_pwhash_scryptsalsa208sha256_str_async(output, passwd, opslimit, memlimit, exception) | ||
function exception () { | ||
throw new Error('caught') | ||
} | ||
function listener (err) { | ||
if (err.message === 'caught') { | ||
t.pass() | ||
} else { | ||
t.fail() | ||
} | ||
process.removeListener('uncaughtException', listener) | ||
t.end() | ||
} | ||
}) | ||
tape('crypto_pwhash_scryptsalsa208sha256_str_verify_async uncaughtException', function (t) { | ||
var output = Buffer.alloc(sodium.crypto_pwhash_scryptsalsa208sha256_STRBYTES) // can be any size | ||
var passwd = Buffer.from('Hej, Verden!') | ||
process.on('uncaughtException', listener) | ||
sodium.crypto_pwhash_scryptsalsa208sha256_str_verify_async(output, passwd, exception) | ||
function exception () { | ||
throw new Error('caught') | ||
} | ||
function listener (err) { | ||
if (err.message === 'caught') { | ||
t.pass() | ||
} else { | ||
t.fail() | ||
} | ||
process.removeListener('uncaughtException', listener) | ||
t.end() | ||
} | ||
}) |
@@ -158,1 +158,76 @@ var tape = require('tape') | ||
}) | ||
tape('crypto_pwhash_async uncaughtException', function (t) { | ||
var output = Buffer.alloc(32) // can be any size | ||
var passwd = Buffer.from('Hej, Verden!') | ||
var salt = Buffer.alloc(sodium.crypto_pwhash_SALTBYTES, 'lo') | ||
var opslimit = sodium.crypto_pwhash_OPSLIMIT_INTERACTIVE | ||
var memlimit = sodium.crypto_pwhash_MEMLIMIT_INTERACTIVE | ||
var algo = sodium.crypto_pwhash_ALG_DEFAULT | ||
process.on('uncaughtException', listener) | ||
sodium.crypto_pwhash_async(output, passwd, salt, opslimit, memlimit, algo, exception) | ||
function exception () { | ||
throw new Error('caught') | ||
} | ||
function listener (err) { | ||
if (err.message !== 'caught') { | ||
t.fail() | ||
} else { | ||
t.pass() | ||
} | ||
process.removeListener('uncaughtException', listener) | ||
t.end() | ||
} | ||
}) | ||
tape('crypto_pwhash_str_async uncaughtException', function (t) { | ||
var output = Buffer.alloc(sodium.crypto_pwhash_STRBYTES) // can be any size | ||
var passwd = Buffer.from('Hej, Verden!') | ||
var opslimit = sodium.crypto_pwhash_OPSLIMIT_INTERACTIVE | ||
var memlimit = sodium.crypto_pwhash_MEMLIMIT_INTERACTIVE | ||
process.on('uncaughtException', listener) | ||
sodium.crypto_pwhash_str_async(output, passwd, opslimit, memlimit, exception) | ||
function exception () { | ||
throw new Error('caught') | ||
} | ||
function listener (err) { | ||
if (err.message === 'caught') { | ||
t.pass() | ||
} else { | ||
t.fail() | ||
} | ||
process.removeListener('uncaughtException', listener) | ||
t.end() | ||
} | ||
}) | ||
tape('crypto_pwhash_str_verify_async uncaughtException', function (t) { | ||
var output = Buffer.alloc(sodium.crypto_pwhash_STRBYTES) // can be any size | ||
var passwd = Buffer.from('Hej, Verden!') | ||
process.on('uncaughtException', listener) | ||
sodium.crypto_pwhash_str_verify_async(output, passwd, exception) | ||
function exception () { | ||
throw new Error('caught') | ||
} | ||
function listener (err) { | ||
if (err.message === 'caught') { | ||
t.pass() | ||
} else { | ||
t.fail() | ||
} | ||
process.removeListener('uncaughtException', listener) | ||
t.end() | ||
} | ||
}) |
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
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
10884364
2337