test: add diffie-hellman regression test

Exercises the error path in DiffieHellman::ComputeSecret() in src/node_crypto.cc
This commit is contained in:
Ben Noordhuis
2012-10-21 23:55:52 +02:00
parent 627f0d27e8
commit 82df345fbb

View File

@@ -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' +