Adding the ability to support OWLS.

This commit is contained in:
stephb9959
2021-11-03 23:20:03 -07:00
parent cfc9422266
commit c7bb51e73f
2 changed files with 6 additions and 2 deletions

View File

@@ -281,6 +281,10 @@ namespace OpenWifi {
CommandManager()->PostCommandResult(SerialNumber_, Doc);
}
static bool IsSimSerialNumber(const std::string & SerialNumber) {
return SerialNumber.substr(0,6) == "53494d";
}
void WSConnection::ProcessJSONRPCEvent(Poco::JSON::Object::Ptr & Doc) {
auto Method = Doc->get(uCentralProtocol::METHOD).toString();
@@ -354,7 +358,7 @@ namespace OpenWifi {
CId_ = SerialNumber_ + "@" + CId_ ;
// We need to verify the certificate if we have one
if(!CN_.empty() && Utils::SerialNumberMatch(CN_,SerialNumber_)) {
if(!CN_.empty() && (Utils::SerialNumberMatch(CN_,SerialNumber_) || IsSimSerialNumber(CN_))) {
CertValidation_ = GWObjects::VERIFIED;
Logger_.information(Poco::format("CONNECT(%s): Fully validated and authenticated device..", CId_));
} else {