Skip to content

Commit 00a695c

Browse files
committed
Don't restrict the content of descr when making CA/Certs, it's free-form.
1 parent fb0eb20 commit 00a695c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

usr/local/www/system_camanager.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@
213213
}else if ($reqdfields[$i] == 'dn_commonname'){
214214
if (preg_match("/[\!\@\#\$\%\^\(\)\~\?\>\<\&\/\\\,\"\']/", $_POST["dn_commonname"]))
215215
array_push($input_errors, "The field 'Distinguished name Common Name' contains invalid characters.");
216-
}else if (preg_match("/[\!\@\#\$\%\^\(\)\~\?\>\<\&\/\\\,\.\"\']/", $_POST["$reqdfields[$i]"]))
216+
}else if (($reqdfields[$i] != "descr") && preg_match("/[\!\@\#\$\%\^\(\)\~\?\>\<\&\/\\\,\.\"\']/", $_POST["$reqdfields[$i]"]))
217217
array_push($input_errors, "The field '" . $reqdfieldsn[$i] . "' contains invalid characters.");
218218
}
219219
if (!in_array($_POST["keylen"], $ca_keylens))

usr/local/www/system_certmanager.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@
292292
}else if (preg_match('/commonname/', $reqdfields[$i])){ /* dn_commonname or csr_dn_commonname */
293293
if (preg_match("/[\!\@\#\$\%\^\(\)\~\?\>\<\&\/\\\,\"\']/", $_POST["$reqdfields[$i]"]))
294294
array_push($input_errors, "The field 'Distinguished name Common Name' contains invalid characters.");
295-
}else if (preg_match("/[\!\@\#\$\%\^\(\)\~\?\>\<\&\/\\\,\.\"\']/", $_POST["$reqdfields[$i]"]))
295+
}else if (($reqdfields[$i] != "descr") && preg_match("/[\!\@\#\$\%\^\(\)\~\?\>\<\&\/\\\,\.\"\']/", $_POST["$reqdfields[$i]"]))
296296
array_push($input_errors, "The field '" . $reqdfieldsn[$i] . "' contains invalid characters.");
297297
}
298298
if (isset($_POST["keylen"]) && !in_array($_POST["keylen"], $cert_keylens))

0 commit comments

Comments
 (0)