mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-25 09:21:11 -04:00
measurements: refactor validation option (#1462)
Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
This commit is contained in:
parent
1ab40b7ca6
commit
02fc3dc635
17 changed files with 290 additions and 281 deletions
|
@ -272,7 +272,9 @@ func (u *Upgrader) updateMeasurements(ctx context.Context, newMeasurements measu
|
|||
|
||||
// don't allow potential security downgrades by setting the warnOnly flag to true
|
||||
for k, newM := range newMeasurements {
|
||||
if currentM, ok := currentMeasurements[k]; ok && !currentM.WarnOnly && newM.WarnOnly {
|
||||
if currentM, ok := currentMeasurements[k]; ok &&
|
||||
currentM.ValidationOpt != measurements.WarnOnly &&
|
||||
newM.ValidationOpt == measurements.WarnOnly {
|
||||
return fmt.Errorf("setting enforced measurement %d to warn only: not allowed", k)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue