mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Do not pass vouchers shorter than 5 characters to voucher application, they
are too short to be a valid voucher. Discussed with: Jim P Issue: #4985
This commit is contained in:
parent
c3b1d3ff57
commit
4ccf7dd97a
@ -249,8 +249,10 @@ function voucher_expire($voucher_received) {
|
||||
// Roll# and Ticket# using the external readvoucher binary
|
||||
foreach ($a_vouchers_received as $voucher) {
|
||||
$v = escapeshellarg($voucher);
|
||||
if (strlen($voucher) < 3)
|
||||
if (strlen($voucher) < 5) {
|
||||
captiveportal_syslog("{$voucher} invalid: Too short!");
|
||||
continue; // seems too short to be a voucher!
|
||||
}
|
||||
|
||||
unset($output);
|
||||
$_gb = exec("/usr/local/bin/voucher -c {$g['varetc_path']}/voucher_{$cpzone}.cfg -k {$g['varetc_path']}/voucher_{$cpzone}.public -- $v", $output);
|
||||
@ -371,7 +373,7 @@ function voucher_auth($voucher_received, $test = 0) {
|
||||
// Roll# and Ticket# using the external readvoucher binary
|
||||
foreach ($a_vouchers_received as $voucher) {
|
||||
$v = escapeshellarg($voucher);
|
||||
if (strlen($voucher) < 3) {
|
||||
if (strlen($voucher) < 5) {
|
||||
$test_result[] = "{$voucher} invalid: Too short!";
|
||||
captiveportal_syslog("{$voucher} invalid: Too short!");
|
||||
$error++;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user