}
public NtlmUserAccount authenticate(byte[] material, byte[] serverChallenge)
throws IOException, NoSuchAlgorithmException, NtlmLogonException {
Type3Message type3Message = new Type3Message(material);
if (type3Message.getFlag(
_NTLMSSP_NEGOTIATE_EXTENDED_SESSION_SECURITY) &&
(type3Message.getNTResponse().length == 24)) {
MessageDigest messageDigest = MessageDigest.getInstance("MD5");
byte[] bytes = new byte[16];
System.arraycopy(serverChallenge, 0, bytes, 0, 8);
System.arraycopy(type3Message.getLMResponse(), 0, bytes, 8, 8);
messageDigest.update(bytes);
serverChallenge = messageDigest.digest();
}
return _netlogon.logon(
type3Message.getDomain(), type3Message.getUser(),
type3Message.getWorkstation(), serverChallenge,
type3Message.getNTResponse(), type3Message.getLMResponse());
}