// 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),
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);
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;
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];
* 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;
}
/**
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);