diff --git a/_assets/patches/geth/0013-whisperv6-notifications-envelopeversion.patch b/_assets/patches/geth/0013-whisperv6-notifications-envelopeversion.patch new file mode 100644 index 000000000..dd2f2094f --- /dev/null +++ b/_assets/patches/geth/0013-whisperv6-notifications-envelopeversion.patch @@ -0,0 +1,36 @@ +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++ { diff --git a/_assets/patches/geth/0013-whisperv6-notifications.patch b/_assets/patches/geth/0014-whisperv6-notifications.patch similarity index 88% rename from _assets/patches/geth/0013-whisperv6-notifications.patch rename to _assets/patches/geth/0014-whisperv6-notifications.patch index 0b003097c..ffbc04b53 100644 --- a/_assets/patches/geth/0013-whisperv6-notifications.patch +++ b/_assets/patches/geth/0014-whisperv6-notifications.patch @@ -1,39 +1,3 @@ -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++ { diff --git a/whisper/whisperv6/api.go b/whisper/whisperv6/api.go index 8ae2882e1..7c97f0680 100644 --- a/whisper/whisperv6/api.go diff --git a/_assets/patches/geth/0014-whisperv6-envelopes-tracing.patch b/_assets/patches/geth/0015-whisperv6-envelopes-tracing.patch similarity index 100% rename from _assets/patches/geth/0014-whisperv6-envelopes-tracing.patch rename to _assets/patches/geth/0015-whisperv6-envelopes-tracing.patch diff --git a/_assets/patches/geth/README.md b/_assets/patches/geth/README.md index 72bcbe0fe..565a814ee 100644 --- a/_assets/patches/geth/README.md +++ b/_assets/patches/geth/README.md @@ -27,8 +27,9 @@ Instructions for creating a patch from the command line: - [`0009-whisper-envelopes-tracing.patch`](./0009-whisper-envelopes-tracing.patch) — adds Whisper envelope tracing (need to be reviewed and documented) - [`0010-geth-17-fix-npe-in-filter-system.patch`](./0010-geth-17-fix-npe-in-filter-system.patch) - Temp patch for 1.7.x to fix a NPE in the filter system. - [`0011-geth-17-whisperv6-70fbc87.patch`](./0011-geth-17-whisperv6-70fbc87.patch) - Temp patch for 1.7.x to update whisper v6 to the upstream version at the `70fbc87` SHA1. -- [`0013-whisperv6-notifications.patch`](./0013-whisperv6-notifications.patch) — adds Whisper v6 notifications (need to be reviewed and documented) -- [`0014-whisperv6-envelopes-tracing.patch`](./0014-whisperv6-envelopes-tracing.patch) — adds Whisper v6 envelope tracing (need to be reviewed and documented) +- [`0013-whisperv6-notifications-envelopeversion.patch`](./0013-whisperv6-notifications-envelopeversion.patch) — replaces usage of EnvelopeVersion with ProtocolVersion in notifications for Whisper v6 +- [`0014-whisperv6-notifications.patch`](./0014-whisperv6-notifications.patch) — adds Whisper v6 notifications (need to be reviewed and documented) +- [`0015-whisperv6-envelopes-tracing.patch`](./0015-whisperv6-envelopes-tracing.patch) — adds Whisper v6 envelope tracing (need to be reviewed and documented) # Updating upstream version