mirror of
https://github.com/hashicorp/vault.git
synced 2026-05-28 04:10:44 -04:00
cli/json: correctly output the number of key shares and threshold on stored keys (#5910)
This commit is contained in:
parent
e366aeb2e3
commit
7ac17d69c0
1 changed files with 9 additions and 2 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue