instead of padding with 0's, cycle through the secret.

pull/3830/head
Anthony Woods 10 years ago
parent 40d946a6e3
commit 092bb69c41
  1. 6
      pkg/util/encryption.go

@ -60,11 +60,7 @@ func encryptionKeyToBytes(secret string) []byte {
keyBytes := []byte(secret) keyBytes := []byte(secret)
secretLength := len(keyBytes) secretLength := len(keyBytes)
for i := 0; i < 32; i++ { for i := 0; i < 32; i++ {
if secretLength > i { key[i] = keyBytes[i%secretLength]
key[i] = keyBytes[i]
} else {
key[i] = 0
}
} }
return key return key
} }

Loading…
Cancel
Save