mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-30 18:17:55 +00:00
cli/json: correctly output the number of key shares and threshold on stored keys (#5910)
This commit is contained in:
committed by
Jeff Mitchell
parent
e366aeb2e3
commit
7ac17d69c0
@@ -549,8 +549,15 @@ func newMachineInit(req *api.InitRequest, resp *api.InitResponse) *machineInit {
|
||||
init.UnsealKeysB64[i] = v
|
||||
}
|
||||
|
||||
init.UnsealShares = req.SecretShares
|
||||
init.UnsealThreshold = req.SecretThreshold
|
||||
// If we don't get a set of keys back, it means that we are storing the keys,
|
||||
// so the key shares and threshold has been set to 1.
|
||||
if len(resp.Keys) == 0 {
|
||||
init.UnsealShares = 1
|
||||
init.UnsealThreshold = 1
|
||||
} else {
|
||||
init.UnsealShares = req.SecretShares
|
||||
init.UnsealThreshold = req.SecretThreshold
|
||||
}
|
||||
|
||||
init.RecoveryKeysHex = make([]string, len(resp.RecoveryKeys))
|
||||
for i, v := range resp.RecoveryKeys {
|
||||
|
||||
Reference in New Issue
Block a user