Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cancel the execution of the method validateSnapshotMAC #519

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions appstate.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import (
"fmt"
"time"

"go.mau.fi/whatsmeow/appstate"
waBinary "go.mau.fi/whatsmeow/binary"
waProto "go.mau.fi/whatsmeow/binary/proto"
"go.mau.fi/whatsmeow/store"
"go.mau.fi/whatsmeow/types"
"go.mau.fi/whatsmeow/types/events"
"github.com/matias-carpintini/whatsmeow/appstate"
waBinary "github.com/matias-carpintini/whatsmeow/binary"
waProto "github.com/matias-carpintini/whatsmeow/binary/proto"
"github.com/matias-carpintini/whatsmeow/store"
"github.com/matias-carpintini/whatsmeow/types"
"github.com/matias-carpintini/whatsmeow/types/events"
)

// FetchAppState fetches updates to the given type of app state. If fullSync is true, the current
Expand Down Expand Up @@ -54,7 +54,7 @@ func (cli *Client) FetchAppState(name appstate.WAPatchName, fullSync, onlyIfNotS
}
hasMore = patches.HasMorePatches

mutations, newState, err := cli.appStateProc.DecodePatches(patches, state, true)
mutations, newState, err := cli.appStateProc.DecodePatches(patches, state, false)
if err != nil {
if errors.Is(err, appstate.ErrKeyNotFound) {
go cli.requestMissingAppStateKeys(context.TODO(), patches)
Expand Down
8 changes: 4 additions & 4 deletions appstate/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import (

"google.golang.org/protobuf/proto"

waBinary "go.mau.fi/whatsmeow/binary"
waProto "go.mau.fi/whatsmeow/binary/proto"
"go.mau.fi/whatsmeow/store"
"go.mau.fi/whatsmeow/util/cbcutil"
waBinary "github.com/matias-carpintini/whatsmeow/binary"
waProto "github.com/matias-carpintini/whatsmeow/binary/proto"
"github.com/matias-carpintini/whatsmeow/store"
"github.com/matias-carpintini/whatsmeow/util/cbcutil"
)

// PatchList represents a decoded response to getting app state patches from the WhatsApp servers.
Expand Down
6 changes: 3 additions & 3 deletions appstate/encode.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (

"google.golang.org/protobuf/proto"

waProto "go.mau.fi/whatsmeow/binary/proto"
"go.mau.fi/whatsmeow/types"
"go.mau.fi/whatsmeow/util/cbcutil"
waProto "github.com/matias-carpintini/whatsmeow/binary/proto"
"github.com/matias-carpintini/whatsmeow/types"
"github.com/matias-carpintini/whatsmeow/util/cbcutil"
)

// MutationInfo contains information about a single mutation to the app state.
Expand Down
4 changes: 2 additions & 2 deletions appstate/hash.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"fmt"
"hash"

"go.mau.fi/whatsmeow/appstate/lthash"
waProto "go.mau.fi/whatsmeow/binary/proto"
"github.com/matias-carpintini/whatsmeow/appstate/lthash"
waProto "github.com/matias-carpintini/whatsmeow/binary/proto"
)

type Mutation struct {
Expand Down
6 changes: 3 additions & 3 deletions appstate/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
"encoding/base64"
"sync"

"go.mau.fi/whatsmeow/store"
"go.mau.fi/whatsmeow/util/hkdfutil"
waLog "go.mau.fi/whatsmeow/util/log"
"github.com/matias-carpintini/whatsmeow/store"
"github.com/matias-carpintini/whatsmeow/util/hkdfutil"
waLog "github.com/matias-carpintini/whatsmeow/util/log"
)

// WAPatchName represents a type of app state patch.
Expand Down
2 changes: 1 addition & 1 deletion appstate/lthash/lthash.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ package lthash
import (
"encoding/binary"

"go.mau.fi/whatsmeow/util/hkdfutil"
"github.com/matias-carpintini/whatsmeow/util/hkdfutil"
)

type LTHash struct {
Expand Down
2 changes: 1 addition & 1 deletion binary/attrs.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"strconv"
"time"

"go.mau.fi/whatsmeow/types"
"github.com/matias-carpintini/whatsmeow/types"
)

// AttrUtility is a helper struct for reading multiple XML attributes and checking for errors afterwards.
Expand Down
4 changes: 2 additions & 2 deletions binary/decoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"io"
"strings"

"go.mau.fi/whatsmeow/binary/token"
"go.mau.fi/whatsmeow/types"
"github.com/matias-carpintini/whatsmeow/binary/token"
"github.com/matias-carpintini/whatsmeow/types"
)

type binaryDecoder struct {
Expand Down
4 changes: 2 additions & 2 deletions binary/encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"math"
"strconv"

"go.mau.fi/whatsmeow/binary/token"
"go.mau.fi/whatsmeow/types"
"github.com/matias-carpintini/whatsmeow/binary/token"
"github.com/matias-carpintini/whatsmeow/types"
)

type binaryEncoder struct {
Expand Down
2 changes: 1 addition & 1 deletion binary/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"encoding/json"
"fmt"

"go.mau.fi/whatsmeow/types"
"github.com/matias-carpintini/whatsmeow/types"
)

// Attrs is a type alias for the attributes of an XML element (Node).
Expand Down
4 changes: 2 additions & 2 deletions broadcast.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"errors"
"fmt"

waBinary "go.mau.fi/whatsmeow/binary"
"go.mau.fi/whatsmeow/types"
waBinary "github.com/matias-carpintini/whatsmeow/binary"
"github.com/matias-carpintini/whatsmeow/types"
)

func (cli *Client) getBroadcastListParticipants(jid types.JID) ([]types.JID, error) {
Expand Down
6 changes: 3 additions & 3 deletions call.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
package whatsmeow

import (
waBinary "go.mau.fi/whatsmeow/binary"
"go.mau.fi/whatsmeow/types"
"go.mau.fi/whatsmeow/types/events"
waBinary "github.com/matias-carpintini/whatsmeow/binary"
"github.com/matias-carpintini/whatsmeow/types"
"github.com/matias-carpintini/whatsmeow/types/events"
)

func (cli *Client) handleCallEvent(node *waBinary.Node) {
Expand Down
18 changes: 9 additions & 9 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ import (

"go.mau.fi/util/random"

"go.mau.fi/whatsmeow/appstate"
waBinary "go.mau.fi/whatsmeow/binary"
waProto "go.mau.fi/whatsmeow/binary/proto"
"go.mau.fi/whatsmeow/socket"
"go.mau.fi/whatsmeow/store"
"go.mau.fi/whatsmeow/types"
"go.mau.fi/whatsmeow/types/events"
"go.mau.fi/whatsmeow/util/keys"
waLog "go.mau.fi/whatsmeow/util/log"
"github.com/matias-carpintini/whatsmeow/appstate"
waBinary "github.com/matias-carpintini/whatsmeow/binary"
waProto "github.com/matias-carpintini/whatsmeow/binary/proto"
"github.com/matias-carpintini/whatsmeow/socket"
"github.com/matias-carpintini/whatsmeow/store"
"github.com/matias-carpintini/whatsmeow/types"
"github.com/matias-carpintini/whatsmeow/types/events"
"github.com/matias-carpintini/whatsmeow/util/keys"
waLog "github.com/matias-carpintini/whatsmeow/util/log"
)

// EventHandler is a function that can handle events from WhatsApp.
Expand Down
6 changes: 3 additions & 3 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import (
"os/signal"
"syscall"

"github.com/matias-carpintini/whatsmeow/store/sqlstore"
"github.com/matias-carpintini/whatsmeow/types/events"
waLog "github.com/matias-carpintini/whatsmeow/util/log"
"go.mau.fi/whatsmeow"
"go.mau.fi/whatsmeow/store/sqlstore"
"go.mau.fi/whatsmeow/types/events"
waLog "go.mau.fi/whatsmeow/util/log"
)

func eventHandler(evt interface{}) {
Expand Down
8 changes: 4 additions & 4 deletions connectionevents.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"sync/atomic"
"time"

waBinary "go.mau.fi/whatsmeow/binary"
"go.mau.fi/whatsmeow/store"
"go.mau.fi/whatsmeow/types"
"go.mau.fi/whatsmeow/types/events"
waBinary "github.com/matias-carpintini/whatsmeow/binary"
"github.com/matias-carpintini/whatsmeow/store"
"github.com/matias-carpintini/whatsmeow/types"
"github.com/matias-carpintini/whatsmeow/types/events"
)

func (cli *Client) handleStreamError(node *waBinary.Node) {
Expand Down
8 changes: 4 additions & 4 deletions download.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import (
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/reflect/protoreflect"

waProto "go.mau.fi/whatsmeow/binary/proto"
"go.mau.fi/whatsmeow/socket"
"go.mau.fi/whatsmeow/util/cbcutil"
"go.mau.fi/whatsmeow/util/hkdfutil"
waProto "github.com/matias-carpintini/whatsmeow/binary/proto"
"github.com/matias-carpintini/whatsmeow/socket"
"github.com/matias-carpintini/whatsmeow/util/cbcutil"
"github.com/matias-carpintini/whatsmeow/util/hkdfutil"
)

// MediaType represents a type of uploaded file on WhatsApp.
Expand Down
2 changes: 1 addition & 1 deletion errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"fmt"
"net/http"

waBinary "go.mau.fi/whatsmeow/binary"
waBinary "github.com/matias-carpintini/whatsmeow/binary"
)

// Miscellaneous errors
Expand Down
14 changes: 9 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
module go.mau.fi/whatsmeow
module github.com/matias-carpintini/whatsmeow

go 1.20

require (
github.com/gorilla/websocket v1.5.0
github.com/gorilla/websocket v1.5.1
go.mau.fi/libsignal v0.1.0
go.mau.fi/util v0.2.0
golang.org/x/crypto v0.15.0
go.mau.fi/util v0.2.1
go.mau.fi/whatsmeow v0.0.0-20231216213200-9d803dd92735
golang.org/x/crypto v0.17.0
google.golang.org/protobuf v1.31.0
)

require filippo.io/edwards25519 v1.0.0 // indirect
require (
filippo.io/edwards25519 v1.1.0 // indirect
golang.org/x/net v0.19.0 // indirect
)
20 changes: 12 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek=
filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns=
filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
go.mau.fi/libsignal v0.1.0 h1:vAKI/nJ5tMhdzke4cTK1fb0idJzz1JuEIpmjprueC+c=
go.mau.fi/libsignal v0.1.0/go.mod h1:R8ovrTezxtUNzCQE5PH30StOQWWeBskBsWE55vMfY9I=
go.mau.fi/util v0.2.0 h1:AMGBEdg9Ya/smb/09dljo9wBwKr432EpfjDWF7aFQg0=
go.mau.fi/util v0.2.0/go.mod h1:AxuJUMCxpzgJ5eV9JbPWKRH8aAJJidxetNdUj7qcb84=
golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA=
golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g=
go.mau.fi/util v0.2.1 h1:eazulhFE/UmjOFtPrGg6zkF5YfAyiDzQb8ihLMbsPWw=
go.mau.fi/util v0.2.1/go.mod h1:MjlzCQEMzJ+G8RsPawHzpLB8rwTo3aPIjG5FzBvQT/c=
go.mau.fi/whatsmeow v0.0.0-20231216213200-9d803dd92735 h1:+teJYCOK6M4Kn2TYCj29levhHVwnJTmgCtEXLtgwQtM=
go.mau.fi/whatsmeow v0.0.0-20231216213200-9d803dd92735/go.mod h1:5xTtHNaZpGni6z6aE1iEopjW7wNgsKcolZxZrOujK9M=
golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k=
golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c=
golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
Expand Down
6 changes: 3 additions & 3 deletions group.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"fmt"
"strings"

waBinary "go.mau.fi/whatsmeow/binary"
"go.mau.fi/whatsmeow/types"
"go.mau.fi/whatsmeow/types/events"
waBinary "github.com/matias-carpintini/whatsmeow/binary"
"github.com/matias-carpintini/whatsmeow/types"
"github.com/matias-carpintini/whatsmeow/types/events"
)

const InviteLinkPrefix = "https://chat.whatsapp.com/"
Expand Down
6 changes: 3 additions & 3 deletions handshake.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (

"google.golang.org/protobuf/proto"

waProto "go.mau.fi/whatsmeow/binary/proto"
"go.mau.fi/whatsmeow/socket"
"go.mau.fi/whatsmeow/util/keys"
waProto "github.com/matias-carpintini/whatsmeow/binary/proto"
"github.com/matias-carpintini/whatsmeow/socket"
"github.com/matias-carpintini/whatsmeow/util/keys"
)

const NoiseHandshakeResponseTimeout = 20 * time.Second
Expand Down
4 changes: 2 additions & 2 deletions internals.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (

"go.mau.fi/libsignal/keys/prekey"

waBinary "go.mau.fi/whatsmeow/binary"
"go.mau.fi/whatsmeow/types"
waBinary "github.com/matias-carpintini/whatsmeow/binary"
"github.com/matias-carpintini/whatsmeow/types"
)

type DangerousInternalClient struct {
Expand Down
6 changes: 3 additions & 3 deletions keepalive.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
"math/rand"
"time"

waBinary "go.mau.fi/whatsmeow/binary"
"go.mau.fi/whatsmeow/types"
"go.mau.fi/whatsmeow/types/events"
waBinary "github.com/matias-carpintini/whatsmeow/binary"
"github.com/matias-carpintini/whatsmeow/types"
"github.com/matias-carpintini/whatsmeow/types/events"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion mdtest/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module go.mau.fi/whatsmeow/mdtest
module github.com/matias-carpintini/whatsmeow/mdtest

go 1.19

Expand Down
16 changes: 8 additions & 8 deletions mdtest/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ import (
"github.com/mdp/qrterminal/v3"
"google.golang.org/protobuf/proto"

"github.com/matias-carpintini/whatsmeow/appstate"
waBinary "github.com/matias-carpintini/whatsmeow/binary"
waProto "github.com/matias-carpintini/whatsmeow/binary/proto"
"github.com/matias-carpintini/whatsmeow/store"
"github.com/matias-carpintini/whatsmeow/store/sqlstore"
"github.com/matias-carpintini/whatsmeow/types"
"github.com/matias-carpintini/whatsmeow/types/events"
waLog "github.com/matias-carpintini/whatsmeow/util/log"
"go.mau.fi/whatsmeow"
"go.mau.fi/whatsmeow/appstate"
waBinary "go.mau.fi/whatsmeow/binary"
waProto "go.mau.fi/whatsmeow/binary/proto"
"go.mau.fi/whatsmeow/store"
"go.mau.fi/whatsmeow/store/sqlstore"
"go.mau.fi/whatsmeow/types"
"go.mau.fi/whatsmeow/types/events"
waLog "go.mau.fi/whatsmeow/util/log"
)

var cli *whatsmeow.Client
Expand Down
4 changes: 2 additions & 2 deletions mediaconn.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"fmt"
"time"

waBinary "go.mau.fi/whatsmeow/binary"
"go.mau.fi/whatsmeow/types"
waBinary "github.com/matias-carpintini/whatsmeow/binary"
"github.com/matias-carpintini/whatsmeow/types"
)

//type MediaConnIP struct {
Expand Down
12 changes: 6 additions & 6 deletions mediaretry.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ import (
"go.mau.fi/util/random"
"google.golang.org/protobuf/proto"

waBinary "go.mau.fi/whatsmeow/binary"
waProto "go.mau.fi/whatsmeow/binary/proto"
"go.mau.fi/whatsmeow/types"
"go.mau.fi/whatsmeow/types/events"
"go.mau.fi/whatsmeow/util/gcmutil"
"go.mau.fi/whatsmeow/util/hkdfutil"
waBinary "github.com/matias-carpintini/whatsmeow/binary"
waProto "github.com/matias-carpintini/whatsmeow/binary/proto"
"github.com/matias-carpintini/whatsmeow/types"
"github.com/matias-carpintini/whatsmeow/types/events"
"github.com/matias-carpintini/whatsmeow/util/gcmutil"
"github.com/matias-carpintini/whatsmeow/util/hkdfutil"
)

func getMediaRetryKey(mediaKey []byte) (cipherKey []byte) {
Expand Down
Loading