Skip to content

Commit

Permalink
Fix cipher context assignment in handlecipherconfig.go
Browse files Browse the repository at this point in the history
The previous version was always assigning the last cipher context in the slice instead of the one with the correct ID.

Signed-off-by: Paul Gaiduk <paulg@zededa.com>
  • Loading branch information
europaul authored and eriknordmark committed Dec 15, 2023
1 parent 3e63dda commit 5a232ae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/pillar/cmd/zedagent/handlecipherconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ func parseCipherBlock(ctx *getconfigContext, key string, cfgCipherBlock *zconfig

// get CipherContext and embed it into CipherBlockStatus to avoid potential races
for _, cfgCipherContext := range ctx.cipherContexts {
if cfgCipherContext.ContextID != cipherBlock.CipherContextID {
continue
if cfgCipherContext.ContextID == cipherBlock.CipherContextID {
cipherBlock.CipherContext = &cfgCipherContext
break
}
cipherBlock.CipherContext = &cfgCipherContext
}

if cipherBlock.CipherContext == nil {
Expand Down

0 comments on commit 5a232ae

Please sign in to comment.