pfSense Forum

pfSense English Support => Captive Portal => Topic started by: legacysl on November 27, 2017, 10:30:05 pm

Title: Unused Vouchers shown as expired
Post by: legacysl on November 27, 2017, 10:30:05 pm
Hi all, was running 2.3.4 with a captive portal and vouchers of different time durations, 24 hours / 48 hours etc. Everything was working fine but unfortunate due to a power outage the config/install got corrupted and I had to to a fresh install and upload a backup of the config.

Since 2.4.0 was released I decided to to trial that. The same voucher rolls where generated with the restoration of the config but since they where unmarked as used it should not have been an issue.

Right now if I issue 10 vouchers at least 4 will come back as expired. I have upgraded to 2.4.2 and deleted the old rolls and generated new ones but the problem persists.

Is there a known issue with 2.4.0 and above regarding vouchers?

Thanks for the help.
Title: Re: Unused Vouchers shown as expired
Post by: Gertjan on November 28, 2017, 06:26:03 am
Hi,

Do yo mean that when you create a new roll with for example 10 vouchers with a duration of 15 minutes, some of them are expired as soon as you create them ?
Title: Re: Unused Vouchers shown as expired
Post by: legacysl on December 05, 2017, 10:34:38 pm
Its for use in a public wifi zone and w use vouchers to limit guest bandwidth usage, I have created 3 rolls of 1440 mins / 2880 mins & 4320 mins respectively. Each roll has 1023 vouchers. 

Say that we issue 10 guest one voucher each, 4-5 of them will get an error saying the voucher has expired.

Title: Re: Unused Vouchers shown as expired
Post by: Derelict on December 05, 2017, 10:57:21 pm
So take some and test them. What do you see? What does the portal auth log say?

Going to need more information. When I have used vouchers they worked fine.
Title: Re: Unused Vouchers shown as expired
Post by: Gertjan on December 06, 2017, 06:14:04 am
Same here.
Created 5 rolls  with 5 vouchers each - lasting 15 minutes each.
Tested them all using the "voucher test page"
They ware all valid, 15 minutes left.
When using one, it timed out after 15 min.

Title: Re: Unused Vouchers shown as expired
Post by: jimp on December 07, 2017, 08:53:22 am
I have not seen this personally but I have seen someone say it happened when they made custom shorter keys and made the bit counts lower so they could have shorted voucher codes. At some point there isn't enough randomness in the voucher codes and things get unpredictable, which is why the defaults are where they are.
Title: Re: Unused Vouchers shown as expired
Post by: legacysl on December 07, 2017, 10:45:42 am
So take some and test them. What do you see? What does the portal auth log say?

Going to need more information. When I have used vouchers they worked fine.

Log shows it as expired voucher no other information
Title: Re: Unused Vouchers shown as expired
Post by: legacysl on December 07, 2017, 10:46:58 am
I have not seen this personally but I have seen someone say it happened when they made custom shorter keys and made the bit counts lower so they could have shorted voucher codes. At some point there isn't enough randomness in the voucher codes and things get unpredictable, which is why the defaults are where they are.

This maybe a possibility as I have made the key shorter but this only started to happen on 2.4.2
Title: Re: Unused Vouchers shown as expired
Post by: legacysl on December 07, 2017, 10:54:22 am
So now its throwing out a new problem. So when a user connects who's token has expired the only get the confirmation page but it does not redirect or allow browsing.
Title: Re: Unused Vouchers shown as expired
Post by: Derelict on December 07, 2017, 05:09:30 pm
When I used them I used a 31-bit RSA key for shorter codes and never saw a problem. I was not issuing "lots" of vouchers though. Rolls of 100 usually.