mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-21 14:10:35 +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...
|
// generateHeaderPadding...
|
||||||
// TODO(roasbeef): comments...
|
// TODO(roasbeef): comments...
|
||||||
func generateCipherStream(key [securityParameter]byte, numBytes uint) []byte {
|
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
|
// We use AES in CTR mode to generate a psuedo randmom stream of bytes
|
||||||
// by encrypting a plaintext of all zeroes.
|
// by encrypting a plaintext of all zeroes.
|
||||||
|
Reference in New Issue
Block a user