Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cbbab8b9 authored by cketti's avatar cketti Committed by GitHub
Browse files

Merge pull request #2218 from JoelTroch/issue-2208

Make Hex.encodeHex returns a String (was char[])
parents 5104278c 7d628cf7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -75,7 +75,7 @@ public class Authentication {
            md.update(opad);
            byte[] result = md.digest(firstPass);

            String plainCRAM = username + " " + new String(Hex.encodeHex(result));
            String plainCRAM = username + " " + Hex.encodeHex(result);
            byte[] b64CRAM = Base64.encodeBase64(plainCRAM.getBytes());

            return b64CRAM;
+3 −3
Original line number Diff line number Diff line
@@ -36,9 +36,9 @@ public class Hex {
     *
     * @param data
     *                  a byte[] to convert to Hex characters
     * @return A char[] containing lower-case hexadecimal characters
     * @return A String containing lower-case hexadecimal characters
     */
    public static char[] encodeHex(byte[] data) {
    public static String encodeHex(byte[] data) {

        int l = data.length;

@@ -50,7 +50,7 @@ public class Hex {
            out[j++] = DIGITS[ 0x0F & data[i] ];
        }

        return out;
        return new String(out);
    }

}
+1 −1
Original line number Diff line number Diff line
@@ -459,7 +459,7 @@ public class Pop3Store extends RemoteStore {
                        "MD5 failure during POP3 auth APOP", e);
            }
            byte[] digest = md.digest((timestamp + mPassword).getBytes());
            String hexDigest = new String(Hex.encodeHex(digest));
            String hexDigest = Hex.encodeHex(digest);
            try {
                executeSimpleCommand("APOP " + mUsername + " " + hexDigest, true);
            } catch (Pop3ErrorResponse e) {
+2 −2
Original line number Diff line number Diff line
@@ -238,8 +238,8 @@ public class AccountSetupCheckSettings extends K9Activity implements OnClickList
                    if (sha1 != null) {
                        sha1.reset();
                        try {
                            char[] sha1sum = Hex.encodeHex(sha1.digest(chain[i].getEncoded()));
                            chainInfo.append("Fingerprint (SHA-1): ").append(new String(sha1sum)).append("\n");
                            String sha1sum = Hex.encodeHex(sha1.digest(chain[i].getEncoded()));
                            chainInfo.append("Fingerprint (SHA-1): ").append(sha1sum).append("\n");
                        } catch (CertificateEncodingException e) {
                            Log.e(K9.LOG_TAG, "Error while encoding certificate", e);
                        }