aboutsummaryrefslogtreecommitdiffstats
path: root/whisper/whisperv6/whisper_test.go
diff options
context:
space:
mode:
authorGuillaume Ballet <gballet@gmail.com>2017-12-08 23:08:56 +0800
committerFelix Lange <fjl@users.noreply.github.com>2017-12-08 23:08:56 +0800
commitbf62acf0332c962916787a23c78a2513137625ea (patch)
treeab615efc3a777eaa9463bb549395399aa619ccc2 /whisper/whisperv6/whisper_test.go
parent586198cceaf51435121b7e1166adf21910fee51a (diff)
downloaddexon-bf62acf0332c962916787a23c78a2513137625ea.tar
dexon-bf62acf0332c962916787a23c78a2513137625ea.tar.gz
dexon-bf62acf0332c962916787a23c78a2513137625ea.tar.bz2
dexon-bf62acf0332c962916787a23c78a2513137625ea.tar.lz
dexon-bf62acf0332c962916787a23c78a2513137625ea.tar.xz
dexon-bf62acf0332c962916787a23c78a2513137625ea.tar.zst
dexon-bf62acf0332c962916787a23c78a2513137625ea.zip
whisper/whisperv6: remove Version from the envelope (#15621)
Diffstat (limited to 'whisper/whisperv6/whisper_test.go')
-rw-r--r--whisper/whisperv6/whisper_test.go11
1 files changed, 3 insertions, 8 deletions
diff --git a/whisper/whisperv6/whisper_test.go b/whisper/whisperv6/whisper_test.go
index c7cea4014..aeb54b3ab 100644
--- a/whisper/whisperv6/whisper_test.go
+++ b/whisper/whisperv6/whisper_test.go
@@ -19,11 +19,13 @@ package whisperv6
import (
"bytes"
"crypto/ecdsa"
+ "crypto/sha256"
mrand "math/rand"
"testing"
"time"
"github.com/ethereum/go-ethereum/common"
+ "golang.org/x/crypto/pbkdf2"
)
func TestWhisperBasic(t *testing.T) {
@@ -79,14 +81,7 @@ func TestWhisperBasic(t *testing.T) {
}
var derived []byte
- ver := uint64(0xDEADBEEF)
- if _, err := deriveKeyMaterial(peerID, ver); err != unknownVersionError(ver) {
- t.Fatalf("failed deriveKeyMaterial with param = %v: %s.", peerID, err)
- }
- derived, err = deriveKeyMaterial(peerID, 0)
- if err != nil {
- t.Fatalf("failed second deriveKeyMaterial with param = %v: %s.", peerID, err)
- }
+ derived = pbkdf2.Key([]byte(peerID), nil, 65356, aesKeyLength, sha256.New)
if !validateSymmetricKey(derived) {
t.Fatalf("failed validateSymmetricKey with param = %v.", derived)
}