if (msg != null && msg.startsWith("NTLM ")) {
byte[] src = Base64Decoder.decodeToBytes(msg.substring(5));
if (src[8] == 1) {
Type1Message type1 = new Type1Message(src);
Type2Message type2 = new Type2Message(type1, challenge, null);
msg = Base64Encoder.encode(type2.toByteArray());
resp.setHeader( "WWW-Authenticate", "NTLM " + msg );
} else if (src[8] == 3) {
Type3Message type3 = new Type3Message(src);
byte[] lmResponse = type3.getLMResponse();
if (lmResponse == null) lmResponse = new byte[0];