diff --git a/services/shhext/chat/protocol.go b/services/shhext/chat/protocol.go index 38fc24208e..1b17277bed 100644 --- a/services/shhext/chat/protocol.go +++ b/services/shhext/chat/protocol.go @@ -204,8 +204,10 @@ func (p *ProtocolService) HandleMessage(myIdentityKey *ecdsa.PrivateKey, theirPu return nil, err } + p.log.Info("Checking version") // Handle protocol negotiation for compatible clients if protocolMessage.Version >= topicNegotiationVersion { + p.log.Info("Version greater than 1 negotianting") topic, err := p.topic.Receive(myIdentityKey, theirPublicKey, protocolMessage.GetInstallationId()) if err != nil { return nil, err diff --git a/services/shhext/chat/topic/service.go b/services/shhext/chat/topic/service.go index c71b3e6bc2..34e2df7f45 100644 --- a/services/shhext/chat/topic/service.go +++ b/services/shhext/chat/topic/service.go @@ -4,6 +4,7 @@ import ( "crypto/ecdsa" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto/ecies" + "github.com/ethereum/go-ethereum/log" ) const sskLen = 16 @@ -18,6 +19,7 @@ func NewService(persistence PersistenceService) *Service { // Receive will generate a shared secret for a given identity, and return it func (s *Service) Receive(myPrivateKey *ecdsa.PrivateKey, theirPublicKey *ecdsa.PublicKey, installationID string) ([]byte, error) { + log.Info("Receive called for", "installationID", installationID) sharedKey, err := ecies.ImportECDSA(myPrivateKey).GenerateShared( ecies.ImportECDSAPublic(theirPublicKey), sskLen, diff --git a/services/shhext/service.go b/services/shhext/service.go index c41eb88173..1def7325f5 100644 --- a/services/shhext/service.go +++ b/services/shhext/service.go @@ -11,6 +11,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/p2p/enode" @@ -322,6 +323,7 @@ func (s *Service) GetSymKeyID(sharedSecret []byte) string { func (s *Service) onNewTopicHandler(sharedSecrets [][]byte) { var filterIDs []string + log.Info("NEW TOPIC HANDLER", "secrets", sharedSecrets) for _, sharedSecret := range sharedSecrets { secretID := fmt.Sprintf("%x", crypto.Keccak256(sharedSecret)) if _, ok := s.filtersAdded[secretID]; ok { @@ -335,6 +337,7 @@ func (s *Service) onNewTopicHandler(sharedSecrets [][]byte) { } symKeyID, err := api.AddSymKey(context.TODO(), sharedSecret) if err != nil { + log.Error("SYM KEYN FAILED", "err", err) return } @@ -345,6 +348,7 @@ func (s *Service) onNewTopicHandler(sharedSecrets [][]byte) { } filterID, err := api.NewMessageFilter(criteria) if err != nil { + log.Error("FILTER FAILED", "err", err) return } @@ -352,6 +356,7 @@ func (s *Service) onNewTopicHandler(sharedSecrets [][]byte) { s.filtersAdded[secretID] = symKeyID } + log.Info("FILTER IDS", "filter", filterIDs) if len(filterIDs) != 0 { handler := EnvelopeSignalHandler{} handler.WhisperFilterAdded(filterIDs)