Merge pull request #22 from Xephi/master

Up
This commit is contained in:
Gabriele C. 2015-08-01 03:49:37 +02:00
commit e816db687c
3 changed files with 12 additions and 5 deletions

13
pom.xml
View File

@ -110,13 +110,13 @@
</execution>
</executions>
</plugin>
<plugin>
<plugin>
<groupId>com.versioneye</groupId>
<artifactId>versioneye-maven-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<projectId>55bab9e8653762002000190a</projectId>
<!--<apiKey>my_secret_api_key</apiKey>-->>
<!--<apiKey>my_secret_api_key</apiKey> -->
</configuration>
</plugin>
</plugins>
@ -178,6 +178,12 @@
<url>http://ci.xephi.fr/plugin/repository/everything/</url>
</repository>
<!-- Metrics Snapshots Repo -->
<repository>
<id>mcstats-snapshots</id>
<url>http://repo.mcstats.org/content/repositories/snapshots/</url>
</repository>
</repositories>
<dependencies>
@ -233,10 +239,11 @@
<scope>compile</scope>
</dependency>
<!-- Metrics API -->
<dependency>
<groupId>org.mcstats.bukkit</groupId>
<artifactId>metrics</artifactId>
<version>R7</version>
<version>R8-SNAPSHOT</version>
<scope>compile</scope>
<exclusions>
<exclusion>

View File

@ -395,7 +395,7 @@ public class BCRYPT implements EncryptionMethod {
off = 3;
else {
minor = salt.charAt(2);
if (minor != 'a' || salt.charAt(3) != '$')
if (minor < 'a' || minor > 'z' || salt.charAt(3) != '$')
throw new IllegalArgumentException("Invalid salt revision");
off = 4;
}

View File

@ -15,7 +15,7 @@ public class BCRYPT2Y implements EncryptionMethod {
@Override
public boolean comparePassword(String hash, String password,
String playerName) throws NoSuchAlgorithmException {
String ok = hash.substring(29);
String ok = hash.substring(0, 29);
if (ok.length() != 29)
return false;
return hash.equals(getHash(password, ok, playerName));