X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fibex%2FHTTP.java;h=7f6f248b29b0974390f56ea6475c9b100bee13d2;hb=a726bd527e6364dd00477e17e9c688d32509c62c;hp=2aed806f8fb56487bcf2955120b22de8e381457c;hpb=c28ed126fbc51fb5794bb367f51a8755dc20140e;p=org.ibex.core.git diff --git a/src/org/ibex/HTTP.java b/src/org/ibex/HTTP.java index 2aed806..7f6f248 100644 --- a/src/org/ibex/HTTP.java +++ b/src/org/ibex/HTTP.java @@ -385,7 +385,7 @@ public class HTTP { if (h.get("AUTHTYPE").equals("Basic")) { if (authCache.get(originalUrl) != null) throw new HTTPException("username/password rejected"); - authCache.put(originalUrl, "Basic " + new String(Base64.encode(userInfo.getBytes("US-ASCII")))); + authCache.put(originalUrl, "Basic " + new String(Base64.encode(userInfo.getBytes("UTF8")))); } else if (h.get("AUTHTYPE").equals("Digest")) { if (authCache.get(originalUrl) != null && !"true".equals(h.get("stale"))) @@ -432,7 +432,7 @@ public class HTTP { if (style.equals("Basic")) { Proxy.Authorization.authorization2 = - "Basic " + new String(Base64.encode(Proxy.Authorization.authorization.getBytes("US-ASCII"))); + "Basic " + new String(Base64.encode(Proxy.Authorization.authorization.getBytes("UTF8"))); } else if (style.equals("Digest")) { String A1 = Proxy.Authorization.authorization.substring(0, userInfo.indexOf(':')) + ":" + h.get("realm") + ":" + @@ -633,7 +633,7 @@ public class HTTP { } private String H(String s) throws IOException { - byte[] b = s.getBytes("US-ASCII"); + byte[] b = s.getBytes("UTF8"); MD5Digest md5 = new MD5Digest(); md5.update(b, 0, b.length); byte[] out = new byte[md5.getDigestSize()]; @@ -1037,13 +1037,13 @@ public class HTTP { */ private static byte[] lmHash(String password) { /* - byte[] oemPassword = password.toUpperCase().getBytes("US-ASCII"); + byte[] oemPassword = password.toUpperCase().getBytes("UTF8"); int length = java.lang.Math.min(oemPassword.length, 14); byte[] keyBytes = new byte[14]; System.arraycopy(oemPassword, 0, keyBytes, 0, length); Key lowKey = createDESKey(keyBytes, 0); Key highKey = createDESKey(keyBytes, 7); - byte[] magicConstant = "KGS!@#$%".getBytes("US-ASCII"); + byte[] magicConstant = "KGS!@#$%".getBytes("UTF8"); Cipher des = Cipher.getInstance("DES/ECB/NoPadding"); des.init(Cipher.ENCRYPT_MODE, lowKey); byte[] lowHash = des.doFinal(magicConstant);