status-go/_assets/patches/geth/0013-whisperv6-notifications-envelopeversion.patch

37 lines
1.2 KiB
Diff

diff --git a/whisper/notifications/utils.go b/whisper/notifications/utils.go
index 106752186..cca3fba71 100644
--- a/whisper/notifications/utils.go
+++ b/whisper/notifications/utils.go
@@ -1,11 +1,12 @@
package notifications
import (
+ "crypto/sha256"
"crypto/sha512"
"errors"
- "crypto/sha256"
crand "crypto/rand"
+
whisper "github.com/ethereum/go-ethereum/whisper/whisperv5"
"golang.org/x/crypto/pbkdf2"
)
@@ -24,7 +25,7 @@ func makeSessionKey() ([]byte, error) {
}
key := buf[:keyLen]
- derived, err := deriveKeyMaterial(key, whisper.EnvelopeVersion)
+ derived, err := deriveKeyMaterial(key, whisper.ProtocolVersion)
if err != nil {
return nil, err
} else if !validateSymmetricKey(derived) {
@@ -63,7 +64,7 @@ func deriveKeyMaterial(key []byte, version uint64) (derivedKey []byte, err error
}
// MakeTopic returns Whisper topic *as bytes array* by generating cryptographic key from the provided password
-func MakeTopicAsBytes(password []byte) ([]byte) {
+func MakeTopicAsBytes(password []byte) []byte {
topic := make([]byte, int(whisper.TopicLength))
x := pbkdf2.Key(password, password, 8196, 128, sha512.New)
for i := 0; i < len(x); i++ {