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>
(cherry picked from commit
b8ee30589bd3e9037e7c7a8a5a1e8c1048afaf2f)
}
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;