Skip to content

Commit

Permalink
Use io.ReadFull
Browse files Browse the repository at this point in the history
  • Loading branch information
gagliardetto committed Jul 10, 2021
1 parent 544f6d1 commit 3282b0f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion vault/kmsgcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func (k *KMSGCPManager) setupEncryption() error {
return nil
}

_, err := rand.Read(k.localDEK[:])
_, err := io.ReadFull(rand.Reader, k.localDEK[:])
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion vault/passphrase.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func (b *PassphraseBoxer) Seal(in []byte) (string, error) {
}

salt := make([]byte, saltLength)
if _, err := crypto_rand.Read(salt); err != nil {
if _, err := io.ReadFull(crypto_rand.Reader, salt); err != nil {
return "", err
}
secretKey := deriveKey(b.passphrase, salt)
Expand Down

0 comments on commit 3282b0f

Please sign in to comment.