mirror of
https://github.com/grafana/grafana.git
synced 2025-02-14 17:43:35 -06:00
instead of padding with 0's, cycle through the secret.
This commit is contained in:
parent
40d946a6e3
commit
092bb69c41
@ -60,11 +60,7 @@ func encryptionKeyToBytes(secret string) []byte {
|
||||
keyBytes := []byte(secret)
|
||||
secretLength := len(keyBytes)
|
||||
for i := 0; i < 32; i++ {
|
||||
if secretLength > i {
|
||||
key[i] = keyBytes[i]
|
||||
} else {
|
||||
key[i] = 0
|
||||
}
|
||||
key[i] = keyBytes[i%secretLength]
|
||||
}
|
||||
return key
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user