Skip to content

Commit bd7d90a

Browse files
authored
Merge pull request #29 from mcsaucy/push-ouzlzrluppol
Use the correct form of `sha256.Sum224`.
2 parents edd419d + f416b1b commit bd7d90a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

internal/encryption/aes.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ func Decrypt(data, password []byte) ([]byte, error) {
5656
func deriveKey(password []byte) []byte {
5757
buf := make([]byte, 32) // Will use AES-256
5858

59-
copy(buf, sha256.New224().Sum(password)) // Fill the rest of the hash with zeros (SHA-224 leads to a 28 byte long hash)
59+
h := sha256.Sum224(password)
60+
copy(buf, h[:]) // Fill the rest of the hash with zeros (SHA-224 leads to a 28 byte long hash)
6061

6162
return buf
6263
}

0 commit comments

Comments
 (0)