Adding support for MS-MDE2 version 6.0 (#15701)

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

<!-- Note that API documentation changes are now addressed by the
product design team. -->

- [ ] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- [ ] Manual QA for all new/changed functionality
This commit is contained in:
Marcos Oviedo 2023-12-18 11:10:58 -03:00 committed by GitHub
parent a00103bc87
commit f3515686e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 7 deletions

View file

@ -147,9 +147,16 @@ func (req *SoapRequest) IsValidDiscoveryMsg() error {
return errors.New("invalid discover message: XMLNS")
}
// Ensure that only valid versions are supported
if req.Body.Discover.Request.RequestVersion != syncml.EnrollmentVersionV4 &&
req.Body.Discover.Request.RequestVersion != syncml.EnrollmentVersionV5 {
// Check if the request version is one of the defined enrollment versions
versionFound := false
for _, v := range syncml.SupportedEnrollmentVersions {
if req.Body.Discover.Request.RequestVersion == v {
versionFound = true
break
}
}
if !versionFound {
return errors.New("invalid discover message: Request.RequestVersion")
}

View file

@ -173,14 +173,14 @@ const (
FleetOSUpdateTargetLocURI = "/Vendor/MSFT/Policy/Config/Update"
)
// Supported MS-MDE2 enrollment versions
var SupportedEnrollmentVersions = []string{"4.0", "5.0", "6.0"}
// MS-MDE2 Message constants
const (
// Minimum supported version
// Default MS-MDE2 enrollment protocol version
EnrollmentVersionV4 = "4.0"
// Maximum supported version
EnrollmentVersionV5 = "5.0"
// xsi:nil indicates value is not present
DefaultStateXSI = "true"