summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2011-01-13 09:33:13 -0500
committerjim-p <jimp@pfsense.org>2011-01-13 09:33:13 -0500
commit396cfe2ee573696436e2c310f4d2610c1610965a (patch)
treeafdac50d2e3ad7ffa4bd85bd414c2946ea609586 /usr
parentad0d6389a2fd619a4188b98c1058dbb16191e3ce (diff)
downloadpfsense-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.php2
-rw-r--r--usr/local/www/system_certmanager.php2
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") {
OpenPOWER on IntegriCloud