Fix segfault when seal block is removed (#8517)
This commit is contained in:
parent
b98401d984
commit
bb4b2b024e
@ -103,17 +103,17 @@ func adjustCoreForSealMigration(logger log.Logger, core *vault.Core, barrierSeal
|
||||
|
||||
// Set the appropriate barrier and recovery configs.
|
||||
switch {
|
||||
case migrationSeal.RecoveryKeySupported() && newSeal.RecoveryKeySupported():
|
||||
case migrationSeal != nil && newSeal != nil && migrationSeal.RecoveryKeySupported() && newSeal.RecoveryKeySupported():
|
||||
// Migrating from auto->auto, copy the configs over
|
||||
newSeal.SetCachedBarrierConfig(existBarrierSealConfig)
|
||||
newSeal.SetCachedRecoveryConfig(existRecoverySealConfig)
|
||||
case migrationSeal.RecoveryKeySupported():
|
||||
case migrationSeal != nil && newSeal != nil && migrationSeal.RecoveryKeySupported():
|
||||
// Migrating from auto->shamir, clone auto's recovery config and set
|
||||
// stored keys to 1.
|
||||
newSealConfig := existRecoverySealConfig.Clone()
|
||||
newSealConfig.StoredShares = 1
|
||||
newSeal.SetCachedBarrierConfig(newSealConfig)
|
||||
case newSeal.RecoveryKeySupported():
|
||||
case newSeal != nil && newSeal.RecoveryKeySupported():
|
||||
// Migrating from shamir->auto, set a new barrier config and set
|
||||
// recovery config to a clone of shamir's barrier config with stored
|
||||
// keys set to 0.
|
||||
|
Loading…
Reference in New Issue
Block a user