2023-06-30 09:54:08 +00:00
|
|
|
package payload
|
|
|
|
|
|
|
|
import (
|
|
|
|
"go.mau.fi/mautrix-gmessages/libgm/binary"
|
|
|
|
"go.mau.fi/mautrix-gmessages/libgm/util"
|
|
|
|
)
|
|
|
|
|
2023-07-09 11:16:52 +00:00
|
|
|
func GetWebEncryptionKey(WebPairKey []byte) ([]byte, *binary.AuthenticationContainer, error) {
|
2023-06-30 09:54:08 +00:00
|
|
|
id := util.RandomUUIDv4()
|
2023-07-09 11:16:52 +00:00
|
|
|
payload := &binary.AuthenticationContainer{
|
|
|
|
AuthMessage: &binary.AuthenticationMessage{
|
|
|
|
RequestID: id,
|
|
|
|
TachyonAuthToken: WebPairKey,
|
|
|
|
ConfigVersion: ConfigMessage,
|
2023-06-30 09:54:08 +00:00
|
|
|
},
|
|
|
|
}
|
|
|
|
encodedPayload, err2 := binary.EncodeProtoMessage(payload)
|
|
|
|
if err2 != nil {
|
|
|
|
return nil, payload, err2
|
|
|
|
}
|
|
|
|
return encodedPayload, payload, nil
|
|
|
|
}
|