Skip to content

Commit

Permalink
Fix compilation errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
chilimannen committed Jan 20, 2017
1 parent 0196a02 commit a3e9067
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/main/com/codingchili/core/security/HashHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public void hash(Future<String> future, String password, String salt) {
*
* @return A generated salt of 512 bits.
*/
public String generateSalt() {
public String salt() {
byte[] salt = new byte[SALT_BYTES];
new SecureRandom().nextBytes(salt);
return Base64.getEncoder().encodeToString(salt);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public void generateUniqueSaltTest() {
HashMap<String, Boolean> salts = new HashMap<>();

for (int i = 0; i < 1000; i++) {
String salt = HashHelper.generateSalt();
String salt = new HashHelper(vertx).salt();

Assert.assertFalse(salts.containsKey(salt));
salts.put(salt, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void authenticate(Future<Account> future, Account account) {
public void register(Future<Account> future, Account account) {
Future<String> hashing = Future.future();
AccountMapping mapping = new AccountMapping(account)
.setSalt(hasher.generateSalt());
.setSalt(hasher.salt());

hashing.setHandler(hash -> {
mapping.setHash(hash.result());
Expand Down

0 comments on commit a3e9067

Please sign in to comment.