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); }
throw new IOException("Not a Type 3 message."); byte[] lmResponse = readSecurityBuffer(material, 12); int lmResponseOffset = readULong(material, 16); byte[] ntResponse = readSecurityBuffer(material, 20); int ntResponseOffset = readULong(material, 24); byte[] domain = readSecurityBuffer(material, 28); int domainOffset = readULong(material, 32); byte[] user = readSecurityBuffer(material, 36); int userOffset = readULong(material, 40); byte[] workstation = readSecurityBuffer(material, 44); int workstationOffset = readULong(material, 48); int flags; charset = getOEMEncoding(); } else { _sessionKey = readSecurityBuffer(material, 52); flags = readULong(material, 60); charset = ((flags & NTLMSSP_NEGOTIATE_UNICODE) != 0) ?
setFlags(flags); String target = null; byte[] bytes = readSecurityBuffer(material, 12); if (bytes.length != 0) { target = new String(bytes, bytes = readSecurityBuffer(material, 40); if (bytes.length != 0) setTargetInformation(bytes);