Minor - rename EncryptedPassword to HashedPassword

- We hash passwords; we don't encrypt them
This commit is contained in:
ljacqu
2015-12-30 22:51:59 +01:00
parent e85dbe81e5
commit c0a393b8b3
41 changed files with 175 additions and 175 deletions
@@ -7,7 +7,7 @@ import fr.xephi.authme.command.CommandService;
import fr.xephi.authme.command.ExecutableCommand;
import fr.xephi.authme.datasource.DataSource;
import fr.xephi.authme.output.MessageKey;
import fr.xephi.authme.security.crypts.EncryptedPassword;
import fr.xephi.authme.security.crypts.HashedPassword;
import fr.xephi.authme.settings.Settings;
import org.bukkit.command.CommandSender;
@@ -67,9 +67,9 @@ public class ChangePasswordAdminCommand implements ExecutableCommand {
return;
}
EncryptedPassword encryptedPassword = commandService.getPasswordSecurity()
HashedPassword hashedPassword = commandService.getPasswordSecurity()
.computeHash(playerPass, playerNameLowerCase);
auth.setPassword(encryptedPassword);
auth.setPassword(hashedPassword);
if (!dataSource.updatePassword(auth)) {
commandService.send(sender, MessageKey.ERROR);
@@ -5,7 +5,7 @@ import fr.xephi.authme.cache.auth.PlayerAuth;
import fr.xephi.authme.command.CommandService;
import fr.xephi.authme.command.ExecutableCommand;
import fr.xephi.authme.output.MessageKey;
import fr.xephi.authme.security.crypts.EncryptedPassword;
import fr.xephi.authme.security.crypts.HashedPassword;
import fr.xephi.authme.settings.Settings;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
@@ -57,12 +57,12 @@ public class RegisterAdminCommand implements ExecutableCommand {
commandService.send(sender, MessageKey.NAME_ALREADY_REGISTERED);
return;
}
EncryptedPassword encryptedPassword = commandService.getPasswordSecurity()
HashedPassword hashedPassword = commandService.getPasswordSecurity()
.computeHash(playerPass, playerNameLowerCase);
PlayerAuth auth = PlayerAuth.builder()
.name(playerNameLowerCase)
.realName(playerName)
.password(encryptedPassword)
.password(hashedPassword)
.build();
if (!commandService.getDataSource().saveAuth(auth)) {
@@ -8,7 +8,7 @@ import fr.xephi.authme.command.PlayerCommand;
import fr.xephi.authme.datasource.DataSource;
import fr.xephi.authme.output.MessageKey;
import fr.xephi.authme.security.RandomString;
import fr.xephi.authme.security.crypts.EncryptedPassword;
import fr.xephi.authme.security.crypts.HashedPassword;
import fr.xephi.authme.settings.Settings;
import fr.xephi.authme.util.StringUtils;
import org.bukkit.entity.Player;
@@ -37,7 +37,7 @@ public class RecoverEmailCommand extends PlayerCommand {
}
String thePass = RandomString.generate(Settings.getRecoveryPassLength);
EncryptedPassword hashNew = commandService.getPasswordSecurity().computeHash(thePass, playerName);
HashedPassword hashNew = commandService.getPasswordSecurity().computeHash(thePass, playerName);
PlayerAuth auth;
if (PlayerCache.getInstance().isAuthenticated(playerName)) {
auth = PlayerCache.getInstance().getAuth(playerName);