mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-18 19:41:21 +02:00
hack: restrict AES keySize to 16
* original security partaker was 16 so it didn’t matter. But it’s 20 now, so this is a quick hack/fix. In future should intelligently “round down”
This commit is contained in:
@@ -314,7 +314,8 @@ func generateKey(keyType string, sharedKey [sharedSecretSize]byte) [securityPara
|
||||
// generateHeaderPadding...
|
||||
// TODO(roasbeef): comments...
|
||||
func generateCipherStream(key [securityParameter]byte, numBytes uint) []byte {
|
||||
block, _ := aes.NewCipher(key[:])
|
||||
// Key must be 16, 24, or 32 bytes.
|
||||
block, _ := aes.NewCipher(key[:16])
|
||||
|
||||
// We use AES in CTR mode to generate a psuedo randmom stream of bytes
|
||||
// by encrypting a plaintext of all zeroes.
|
||||
|
Reference in New Issue
Block a user