Browse Source

mKCP: Fix key derivation for obfuscation (#5106)

Fixes https://github.com/XTLS/Xray-core/issues/5096
风扇滑翔翼 1 month ago
parent
commit
2b82366148
1 changed files with 1 additions and 1 deletions
  1. 1 1
      transport/internet/kcp/cryptreal.go

+ 1 - 1
transport/internet/kcp/cryptreal.go

@@ -9,5 +9,5 @@ import (
 
 func NewAEADAESGCMBasedOnSeed(seed string) cipher.AEAD {
 	hashedSeed := sha256.Sum256([]byte(seed))
-	return crypto.NewAesGcm(hashedSeed[:])
+	return crypto.NewAesGcm(hashedSeed[:16])
 }