diff options
author | jim-p <jimp@pfsense.org> | 2011-01-13 09:33:13 -0500 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2011-01-13 09:33:13 -0500 |
commit | 396cfe2ee573696436e2c310f4d2610c1610965a (patch) | |
tree | afdac50d2e3ad7ffa4bd85bd414c2946ea609586 /usr | |
parent | ad0d6389a2fd619a4188b98c1058dbb16191e3ce (diff) | |
download | pfsense-396cfe2ee573696436e2c310f4d2610c1610965a.zip pfsense-396cfe2ee573696436e2c310f4d2610c1610965a.tar.gz |
Validate imported CA/Cert a bit more strongly. Should fix #1190
Diffstat (limited to 'usr')
-rw-r--r-- | usr/local/www/system_camanager.php | 2 | ||||
-rw-r--r-- | usr/local/www/system_certmanager.php | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/usr/local/www/system_camanager.php b/usr/local/www/system_camanager.php index 2662775..6eddd39 100644 --- a/usr/local/www/system_camanager.php +++ b/usr/local/www/system_camanager.php @@ -138,6 +138,8 @@ if ($_POST) { $reqdfieldsn = array( gettext("Descriptive name"), gettext("Certificate data")); + if ($_POST['cert'] && (!strstr($_POST['cert'], "BEGIN CERTIFICATE") || !strstr($_POST['cert'], "END CERTIFICATE"))) + $input_errors[] = gettext("This certificate does not appear to be valid."); } if ($pconfig['method'] == "internal") { $reqdfields = explode(" ", diff --git a/usr/local/www/system_certmanager.php b/usr/local/www/system_certmanager.php index 36a11bb..0113461 100644 --- a/usr/local/www/system_certmanager.php +++ b/usr/local/www/system_certmanager.php @@ -162,6 +162,8 @@ if ($_POST) { gettext("Descriptive name"), gettext("Certificate data"), gettext("Key data")); + if ($_POST['cert'] && (!strstr($_POST['cert'], "BEGIN CERTIFICATE") || !strstr($_POST['cert'], "END CERTIFICATE"))) + $input_errors[] = gettext("This certificate does not appear to be valid."); } if ($pconfig['method'] == "internal") { |