EC private keys exist

f52cb3a027
This commit is contained in:
iliajie
2023-03-12 01:17:23 +02:00
parent 7cef589e92
commit 0c9cda6a0b

View File

@ -8,8 +8,8 @@ require './usermin-lib.pl';
# Validate inputs
$key = $in{'key'} || $in{'keyfile'};
$key =~ s/\r//g;
$key =~ /BEGIN RSA PRIVATE KEY/ &&
$key =~ /END RSA PRIVATE KEY/ || &error($text{'savekey_ekey'});
$key =~ /BEGIN (RSA |EC )?PRIVATE KEY/ &&
$key =~ /END (RSA |EC )?PRIVATE KEY/ || &error($text{'savekey_ekey'});
if (!$in{'cert_def'}) {
# Make sure cert is valid
$cert = $in{'cert'} || $in{'certfile'};