diff options
author | gluk256 <gluk256@users.noreply.github.com> | 2018-01-30 16:55:08 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2018-01-30 16:55:08 +0800 |
commit | a9e4a90d57d3c072fb727ee62b71002325e23934 (patch) | |
tree | 45b0cd4885ebfb562fe0dbeb8b8b9d6859875401 /whisper/whisperv6/whisper_test.go | |
parent | 59a852e4188e18e587b6d54f646a6780f4d1f12c (diff) | |
download | dexon-a9e4a90d57d3c072fb727ee62b71002325e23934.tar dexon-a9e4a90d57d3c072fb727ee62b71002325e23934.tar.gz dexon-a9e4a90d57d3c072fb727ee62b71002325e23934.tar.bz2 dexon-a9e4a90d57d3c072fb727ee62b71002325e23934.tar.lz dexon-a9e4a90d57d3c072fb727ee62b71002325e23934.tar.xz dexon-a9e4a90d57d3c072fb727ee62b71002325e23934.tar.zst dexon-a9e4a90d57d3c072fb727ee62b71002325e23934.zip |
whisper: change the whisper message format so as to add the payload size (#15870)
* whisper: message format changed
* whisper: tests fixed
* whisper: style fixes
* whisper: fixed names, fixed failing tests
* whisper: fix merge issue in #15870
Occured while using the github online merge tool. Lesson learned.
* whisper: fix a gofmt error for #15870
Diffstat (limited to 'whisper/whisperv6/whisper_test.go')
-rw-r--r-- | whisper/whisperv6/whisper_test.go | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/whisper/whisperv6/whisper_test.go b/whisper/whisperv6/whisper_test.go index 23a289bfe..838cb7b85 100644 --- a/whisper/whisperv6/whisper_test.go +++ b/whisper/whisperv6/whisper_test.go @@ -81,7 +81,7 @@ func TestWhisperBasic(t *testing.T) { } derived := pbkdf2.Key([]byte(peerID), nil, 65356, aesKeyLength, sha256.New) - if !validateSymmetricKey(derived) { + if !validateDataIntegrity(derived, aesKeyLength) { t.Fatalf("failed validateSymmetricKey with param = %v.", derived) } if containsOnlyZeros(derived) { @@ -448,24 +448,12 @@ func TestWhisperSymKeyManagement(t *testing.T) { if !w.HasSymKey(id2) { t.Fatalf("HasSymKey(id2) failed.") } - if k1 == nil { - t.Fatalf("k1 does not exist.") - } - if k2 == nil { - t.Fatalf("k2 does not exist.") + if !validateDataIntegrity(k2, aesKeyLength) { + t.Fatalf("key validation failed.") } if !bytes.Equal(k1, k2) { t.Fatalf("k1 != k2.") } - if len(k1) != aesKeyLength { - t.Fatalf("wrong length of k1.") - } - if len(k2) != aesKeyLength { - t.Fatalf("wrong length of k2.") - } - if !validateSymmetricKey(k2) { - t.Fatalf("key validation failed.") - } } func TestExpiry(t *testing.T) { |