mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 01:13:45 +00:00
whisper: minor update
This commit is contained in:
parent
aa1a72fae4
commit
70f1dd9666
2 changed files with 8 additions and 2 deletions
|
|
@ -465,6 +465,6 @@ func TestAesNonce(t *testing.T) {
|
|||
// This is the most important single test in this package.
|
||||
// If it fails, whisper will not be working.
|
||||
if aesgcm.NonceSize() != aesNonceLength {
|
||||
t.Fatalf("Nonce size is wrong. This is a critical error. Apparently AES nonce size have changed in the new version of AES GCM package. Whisper will not be working untill this problem is resolved.")
|
||||
t.Fatalf("Nonce size is wrong. This is a critical error. Apparently AES nonce size have changed in the new version of AES GCM package. Whisper will not be working until this problem is resolved.")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -984,7 +984,13 @@ func validatePrivateKey(k *ecdsa.PrivateKey) bool {
|
|||
// validateSymmetricKey returns false if the key contains all zeros,
|
||||
// which is a simplest and the most common bug.
|
||||
func validateRandomData(k []byte, expectedSize int) bool {
|
||||
return len(k) == expectedSize && !containsOnlyZeros(k)
|
||||
if len(k) != expectedSize {
|
||||
return false
|
||||
}
|
||||
if expectedSize > 4 && containsOnlyZeros(k) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// containsOnlyZeros checks if the data contain only zeros.
|
||||
|
|
|
|||
Loading…
Reference in a new issue