You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
require.Error(err, "Quote verification should fail for invalid TCB evaluation data number")
122
122
require.ErrorContains(err, "pcs/quote: failed to verify TCB bundle: pcs/tcb: failed to verify QE identity: pcs/tcb: invalid QE identity: pcs/tcb: invalid QE evaluation data number")
123
123
124
+
// Test whitelisted FMSPC.
125
+
quotePolicy=&QuotePolicy{
126
+
TCBValidityPeriod: 90,
127
+
FMSPCWhitelist: []string{},
128
+
}
129
+
_, err=quote.Verify(quotePolicy, now, &tcbBundle)
130
+
require.NoError(err, "Quote verification should succeed for whitelisted FMSPCs")
131
+
132
+
quotePolicy=&QuotePolicy{
133
+
TCBValidityPeriod: 90,
134
+
FMSPCWhitelist: []string{"00606A000000"},
135
+
}
136
+
_, err=quote.Verify(quotePolicy, now, &tcbBundle)
137
+
require.NoError(err, "Quote verification should succeed for whitelisted FMSPCs")
138
+
139
+
quotePolicy=&QuotePolicy{
140
+
TCBValidityPeriod: 90,
141
+
FMSPCWhitelist: []string{"00606A000001"},
142
+
}
143
+
_, err=quote.Verify(quotePolicy, now, &tcbBundle)
144
+
require.Error(err, "Quote verification should fail for non-whitelisted FMSPCs")
145
+
require.ErrorContains(err, "pcs/quote: failed to verify TCB bundle: pcs/tcb: failed to verify TCB info: pcs/tcb: invalid TCB info: pcs/tcb: FMSPC is not whitelisted")
146
+
124
147
// Test blacklisted FMSPC.
125
148
quotePolicy=&QuotePolicy{
126
149
TCBValidityPeriod: 90,
127
150
FMSPCBlacklist: []string{"00606A000000"},
128
151
}
129
152
_, err=quote.Verify(quotePolicy, now, &tcbBundle)
130
153
require.Error(err, "Quote verification should fail for blacklisted FMSPCs")
131
-
require.ErrorContains(err, "pcs/quote: failed to verify TCB bundle: pcs/tcb: failed to verify TCB info: pcs/tcb: invalid TCB info: pcs/tcb: blacklisted FMSPC")
154
+
require.ErrorContains(err, "pcs/quote: failed to verify TCB bundle: pcs/tcb: failed to verify TCB info: pcs/tcb: invalid TCB info: pcs/tcb: FMSPC is blacklisted")
0 commit comments