summaryrefslogtreecommitdiff
path: root/lib/tls.js
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2019-11-23 10:09:05 +0100
committerMichaël Zasso <targos@protonmail.com>2019-11-27 19:29:01 +0100
commit141a6e34eed05577edf43ad085a74f330d0559cb (patch)
tree1d66ed917d299069b79d34abe1493d18dcb5e138 /lib/tls.js
parent5904dfcc9c70b79971ab09dacd711e5c13d7120c (diff)
downloadandroid-node-v8-141a6e34eed05577edf43ad085a74f330d0559cb.tar.gz
android-node-v8-141a6e34eed05577edf43ad085a74f330d0559cb.tar.bz2
android-node-v8-141a6e34eed05577edf43ad085a74f330d0559cb.zip
lib: enforce use of Array from primordials
PR-URL: https://github.com/nodejs/node/pull/30635 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'lib/tls.js')
-rw-r--r--lib/tls.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/tls.js b/lib/tls.js
index 8c7e79572d..0fec451c2b 100644
--- a/lib/tls.js
+++ b/lib/tls.js
@@ -22,6 +22,8 @@
'use strict';
const {
+ Array,
+ ArrayIsArray,
ObjectDefineProperty,
ObjectFreeze,
} = primordials;
@@ -124,7 +126,7 @@ function convertProtocols(protocols) {
exports.convertALPNProtocols = function convertALPNProtocols(protocols, out) {
// If protocols is Array - translate it into buffer
- if (Array.isArray(protocols)) {
+ if (ArrayIsArray(protocols)) {
out.ALPNProtocols = convertProtocols(protocols);
} else if (isArrayBufferView(protocols)) {
// Copy new buffer not to be modified by user.
@@ -261,7 +263,7 @@ exports.checkServerIdentity = function checkServerIdentity(hostname, cert) {
if (dnsNames.length === 0 && ips.length === 0 && uriNames.length === 0) {
const cn = subject.CN;
- if (Array.isArray(cn))
+ if (ArrayIsArray(cn))
valid = cn.some(wildcard);
else if (cn)
valid = wildcard(cn);