Skip to content

Commit 24c49a8

Browse files
fnerdmanfnerdman
andauthored
fix: allows dcap empty measurements (#31)
Co-authored-by: fnerdman <[email protected]>
1 parent e9f5909 commit 24c49a8

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

tdx/validator.go

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,17 +98,21 @@ func (v *Validator) Validate(ctx context.Context, attDocRaw []byte, nonce []byte
9898
MrOwner: hexToBytes("000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"),
9999
MrOwnerConfig: hexToBytes("000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"),
100100
ReportData: extraData,
101-
MrTd: v.expected[0].Expected,
102-
Rtmrs: [][]byte{
103-
v.expected[1].Expected,
104-
v.expected[2].Expected,
105-
v.expected[3].Expected,
106-
v.expected[4].Expected,
107-
},
108101
},
109102
},
110103
}
111104

105+
// Only add measurement validation if we have valid measurements
106+
if v.expected != nil {
107+
config.Policy.TdQuoteBodyPolicy.MrTd = v.expected[0].Expected
108+
config.Policy.TdQuoteBodyPolicy.Rtmrs = [][]byte{
109+
v.expected[1].Expected,
110+
v.expected[2].Expected,
111+
v.expected[3].Expected,
112+
v.expected[4].Expected,
113+
}
114+
}
115+
112116
// config.Policy.TdQuoteBodyPolicy.MinimumTeeTcbSvn="" // skipping MinimumTeeTcbSvn as this is part of tcbinfo
113117
// considering skipping MRSEAM, the tdx module can only be provided by intel and there's already trust here. Also the TDX module svn is part of the tcbinfo check
114118
// yet still we might want to add a check for it at some point

0 commit comments

Comments
 (0)