From b8ee30589bd3e9037e7c7a8a5a1e8c1048afaf2f Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 29 Mar 2023 15:32:44 +0200 Subject: luci-proto-openconnect: relax key checking Valid keys may begin/end with `-----BEGIN PRIVATE KEY-----` and `-----END PRIVATE KEY-----` so make the `RSA` keyword optional. Fixes: #6319 Signed-off-by: Jo-Philipp Wich --- .../htdocs/luci-static/resources/protocol/openconnect.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'protocols/luci-proto-openconnect/htdocs/luci-static/resources') diff --git a/protocols/luci-proto-openconnect/htdocs/luci-static/resources/protocol/openconnect.js b/protocols/luci-proto-openconnect/htdocs/luci-static/resources/protocol/openconnect.js index e38afdc201..929d50f063 100644 --- a/protocols/luci-proto-openconnect/htdocs/luci-static/resources/protocol/openconnect.js +++ b/protocols/luci-proto-openconnect/htdocs/luci-static/resources/protocol/openconnect.js @@ -38,8 +38,8 @@ function sanitizeCert(s) { } function validateCert(priv, section_id, value) { - var beg = priv ? /^-----BEGIN RSA PRIVATE KEY-----$/ : /^-----BEGIN CERTIFICATE-----$/, - end = priv ? /^-----END RSA PRIVATE KEY-----$/ : /^-----END CERTIFICATE-----$/, + var beg = priv ? /^-----BEGIN (RSA )?PRIVATE KEY-----$/ : /^-----BEGIN CERTIFICATE-----$/, + end = priv ? /^-----END (RSA )?PRIVATE KEY-----$/ : /^-----END CERTIFICATE-----$/, lines = value.trim().split(/[\r\n]/), start = false, i; -- cgit v1.2.3