mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-10-01 01:36:09 -04:00
measurements: compare to constants for clarity
This commit is contained in:
parent
83e6b4d64d
commit
091fe3e2d7
@ -143,7 +143,7 @@ func (m *M) EqualTo(other M) bool {
|
||||
func (m *M) GetEnforced() []uint32 {
|
||||
var enforced []uint32
|
||||
for idx, measurement := range *m {
|
||||
if !measurement.ValidationOpt {
|
||||
if measurement.ValidationOpt == Enforce {
|
||||
enforced = append(enforced, idx)
|
||||
}
|
||||
}
|
||||
|
@ -227,7 +227,7 @@ func (v *Validator) Validate(ctx context.Context, attDocRaw []byte, nonce []byte
|
||||
}
|
||||
for idx, pcr := range v.expected {
|
||||
if !bytes.Equal(pcr.Expected[:], attDoc.Attestation.Quotes[quoteIdx].Pcrs.Pcrs[idx]) {
|
||||
if !pcr.ValidationOpt {
|
||||
if pcr.ValidationOpt == measurements.Enforce {
|
||||
return nil, fmt.Errorf("untrusted PCR value at PCR index %d", idx)
|
||||
}
|
||||
v.log.Warnf("Encountered untrusted PCR value at index %d", idx)
|
||||
|
Loading…
Reference in New Issue
Block a user