mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-08 21:15:57 +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
|
payload := pkt.Payload
|
||||||
if pkt.Flag2 == 2 {
|
if pkt.Flag2 == 2 {
|
||||||
payload, err = pkt.DecryptPayload(c.RandomKey)
|
payload, err = pkt.DecryptPayload(c.RandomKey, c.sigInfo.wtSessionTicketKey)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -166,7 +166,7 @@ func parseSsoFrame(payload []byte, flag2 byte) (*IncomingPacket, error) {
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (pkt *IncomingPacket) DecryptPayload(random []byte) ([]byte, error) {
|
func (pkt *IncomingPacket) DecryptPayload(random, sessionKey []byte) ([]byte, error) {
|
||||||
reader := binary.NewReader(pkt.Payload)
|
reader := binary.NewReader(pkt.Payload)
|
||||||
if reader.ReadByte() != 2 {
|
if reader.ReadByte() != 2 {
|
||||||
return nil, ErrUnknownFlag
|
return nil, ErrUnknownFlag
|
||||||
@ -193,6 +193,12 @@ func (pkt *IncomingPacket) DecryptPayload(random []byte) ([]byte, error) {
|
|||||||
}()
|
}()
|
||||||
return data, nil
|
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 {
|
if encryptType == 4 {
|
||||||
panic("todo")
|
panic("todo")
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user