From eca1a79d96b9c74d61ba393a2127de286feb5538 Mon Sep 17 00:00:00 2001 From: blacktop Date: Sun, 5 Oct 2025 10:33:54 -0600 Subject: [PATCH] =?UTF-8?q?fix:=20`ipsw=20idev=20img=20sign`=20plist=20Mar?= =?UTF-8?q?shal=20error=20=F0=9F=91=A8=F0=9F=8F=BE=E2=80=8D=F0=9F=94=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/plist/build_manifest.go | 52 +++++++++++++++++++++++++++++++++++++ pkg/tss/tss.go | 4 +++ 2 files changed, 56 insertions(+) diff --git a/pkg/plist/build_manifest.go b/pkg/plist/build_manifest.go index 6ef765165..402067aeb 100644 --- a/pkg/plist/build_manifest.go +++ b/pkg/plist/build_manifest.go @@ -153,6 +153,58 @@ type IdentityManifest struct { TBMDigests *[]byte `plist:"TBMDigests,omitempty" json:"tbm_digests,omitempty" mapstructure:"TBMDigests,omitempty"` } +// MarshalMap converts IdentityManifest to a map suitable for plist marshaling +// by dereferencing all pointer values +func (m IdentityManifest) MarshalMap() map[string]any { + result := make(map[string]any) + if len(m.Digest) > 0 { + result["Digest"] = m.Digest + } + if m.DigestListSize != nil { + result["DigestListSize"] = *m.DigestListSize + } + if m.FabRevision != nil { + result["FabRevision"] = *m.FabRevision + } + if m.Name != nil { + result["Name"] = *m.Name + } + if m.BuildString != nil { + result["BuildString"] = *m.BuildString + } + if m.Info != nil { + result["Info"] = m.Info + } + if m.EPRO != nil { + result["EPRO"] = *m.EPRO + } + if m.ESEC != nil { + result["ESEC"] = *m.ESEC + } + if m.Trusted != nil { + result["Trusted"] = *m.Trusted + } + if m.MemoryMap != nil { + result["MemoryMap"] = *m.MemoryMap + } + if m.ObjectPayloadPropertyDigest != nil { + result["ObjectPayloadPropertyDigest"] = *m.ObjectPayloadPropertyDigest + } + if m.ProductionUpdatePayloadHash != nil { + result["ProductionUpdatePayloadHash"] = *m.ProductionUpdatePayloadHash + } + if m.DevelopmentUpdatePayloadHash != nil { + result["DevelopmentUpdatePayloadHash"] = *m.DevelopmentUpdatePayloadHash + } + if m.RawDataDigest != nil { + result["RawDataDigest"] = *m.RawDataDigest + } + if m.TBMDigests != nil { + result["TBMDigests"] = *m.TBMDigests + } + return result +} + func (m IdentityManifest) String() string { var bs string if m.BuildString != nil && len(*m.BuildString) > 0 { diff --git a/pkg/tss/tss.go b/pkg/tss/tss.go index 9459b99db..e4fc706e8 100644 --- a/pkg/tss/tss.go +++ b/pkg/tss/tss.go @@ -506,6 +506,10 @@ func Personalize(conf *PersonalConfig) ([]byte, error) { return nil, err } + // Convert IdentityManifest pointer values to regular values for plist marshalling + tssMap["PersonalizedDMG"] = tssReq.PersonalizedDMG.MarshalMap() + tssMap["LoadableTrustCache"] = tssReq.LoadableTrustCache.MarshalMap() + for k, v := range conf.PersonlID { if strings.HasPrefix(k, "Ap,") { switch v := v.(type) {