reorganized file layout (part 2: edits)
[org.ibex.core.git] / src / org / ibex / net / HTTP.java
index 10da62b..0142a9e 100644 (file)
@@ -1,13 +1,14 @@
 // Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
-package org.ibex;
+package org.ibex.net;
 
 import java.net.*;
 import java.io.*;
 import java.util.*;
 import org.ibex.js.*;
 import org.ibex.util.*;
-import org.bouncycastle.util.encoders.Base64;
-import org.bouncycastle.crypto.digests.*;
+import org.ibex.plat.*;
+import org.ibex.core.*;
+import org.ibex.crypto.*;
 
 /**
  *  This object encapsulates a *single* HTTP connection. Multiple requests may be pipelined over a connection (thread-safe),
@@ -638,7 +639,7 @@ public class HTTP {
 
     private String H(String s) throws IOException {
         byte[] b = s.getBytes("UTF8");
-        MD5Digest md5 = new MD5Digest();
+        MD5 md5 = new MD5();
         md5.update(b, 0, b.length);
         byte[] out = new byte[md5.getDigestSize()];
         md5.doFinal(out, 0);
@@ -783,7 +784,7 @@ public class HTTP {
 
                 if (authorization != oldAuth) return;
                 if (Log.on) Log.info(Authorization.class, "displaying proxy authorization dialog");
-                Scheduler.add(new Scheduler.Task() {
+                Scheduler.add(new Task() {
                         public void perform() throws IOException, JSExn {
                             Box b = new Box();
                             Template t = null;
@@ -1021,7 +1022,7 @@ public class HTTP {
             public static byte[] getNTLM2SessionResponse(String password,
                                                          byte[] challenge, byte[] clientChallenge) throws UnsupportedEncodingException {
                 byte[] ntlmHash = ntlmHash(password);
-                MD5Digest md5 = new MD5Digest();
+                MD5 md5 = new MD5();
                 md5.update(challenge, 0, challenge.length);
                 md5.update(clientChallenge, 0, clientChallenge.length);
                 byte[] sessionHash = new byte[8];
@@ -1070,11 +1071,15 @@ public class HTTP {
              * of the NTLM Response and the NTLMv2 and LMv2 Hashes.
              */
             private static byte[] ntlmHash(String password) throws UnsupportedEncodingException {
+                // FIXME
+                /*
                 byte[] unicodePassword = password.getBytes("UnicodeLittleUnmarked");
-                MD4Digest md4 = new MD4Digest();
+                MD4 md4 = new MD4();
                 md4.update(unicodePassword, 0, unicodePassword.length);
                 byte[] ret = new byte[md4.getDigestSize()];
                 return ret;
+                */
+                return null;
             }
 
             /**
@@ -1231,14 +1236,14 @@ public class HTTP {
                 byte[] content = new byte[data.length + 64];
                 System.arraycopy(ipad, 0, content, 0, 64);
                 System.arraycopy(data, 0, content, 64, data.length);
-                MD5Digest md5 = new MD5Digest();
+                MD5 md5 = new MD5();
                 md5.update(content, 0, content.length);
                 data = new byte[md5.getDigestSize()];
                 md5.doFinal(data, 0);
                 content = new byte[data.length + 64];
                 System.arraycopy(opad, 0, content, 0, 64);
                 System.arraycopy(data, 0, content, 64, data.length);
-                md5 = new MD5Digest();
+                md5 = new MD5();
                 md5.update(content, 0, content.length);
                 byte[] ret = new byte[md5.getDigestSize()];
                 md5.doFinal(ret, 0);