diff --git a/lib/internal/crypto/sig.js b/lib/internal/crypto/sig.js index 71e8fbadaa84d7..9b3895646c7929 100644 --- a/lib/internal/crypto/sig.js +++ b/lib/internal/crypto/sig.js @@ -34,7 +34,6 @@ const { const { getArrayBufferOrView, - getDefaultEncoding, kHandle, } = require('internal/crypto/util'); @@ -70,8 +69,6 @@ Sign.prototype._write = function _write(chunk, encoding, callback) { }; Sign.prototype.update = function update(data, encoding) { - encoding = encoding || getDefaultEncoding(); - if (typeof data === 'string') { validateEncoding(data, encoding); } else if (!isArrayBufferView(data)) { @@ -131,7 +128,6 @@ Sign.prototype.sign = function sign(options, encoding) { const ret = this[kHandle].sign(data, format, type, passphrase, rsaPadding, pssSaltLength, dsaSigEnc); - encoding = encoding || getDefaultEncoding(); if (encoding && encoding !== 'buffer') return ret.toString(encoding); @@ -216,8 +212,6 @@ Verify.prototype.verify = function verify(options, signature, sigEncoding) { passphrase, } = preparePublicOrPrivateKey(options, true); - sigEncoding = sigEncoding || getDefaultEncoding(); - // Options specific to RSA const rsaPadding = getPadding(options); const pssSaltLength = getSaltLength(options);