mirror of
https://github.com/hashicorp/vault.git
synced 2026-06-09 08:55:13 -04:00
Merge pull request #1872 from hashicorp/transit-uuid-generate
Use uuid.GenerateRandomBytes
This commit is contained in:
commit
19a98d4e2d
1 changed files with 1 additions and 5 deletions
|
|
@ -4,7 +4,6 @@ import (
|
|||
"bytes"
|
||||
"crypto/aes"
|
||||
"crypto/cipher"
|
||||
"crypto/rand"
|
||||
"crypto/sha256"
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
|
|
@ -529,8 +528,7 @@ func (p *policy) rotate(storage logical.Storage) error {
|
|||
}
|
||||
|
||||
// Generate a 256bit key
|
||||
newKey := make([]byte, 32)
|
||||
_, err := rand.Read(newKey)
|
||||
newKey, err := uuid.GenerateRandomBytes(32)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
@ -549,8 +547,6 @@ func (p *policy) rotate(storage logical.Storage) error {
|
|||
p.MinDecryptionVersion = 1
|
||||
}
|
||||
|
||||
//fmt.Printf("policy %s rotated to %d\n", p.Name, p.LatestVersion)
|
||||
|
||||
return p.Persist(storage)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue