private void parse(byte[] material) throws IOException { for (int i = 0; i < 8; i++) { if (material[i] != NTLMSSP_SIGNATURE[i]) { throw new IOException("Not an NTLMSSP message."); } } if (readULong(material, 8) != 1) { throw new IOException("Not a Type 1 message."); } int flags = readULong(material, 12); String suppliedDomain = null; if ((flags & NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED) != 0) { byte[] domain = readSecurityBuffer(material, 16); suppliedDomain = new String(domain, getOEMEncoding()); } String suppliedWorkstation = null; if ((flags & NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED) != 0) { byte[] workstation = readSecurityBuffer(material, 24); suppliedWorkstation = new String(workstation, getOEMEncoding()); } setFlags(flags); setSuppliedDomain(suppliedDomain); setSuppliedWorkstation(suppliedWorkstation); }
flags |= NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED; domain = suppliedDomain.toUpperCase().getBytes( getOEMEncoding()); } else { flags &= (NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED ^ 0xffffffff); workstation = suppliedWorkstation.toUpperCase().getBytes( getOEMEncoding()); } else { flags &= (NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED ^
target = (flags & NTLMSSP_NEGOTIATE_UNICODE) != 0 ? targetName.getBytes(UNI_ENCODING) : targetName.toUpperCase().getBytes(getOEMEncoding()); } else { flags &= (0xffffffff ^ (NTLMSSP_TARGET_TYPE_DOMAIN |
int flags = getFlags(); boolean unicode = (flags & NTLMSSP_NEGOTIATE_UNICODE) != 0; String oem = unicode ? null : getOEMEncoding(); String domainName = getDomain(); byte[] domain = null;
target = new String(bytes, ((flags & NTLMSSP_NEGOTIATE_UNICODE) != 0) ? UNI_ENCODING : getOEMEncoding());
workstationOffset == 52) { flags = NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_NEGOTIATE_OEM; charset = getOEMEncoding(); } else { _sessionKey = readSecurityBuffer(material, 52); flags = readULong(material, 60); charset = ((flags & NTLMSSP_NEGOTIATE_UNICODE) != 0) ? UNI_ENCODING : getOEMEncoding();