From db014d3a0e5480342d688ce57d28f085a1112c6a Mon Sep 17 00:00:00 2001 From: Jesse Peterson Date: Sun, 25 Jun 2017 20:17:44 -0700 Subject: [PATCH] Allow signed profiles to be uploaded by checking for PKCS7 (#218) * Allow signed profiles to be uploaded by checking for PKCS7 * Remove comment --- profile/profile.go | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/profile/profile.go b/profile/profile.go index 9546867f..0cd27d11 100644 --- a/profile/profile.go +++ b/profile/profile.go @@ -1,8 +1,9 @@ package profile import ( - "errors" + "github.com/pkg/errors" + "github.com/fullsailor/pkcs7" "github.com/gogo/protobuf/proto" "github.com/groob/plist" "github.com/micromdm/micromdm/profile/internal/profileproto" @@ -16,9 +17,20 @@ type payloadIdentifier struct { } func (mc *Mobileconfig) GetPayloadIdentifier() (string, error) { - // TODO: support CMS signed profiles + mcBytes := *mc + if len(mcBytes) > 5 && string(mcBytes[0:5]) != "