Skip to content

Commit

Permalink
backport of commit 770d902
Browse files Browse the repository at this point in the history
  • Loading branch information
victorr authored Oct 9, 2024
1 parent 2790e06 commit ef3980e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions changelog/28631.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
core/seal: Fix an issue that could cause reading from sys/seal-backend-status to return stale information.
```
11 changes: 10 additions & 1 deletion vault/logical_system.go
Original file line number Diff line number Diff line change
Expand Up @@ -5641,7 +5641,16 @@ func (c *Core) GetSealBackendStatus(ctx context.Context) (*SealBackendStatusResp
if err != nil {
return nil, fmt.Errorf("could not list partially seal wrapped values: %w", err)
}
genInfo := c.seal.GetAccess().GetSealGenerationInfo()
// When multi-seal is enabled, use the stored seal generation information. Note that the in-memory
// value may not be up-to-date on non-active nodes.
genInfo, err := PhysicalSealGenInfo(ctx, c.physical)
if err != nil {
return nil, fmt.Errorf("could not read seal generation information: %w", err)
}
if genInfo == nil {
// Multi-seal is not enabled, use the in-memory value.
genInfo = c.seal.GetAccess().GetSealGenerationInfo()
}
r.FullyWrapped = genInfo.IsRewrapped() && len(pps) == 0
return &r, nil
}
Expand Down

0 comments on commit ef3980e

Please sign in to comment.