From 032930fcec225b4f73edc4cf264baa5b73942c4d Mon Sep 17 00:00:00 2001 From: Fabian Franz BSc Date: Sat, 12 Jan 2019 17:14:15 +0100 Subject: [PATCH] www/nginx: remove workaround for njs encoding bug; release 1.6 (#1125) * www/nginx: remove workaround for njs encoding bug; release 1.6 * www/nginx: cleanup, remove useless line --- www/nginx/Makefile | 2 +- .../src/opnsense/scripts/nginx/ngx_functions.js | 12 +----------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/www/nginx/Makefile b/www/nginx/Makefile index d55c1c9f4..eb8a02744 100644 --- a/www/nginx/Makefile +++ b/www/nginx/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= nginx -PLUGIN_VERSION= 1.5 +PLUGIN_VERSION= 1.6 PLUGIN_COMMENT= Nginx HTTP server and reverse proxy PLUGIN_DEPENDS= nginx PLUGIN_MAINTAINER= franz.fabian.94@gmail.com diff --git a/www/nginx/src/opnsense/scripts/nginx/ngx_functions.js b/www/nginx/src/opnsense/scripts/nginx/ngx_functions.js index 6483b0762..5f17d76ee 100755 --- a/www/nginx/src/opnsense/scripts/nginx/ngx_functions.js +++ b/www/nginx/src/opnsense/scripts/nginx/ngx_functions.js @@ -1,15 +1,6 @@ var fs = require('fs'); var tls_fingerprints = JSON.parse(fs.readFileSync('/usr/local/etc/nginx/tls_fingerprints.json')); -function customArrayIndexOf(haystack, needle) { - var element, element_id; - for (element_id in haystack) { - element = haystack[element_id]; - if (element == needle) return element_id; - } - return -1; -} - function check_cipher_array(r, browser_ciphers, fingerprint_ciphers, result) { if (result.status == 'Intercepted') { return; @@ -25,12 +16,11 @@ function check_cipher_array(r, browser_ciphers, fingerprint_ciphers, result) { var current_index; for (browser_cipher_index in browser_ciphers) { browser_cipher = browser_ciphers[browser_cipher_index]; - current_index = customArrayIndexOf(fingerprint_ciphers, browser_cipher); + current_index = fingerprint_ciphers.indexOf(browser_cipher); if (current_index === -1 || current_index <= last_index) { // a cipher has been found, which is not supported by the browser // such a connection is definitly intercepted result.status = "Intercepted"; - //result.status = JSON.stringify(fingerprint_ciphers[0].toBytes().toString('hex')); return; } last_index = current_index;