From 56e7bd01ca09ad52b0c4f48f146a20a4f1b78696 Mon Sep 17 00:00:00 2001 From: Wim Date: Sat, 5 Aug 2023 20:43:19 +0200 Subject: Update dependencies and remove old matterclient lib (#2067) --- vendor/go.mau.fi/whatsmeow/mediaretry.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'vendor/go.mau.fi/whatsmeow/mediaretry.go') diff --git a/vendor/go.mau.fi/whatsmeow/mediaretry.go b/vendor/go.mau.fi/whatsmeow/mediaretry.go index 167df5f2..dfbffe26 100644 --- a/vendor/go.mau.fi/whatsmeow/mediaretry.go +++ b/vendor/go.mau.fi/whatsmeow/mediaretry.go @@ -7,7 +7,6 @@ package whatsmeow import ( - "crypto/rand" "fmt" "google.golang.org/protobuf/proto" @@ -18,6 +17,7 @@ import ( "go.mau.fi/whatsmeow/types/events" "go.mau.fi/whatsmeow/util/gcmutil" "go.mau.fi/whatsmeow/util/hkdfutil" + "go.mau.fi/whatsmeow/util/randbytes" ) func getMediaRetryKey(mediaKey []byte) (cipherKey []byte) { @@ -34,11 +34,7 @@ func encryptMediaRetryReceipt(messageID types.MessageID, mediaKey []byte) (ciphe err = fmt.Errorf("failed to marshal payload: %w", err) return } - iv = make([]byte, 12) - _, err = rand.Read(iv) - if err != nil { - panic(err) - } + iv = randbytes.Make(12) ciphertext, err = gcmutil.Encrypt(getMediaRetryKey(mediaKey), iv, plaintext, []byte(messageID)) return } -- cgit v1.2.3