aboutsummaryrefslogtreecommitdiff
path: root/lib/internal/crypto/diffiehellman.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/internal/crypto/diffiehellman.js')
-rw-r--r--lib/internal/crypto/diffiehellman.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/internal/crypto/diffiehellman.js b/lib/internal/crypto/diffiehellman.js
index 793f3fb351..527d8b07e1 100644
--- a/lib/internal/crypto/diffiehellman.js
+++ b/lib/internal/crypto/diffiehellman.js
@@ -34,7 +34,8 @@ function DiffieHellman(sizeOrKey, keyEncoding, generator, genEncoding) {
!isArrayBufferView(sizeOrKey)) {
throw new ERR_INVALID_ARG_TYPE(
'sizeOrKey',
- ['number', 'string', 'Buffer', 'TypedArray', 'DataView']
+ ['number', 'string', 'Buffer', 'TypedArray', 'DataView'],
+ sizeOrKey
);
}
@@ -169,7 +170,7 @@ function ECDH(curve) {
return new ECDH(curve);
if (typeof curve !== 'string')
- throw new ERR_INVALID_ARG_TYPE('curve', 'string');
+ throw new ERR_INVALID_ARG_TYPE('curve', 'string', curve);
this._handle = new _ECDH(curve);
}
@@ -196,12 +197,13 @@ ECDH.convertKey = function convertKey(key, curve, inEnc, outEnc, format) {
if (typeof key !== 'string' && !isArrayBufferView(key)) {
throw new ERR_INVALID_ARG_TYPE(
'key',
- ['string', 'Buffer', 'TypedArray', 'DataView']
+ ['string', 'Buffer', 'TypedArray', 'DataView'],
+ key
);
}
if (typeof curve !== 'string') {
- throw new ERR_INVALID_ARG_TYPE('curve', 'string');
+ throw new ERR_INVALID_ARG_TYPE('curve', 'string', curve);
}
const encoding = getDefaultEncoding();