s3: Fix input check in is_encrypted_packet