Merge pull request #59 from Telecominfraproject/WIFI-100079

Fix: https://telecominfraproject.atlassian.net/browse/WIFI-10079
This commit is contained in:
Stephane Bourque
2022-07-08 21:16:35 -07:00
committed by GitHub
3 changed files with 10 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.13)
project(owsec VERSION 2.7.0)
project(owsec VERSION 2.6.0)
set(CMAKE_CXX_STANDARD 17)

2
build
View File

@@ -1 +1 @@
1
60

View File

@@ -45,6 +45,8 @@ namespace OpenWifi {
bool SMSSender::StartValidation(const std::string &Number, const std::string &UserName) {
std::lock_guard G(Mutex_);
if(!Enabled_)
return false;
CleanCache();
uint64_t Now=OpenWifi::Now();
auto Challenge = MFAServer::MakeChallenge();
@@ -56,6 +58,9 @@ namespace OpenWifi {
bool SMSSender::IsNumberValid(const std::string &Number, const std::string &UserName) {
std::lock_guard G(Mutex_);
if(!Enabled_)
return false;
for(const auto &i:Cache_) {
if(i.Number==Number && i.UserName==UserName)
return i.Validated;
@@ -66,6 +71,9 @@ namespace OpenWifi {
bool SMSSender::CompleteValidation(const std::string &Number, const std::string &Code, const std::string &UserName) {
std::lock_guard G(Mutex_);
if(!Enabled_)
return false;
for(auto &i:Cache_) {
if(i.Code==Code && i.Number==Number && i.UserName==UserName) {
i.Validated=true;