summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2006-03-11 00:55:31 +0000
committerScott Ullrich <sullrich@pfsense.org>2006-03-11 00:55:31 +0000
commit7aae518a2f9e5b57d8130e780220f878dc0fe41e (patch)
treee2af9da52080fa32e36a14f607093e54406785f4 /etc
parentca0a985f28b2c532bb7655765e9a407da9668e48 (diff)
downloadpfsense-7aae518a2f9e5b57d8130e780220f878dc0fe41e.zip
pfsense-7aae518a2f9e5b57d8130e780220f878dc0fe41e.tar.gz
Do not allow ^M or \n\n
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/system.inc13
1 files changed, 11 insertions, 2 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc
index 44be03a..49711d0 100644
--- a/etc/inc/system.inc
+++ b/etc/inc/system.inc
@@ -470,7 +470,7 @@ function system_webgui_start_old() {
if ($config['system']['webgui']['certificate'] && $config['system']['webgui']['private-key']) {
$cert = base64_decode($config['system']['webgui']['certificate']);
- $key = base64_decode($config['system']['webgui']['private-key']);
+ $key = base64_decode($config['system']['webgui']['private-key']);
} else {
/* default certificate/key */
$cert = <<<EOD
@@ -507,7 +507,10 @@ CsF1s0TdJLi/wzNQRAL37A8vqCeVFR/ng3Xpg96Yg+8Z
EOD;
}
-
+
+ $cert = str_replace("\r", "", $cert);
+ $key = str_replace("\r", "", $key);
+
$fd = fopen("{$g['varetc_path']}/cert.pem", "w");
if (!$fd) {
printf("Error: cannot open cert.pem in system_webgui_start().\n");
@@ -759,6 +762,12 @@ debug.log-file-not-found = "disable"
EOD;
+ $cert = str_replace("\r", "", $cert);
+ $key = str_replace("\r", "", $key);
+
+ $cert = str_replace("\n\n", "\n", $cert);
+ $key = str_replace("\n\n", "\n", $key);
+
if($cert <> "" and $key <> "") {
$fd = fopen("{$g['varetc_path']}/{$cert_location}", "w");
if (!$fd) {
OpenPOWER on IntegriCloud