diff options
author | Jo-Philipp Wich <jo@mein.io> | 2023-03-29 15:32:44 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2023-03-29 15:33:37 +0200 |
commit | b8ee30589bd3e9037e7c7a8a5a1e8c1048afaf2f (patch) | |
tree | edd057792806a7abdfdccf554b06cb7107997c6b /protocols/luci-proto-openconnect/htdocs/luci-static | |
parent | 48086e1c7b3e7094b6fbe61335209189b1006bfb (diff) |
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 <jo@mein.io>
Diffstat (limited to 'protocols/luci-proto-openconnect/htdocs/luci-static')
-rw-r--r-- | protocols/luci-proto-openconnect/htdocs/luci-static/resources/protocol/openconnect.js | 4 |
1 files changed, 2 insertions, 2 deletions
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; |