mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-26 20:16:55 -05:00
Fix incorrect IV usage which slightly reduced security
This commit is contained in:
parent
86614773d9
commit
e2e266114a
@ -71,7 +71,7 @@ func NewClientSession(idHash protocol.IDHash, ctx context.Context) *ClientSessio
|
|||||||
} else {
|
} else {
|
||||||
BodyKey := sha256.Sum256(session.requestBodyKey[:])
|
BodyKey := sha256.Sum256(session.requestBodyKey[:])
|
||||||
copy(session.responseBodyKey[:], BodyKey[:16])
|
copy(session.responseBodyKey[:], BodyKey[:16])
|
||||||
BodyIV := sha256.Sum256(session.requestBodyKey[:])
|
BodyIV := sha256.Sum256(session.requestBodyIV[:])
|
||||||
copy(session.responseBodyIV[:], BodyIV[:16])
|
copy(session.responseBodyIV[:], BodyIV[:16])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -374,7 +374,7 @@ func (s *ServerSession) EncodeResponseHeader(header *protocol.ResponseHeader, wr
|
|||||||
} else {
|
} else {
|
||||||
BodyKey := sha256.Sum256(s.requestBodyKey[:])
|
BodyKey := sha256.Sum256(s.requestBodyKey[:])
|
||||||
copy(s.responseBodyKey[:], BodyKey[:16])
|
copy(s.responseBodyKey[:], BodyKey[:16])
|
||||||
BodyIV := sha256.Sum256(s.requestBodyKey[:])
|
BodyIV := sha256.Sum256(s.requestBodyIV[:])
|
||||||
copy(s.responseBodyIV[:], BodyIV[:16])
|
copy(s.responseBodyIV[:], BodyIV[:16])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user