forked from TuxCoding/FastLogin
Use SecureRandom for passwords
This commit is contained in:
@@ -50,13 +50,14 @@ public class AuthStorage {
|
||||
config.setThreadFactory(platformThreadFactory);
|
||||
}
|
||||
|
||||
String pluginFolder = core.getPlugin().getPluginFolder().toAbsolutePath().toString();
|
||||
databasePath = databasePath.replace("{pluginDir}", pluginFolder);
|
||||
|
||||
String jdbcUrl = "jdbc:";
|
||||
if (driver.contains("sqlite")) {
|
||||
String pluginFolder = core.getPlugin().getPluginFolder().toAbsolutePath().toString();
|
||||
databasePath = databasePath.replace("{pluginDir}", pluginFolder);
|
||||
|
||||
jdbcUrl += "sqlite://" + databasePath;
|
||||
config.setConnectionTestQuery("SELECT 1");
|
||||
config.setMaximumPoolSize(1);
|
||||
} else {
|
||||
jdbcUrl += "mysql://" + host + ':' + port + '/' + databasePath;
|
||||
}
|
||||
|
||||
+3
-1
@@ -1,12 +1,14 @@
|
||||
package com.github.games647.fastlogin.core.hooks;
|
||||
|
||||
import java.security.SecureRandom;
|
||||
import java.util.Random;
|
||||
|
||||
public class DefaultPasswordGenerator<P> implements PasswordGenerator<P> {
|
||||
|
||||
private static final char[] PASSWORD_CHARACTERS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
|
||||
.toCharArray();
|
||||
private final Random random = new Random();
|
||||
|
||||
private final Random random = new SecureRandom();
|
||||
|
||||
@Override
|
||||
public String getRandomPassword(P player) {
|
||||
|
||||
@@ -4,7 +4,7 @@ public class SkinProperties {
|
||||
|
||||
public static final String TEXTURE_KEY = "textures";
|
||||
|
||||
private final String name = "textures";
|
||||
private final String name = TEXTURE_KEY;
|
||||
|
||||
private String value;
|
||||
private String signature;
|
||||
|
||||
@@ -167,7 +167,7 @@ database: '{pluginDir}/FastLogin.db'
|
||||
|
||||
# MySQL/MariaDB
|
||||
#driver: com.mysql.jdbc.Driver
|
||||
#host: localhost
|
||||
#host: 127.0.0.1
|
||||
#port: 3306
|
||||
#database: fastlogin
|
||||
#username: myUser
|
||||
|
||||
Reference in New Issue
Block a user