1
0
mirror of https://github.com/moparisthebest/xAuth synced 2024-12-22 07:08:51 -05:00

1. Increased salt length to 12

2. Fixed target-related message replacement
3. Added two new message replacement variables
This commit is contained in:
Zach Iverson 2011-06-19 04:42:33 -04:00
parent e2983c79da
commit 341623d5e1
3 changed files with 6 additions and 4 deletions

View File

@ -152,7 +152,7 @@ public class Util {
w.NESSIEinit();
w.NESSIEadd(UUID.randomUUID().toString());
w.NESSIEfinalize(digest);
String salt = Whirlpool.display(digest).substring(0, 8);
String salt = Whirlpool.display(digest).substring(0, 12);
w.NESSIEinit();
w.NESSIEadd(salt + pass);

View File

@ -242,7 +242,7 @@ public class xAuth extends JavaPlugin {
int saltPos = (checkPass.length() >= realPass.length() ? realPass.length() : checkPass.length());
// extract salt
String salt = realPass.substring(saltPos, saltPos + 8);
String salt = realPass.substring(saltPos, saltPos + 12);
// encrypt salt + checkPass
Whirlpool w = new Whirlpool();

View File

@ -236,12 +236,14 @@ public class xAuthMessages {
// target
if (target != null) {
message = message.replace("{TARGET}", player.getName());
message = message.replace("{TARGETIP}", Util.getHostFromPlayer(player));
message = message.replace("{TARGET}", target.getName());
message = message.replace("{TARGETIP}", Util.getHostFromPlayer(target));
}
// settings
message = message.replace("{PWMINLENGTH}", Integer.toString(xAuthSettings.pwMinLength));
message = message.replace("{NAMEMINLENGTH}", Integer.toString(xAuthSettings.filterMinLength));
message = message.replace("{MAXSTRIKES}", Integer.toString(xAuthSettings.maxStrikes));
// misc
message = message.replace("{NEWLINE}", "\n");