GUACAMOLE-736: Replace JAXB DatatypeConverter with Guava BaseEncoding.

This commit is contained in:
Virtually Nick
2019-02-21 17:09:44 -05:00
parent 87aa2e6c34
commit 37f1da9f1f
16 changed files with 58 additions and 67 deletions

View File

@@ -98,13 +98,6 @@
<scope>provided</scope>
</dependency>
<!-- Java XML -->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
<!-- Guacamole Extension API -->
<dependency>
<groupId>org.apache.guacamole</groupId>
@@ -142,7 +135,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>19.0</version>
<version>27.0.1-jre</version>
</dependency>
</dependencies>

View File

@@ -19,10 +19,10 @@
package org.apache.guacamole.auth.jdbc.security;
import com.google.common.io.BaseEncoding;
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import javax.xml.bind.DatatypeConverter;
/**
* Provides a SHA-256 based implementation of the password encryption
@@ -40,7 +40,7 @@ public class SHA256PasswordEncryptionService implements PasswordEncryptionServic
builder.append(password);
if (salt != null)
builder.append(DatatypeConverter.printHexBinary(salt));
builder.append(BaseEncoding.base16().encode(salt));
// Hash UTF-8 bytes of possibly-salted password
MessageDigest md = MessageDigest.getInstance("SHA-256");