aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/helper/Hashing.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/helper/Hashing.java')
-rw-r--r--src/org/traccar/helper/Hashing.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/org/traccar/helper/Hashing.java b/src/org/traccar/helper/Hashing.java
index 1f01d9102..cdc5c7ae5 100644
--- a/src/org/traccar/helper/Hashing.java
+++ b/src/org/traccar/helper/Hashing.java
@@ -65,13 +65,13 @@ public final class Hashing {
RANDOM.nextBytes(salt);
byte[] hash = function(password.toCharArray(), salt);
return new HashingResult(
- ChannelBufferTools.convertByteArray(hash),
- ChannelBufferTools.convertByteArray(salt));
+ ChannelBufferTools.bytesToHex(hash),
+ ChannelBufferTools.bytesToHex(salt));
}
public static boolean validatePassword(String password, String hashHex, String saltHex) {
- byte[] hash = ChannelBufferTools.convertHexString(hashHex);
- byte[] salt = ChannelBufferTools.convertHexString(saltHex);
+ byte[] hash = ChannelBufferTools.hexToBytes(hashHex);
+ byte[] salt = ChannelBufferTools.hexToBytes(saltHex);
return slowEquals(hash, function(password.toCharArray(), salt));
}