mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-02 23:47:07 -05:00
fix aes cfb decode packet. fix #739
This commit is contained in:
parent
fefb5c8e01
commit
eef2a72ac0
@ -142,7 +142,7 @@ func (v *AesCfb) EncodePacket(key []byte, b *buf.Buffer) error {
|
|||||||
|
|
||||||
func (v *AesCfb) DecodePacket(key []byte, b *buf.Buffer) error {
|
func (v *AesCfb) DecodePacket(key []byte, b *buf.Buffer) error {
|
||||||
iv := b.BytesTo(v.IVSize())
|
iv := b.BytesTo(v.IVSize())
|
||||||
stream := crypto.NewAesEncryptionStream(key, iv)
|
stream := crypto.NewAesDecryptionStream(key, iv)
|
||||||
stream.XORKeyStream(b.BytesFrom(v.IVSize()), b.BytesFrom(v.IVSize()))
|
stream.XORKeyStream(b.BytesFrom(v.IVSize()), b.BytesFrom(v.IVSize()))
|
||||||
b.SliceFrom(v.IVSize())
|
b.SliceFrom(v.IVSize())
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user