diff --git a/src/LoginPacket.php b/src/LoginPacket.php index 707571f9..e33cff8f 100644 --- a/src/LoginPacket.php +++ b/src/LoginPacket.php @@ -72,6 +72,10 @@ protected function decodeConnectionRequest(string $binary) : void{ if(!is_array($chainDataJson["chain"])){ throw new PacketDecodeException("Chain data 'chain' element must be a list of strings"); } + if(count($chainDataJson["chain"]) !== 3) { + throw new PacketDecodeException("Chain data 'chain' must contain three jwt"); + } + $jwts = []; foreach($chainDataJson["chain"] as $jwt){ if(!is_string($jwt)){