fixed security bugfix #4941 , process auth failed

This commit is contained in:
jianghang.loujh
2023-12-22 10:29:38 +08:00
parent 93dac2d335
commit 67e0928d80
2 changed files with 4 additions and 2 deletions

View File

@@ -56,12 +56,14 @@ public class ClientAuthenticationHandler extends SimpleChannelHandler {
byte[] errorBytes = NettyUtils.errorPacket(400,
MessageFormatter.format("auth failed for seed is null", clientAuth.getUsername()).getMessage());
NettyUtils.write(ctx.getChannel(), errorBytes, null);
break;
}
if (!embeddedServer.auth(clientAuth.getUsername(), clientAuth.getPassword().toStringUtf8(), seed)) {
byte[] errorBytes = NettyUtils.errorPacket(400,
MessageFormatter.format("auth failed for user:{}", clientAuth.getUsername()).getMessage());
NettyUtils.write(ctx.getChannel(), errorBytes, null);
break;
}
// 如果存在订阅信息