Skip to content

Commit

Permalink
test: add diffie-hellman regression test
Browse files Browse the repository at this point in the history
Exercises the error path in DiffieHellman::ComputeSecret() in src/node_crypto.cc
  • Loading branch information
bnoordhuis committed Oct 21, 2012
1 parent 627f0d2 commit 82df345
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/simple/test-crypto.js
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,10 @@ var secret3 = dh3.computeSecret(key2, 'hex', 'base64');

assert.equal(secret1, secret3);

assert.throws(function() {
dh3.computeSecret('');
}, /key is too small/i);

// https://github.com/joyent/node/issues/2338
assert.throws(function() {
var p = 'FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74' +
Expand Down

0 comments on commit 82df345

Please sign in to comment.