summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuiz Otavio O Souza <luiz@netgate.com>2015-09-22 07:45:22 -0500
committerLuiz Otavio O Souza <luiz@netgate.com>2015-09-22 07:50:17 -0500
commit9fcbc9ffe38e39e59d7ad098e4e9ba7a378162d9 (patch)
treec9cd6ead5ddf259296749938f636a2e686585b57
parent670a33c5dc611847ac7a518d9c604b7486601400 (diff)
downloadpfsense-9fcbc9ffe38e39e59d7ad098e4e9ba7a378162d9.zip
pfsense-9fcbc9ffe38e39e59d7ad098e4e9ba7a378162d9.tar.gz
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
-rw-r--r--src/etc/inc/voucher.inc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/etc/inc/voucher.inc b/src/etc/inc/voucher.inc
index 1346f90..2e0f5f5 100644
--- a/src/etc/inc/voucher.inc
+++ b/src/etc/inc/voucher.inc
@@ -258,7 +258,8 @@ 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!
}
@@ -391,7 +392,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++;
OpenPOWER on IntegriCloud