diff --git a/enroll/profile.go b/enroll/profile.go index c309f768..c949baa7 100644 --- a/enroll/profile.go +++ b/enroll/profile.go @@ -53,7 +53,7 @@ func NewPayload(identifier string) *Payload { } } -type SCEPPayload struct { +type SCEPPayloadContent struct { CAFingerprint []byte `plist:"omitempty"` // NSData Challenge string `plist:"omitempty"` Keysize int @@ -65,7 +65,7 @@ type SCEPPayload struct { } // TODO: Actually this is one of those non-nested payloads that doesnt respect the PayloadContent key. -type MDMPayload struct { +type MDMPayloadContent struct { Payload Payload AccessRights int CheckInURL string diff --git a/enroll/service.go b/enroll/service.go index 4b54c170..e02164c6 100644 --- a/enroll/service.go +++ b/enroll/service.go @@ -32,7 +32,7 @@ func (svc service) Enroll() (*Profile, error) { profile.PayloadDisplayName = "Enrollment Profile" profile.PayloadDescription = "The server may alter your settings" - scepContent := SCEPPayload{ + scepContent := SCEPPayloadContent{ Challenge: svc.SCEPChallenge, URL: svc.SCEPUrl, Keysize: 1024, @@ -47,7 +47,7 @@ func (svc service) Enroll() (*Profile, error) { scepPayload.PayloadDisplayName = "SCEP" scepPayload.PayloadContent = scepContent - mdmPayload := MDMPayload{ + mdmPayload := MDMPayloadContent{ Payload: Payload{ PayloadVersion: 1, PayloadType: "com.apple.mdm", diff --git a/enroll/transport.go b/enroll/transport.go index 23eed120..783f8ebb 100644 --- a/enroll/transport.go +++ b/enroll/transport.go @@ -37,7 +37,7 @@ func decodeMDMEnrollRequest(_ context.Context, r *http.Request) (interface{}, er func encodeResponse(ctx context.Context, w http.ResponseWriter, response interface{}) error { resp := response.(mdmEnrollResponse) - plistData, err := plist.Marshal(resp) + plistData, err := plist.Marshal(resp.Profile) if err != nil { return err }