mirror of
https://github.com/Telecominfraproject/wlan-cloud-owprov.git
synced 2025-11-01 02:58:00 +00:00
Signed-off-by: stephb9959 <stephane.bourque@gmail.com>
This commit is contained in:
@@ -111,6 +111,24 @@ namespace OpenWifi {
|
||||
if(!StorageService()->OrionAccountsDB().Exists("id",Server.UseOpenRoamingAccount)) {
|
||||
return BadRequest(RESTAPI::Errors::OrionAccountMustExist);
|
||||
}
|
||||
if(Server.Certificate.empty() || !Utils::ValidX509Certificate(Server.Certificate)) {
|
||||
return BadRequest(RESTAPI::Errors::InvalidRadsecMainCertificate);
|
||||
}
|
||||
if(Server.CaCerts.empty() || !Utils::ValidX509Certificate(Server.CaCerts)) {
|
||||
return BadRequest(RESTAPI::Errors::InvalidRadsecCaCertificate);
|
||||
}
|
||||
if(Server.PrivateKey.empty() || !Utils::VerifyPrivateKey(Server.PrivateKey)) {
|
||||
return BadRequest(RESTAPI::Errors::InvalidRadsecPrivteKey);
|
||||
}
|
||||
if(!Utils::ValidIP(Server.IP)) {
|
||||
return BadRequest(RESTAPI::Errors::InvalidRadsecIPAddress);
|
||||
}
|
||||
if(!(Server.Port>0 && Server.Port<65535)) {
|
||||
return BadRequest(RESTAPI::Errors::InvalidRadsecPort);
|
||||
}
|
||||
if(Server.Secret.empty()) {
|
||||
return BadRequest(RESTAPI::Errors::InvalidRadsecSecret);
|
||||
}
|
||||
}
|
||||
} break;
|
||||
case RadiusEndpointDB::EndpointType::globalreach: {
|
||||
@@ -118,6 +136,24 @@ namespace OpenWifi {
|
||||
if(!StorageService()->GLBLRCertsDB().Exists("id",Server.UseOpenRoamingAccount)) {
|
||||
return BadRequest(RESTAPI::Errors::GlobalReachCertMustExist);
|
||||
}
|
||||
if(Server.Certificate.empty() || !Utils::ValidX509Certificate(Server.Certificate)) {
|
||||
return BadRequest(RESTAPI::Errors::InvalidRadsecMainCertificate);
|
||||
}
|
||||
if(Server.CaCerts.empty() || !Utils::ValidX509Certificate(Server.CaCerts)) {
|
||||
return BadRequest(RESTAPI::Errors::InvalidRadsecCaCertificate);
|
||||
}
|
||||
if(Server.PrivateKey.empty() || !Utils::VerifyPrivateKey(Server.PrivateKey)) {
|
||||
return BadRequest(RESTAPI::Errors::InvalidRadsecPrivteKey);
|
||||
}
|
||||
if(!Utils::ValidIP(Server.IP)) {
|
||||
return BadRequest(RESTAPI::Errors::InvalidRadsecIPAddress);
|
||||
}
|
||||
if(!(Server.Port>0 && Server.Port<65535)) {
|
||||
return BadRequest(RESTAPI::Errors::InvalidRadsecPort);
|
||||
}
|
||||
if(Server.Secret.empty()) {
|
||||
return BadRequest(RESTAPI::Errors::InvalidRadsecSecret);
|
||||
}
|
||||
}
|
||||
} break;
|
||||
case RadiusEndpointDB::EndpointType::radsec: {
|
||||
|
||||
Reference in New Issue
Block a user