mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-07 20:45:53 +08:00
update new type.
This commit is contained in:
parent
916d230456
commit
7721ebdde8
@ -1055,7 +1055,7 @@ func (c *QQClient) netLoop() {
|
||||
}
|
||||
payload := pkt.Payload
|
||||
if pkt.Flag2 == 2 {
|
||||
payload, err = pkt.DecryptPayload(c.RandomKey)
|
||||
payload, err = pkt.DecryptPayload(c.RandomKey, c.sigInfo.wtSessionTicketKey)
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
|
@ -166,7 +166,7 @@ func parseSsoFrame(payload []byte, flag2 byte) (*IncomingPacket, error) {
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (pkt *IncomingPacket) DecryptPayload(random []byte) ([]byte, error) {
|
||||
func (pkt *IncomingPacket) DecryptPayload(random, sessionKey []byte) ([]byte, error) {
|
||||
reader := binary.NewReader(pkt.Payload)
|
||||
if reader.ReadByte() != 2 {
|
||||
return nil, ErrUnknownFlag
|
||||
@ -193,6 +193,12 @@ func (pkt *IncomingPacket) DecryptPayload(random []byte) ([]byte, error) {
|
||||
}()
|
||||
return data, nil
|
||||
}
|
||||
if encryptType == 3 {
|
||||
return func() []byte {
|
||||
d := reader.ReadBytes(reader.Len() - 1)
|
||||
return binary.NewTeaCipher(sessionKey).Decrypt(d)
|
||||
}(), nil
|
||||
}
|
||||
if encryptType == 4 {
|
||||
panic("todo")
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user