Дополнительные проверки безопасности

This commit is contained in:
Gravit 2018-11-06 19:07:15 +07:00
parent d65a60e61d
commit 72701e0775
No known key found for this signature in database
GPG key ID: 061981E1E85D3216
2 changed files with 5 additions and 1 deletions

View file

@ -71,6 +71,10 @@ public void reply() throws Exception {
AuthProvider.authError(server.config.authRejectString);
return;
}
if(!clientData.checkSign)
{
throw new AuthException("You must using checkLauncher");
}
result = provider.auth(login, password, ip);
if (!VerifyHelper.isValidUsername(result.username)) {
AuthProvider.authError(String.format("Illegal result: '%s'", result.username));

View file

@ -38,7 +38,7 @@ public void reply() throws IOException {
return;
}
Client clientData = server.sessionManager.getClient(session);
if(!clientData.isAuth || clientData.type != Client.Type.USER) { requestError("Assess denied"); return;}
if(!clientData.isAuth || clientData.type != Client.Type.USER || clientData.profile == null) { requestError("Assess denied"); return;}
for(SignedObjectHolder<ClientProfile> p : server.getProfiles())
{
ClientProfile profile = p.object;