diff options
author | Daniel Bevenius <daniel.bevenius@gmail.com> | 2019-06-07 07:22:19 +0200 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-06-12 20:58:27 -0700 |
commit | 173bee230e643345876f22b7469beb253c1c9473 (patch) | |
tree | 23d83a9eae92feb15138373af4f816a8637bafb7 | |
parent | 0640526303bbe9c41801e2ad795f9cccb29f1fa4 (diff) | |
download | android-node-v8-173bee230e643345876f22b7469beb253c1c9473.tar.gz android-node-v8-173bee230e643345876f22b7469beb253c1c9473.tar.bz2 android-node-v8-173bee230e643345876f22b7469beb253c1c9473.zip |
tls: rename validateKeyCert in _tls_common.js
This commit renames validateKeyCert to validateKeyCertArg to avoid
confusing this with something that would validate the actual key or
certificate.
PR-URL: https://github.com/nodejs/node/pull/28116
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
-rw-r--r-- | lib/_tls_common.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/_tls_common.js b/lib/_tls_common.js index 82ab45f389..efe9040956 100644 --- a/lib/_tls_common.js +++ b/lib/_tls_common.js @@ -75,7 +75,7 @@ function SecureContext(secureProtocol, secureOptions, minVersion, maxVersion) { if (secureOptions) this.context.setOptions(secureOptions); } -function validateKeyCert(name, value) { +function validateKeyOrCertOption(name, value) { if (typeof value !== 'string' && !isArrayBufferView(value)) { throw new ERR_INVALID_ARG_TYPE( `options.${name}`, @@ -107,11 +107,11 @@ exports.createSecureContext = function createSecureContext(options) { if (Array.isArray(ca)) { for (i = 0; i < ca.length; ++i) { val = ca[i]; - validateKeyCert('ca', val); + validateKeyOrCertOption('ca', val); c.context.addCACert(val); } } else { - validateKeyCert('ca', ca); + validateKeyOrCertOption('ca', ca); c.context.addCACert(ca); } } else { @@ -123,11 +123,11 @@ exports.createSecureContext = function createSecureContext(options) { if (Array.isArray(cert)) { for (i = 0; i < cert.length; ++i) { val = cert[i]; - validateKeyCert('cert', val); + validateKeyOrCertOption('cert', val); c.context.setCert(val); } } else { - validateKeyCert('cert', cert); + validateKeyOrCertOption('cert', cert); c.context.setCert(cert); } } @@ -144,11 +144,11 @@ exports.createSecureContext = function createSecureContext(options) { val = key[i]; // eslint-disable-next-line eqeqeq const pem = (val != undefined && val.pem !== undefined ? val.pem : val); - validateKeyCert('key', pem); + validateKeyOrCertOption('key', pem); c.context.setKey(pem, val.passphrase || passphrase); } } else { - validateKeyCert('key', key); + validateKeyOrCertOption('key', key); c.context.setKey(key, passphrase); } } |