/** * Sets or clears the specified flag. * * @param flag The flag to set/clear (i.e., * <code>NTLMSSP_NEGOTIATE_OEM</code>). * @param value Indicates whether to set (<code>true</code>) or * clear (<code>false</code>) the specified flag. */ public void setFlag(int flag, boolean value) { setFlags(value ? (getFlags() | flag) : (getFlags() & (0xffffffff ^ flag))); }
/** * Sets or clears the specified flag. * * @param flag The flag to set/clear (i.e., * <code>NTLMSSP_NEGOTIATE_OEM</code>). * @param value Indicates whether to set (<code>true</code>) or * clear (<code>false</code>) the specified flag. */ public void setFlag(int flag, boolean value) { setFlags(value ? (getFlags() | flag) : (getFlags() & (0xffffffff ^ flag))); }
/** * Sets or clears the specified flag. * * @param flag The flag to set/clear (i.e., * <code>NTLMSSP_NEGOTIATE_OEM</code>). * @param value Indicates whether to set (<code>true</code>) or * clear (<code>false</code>) the specified flag. */ public void setFlag(int flag, boolean value) { setFlags(value ? (getFlags() | flag) : (getFlags() & (0xffffffff ^ flag))); }
/** * Sets or clears the specified flag. * * @param flag The flag to set/clear (i.e., * <code>NTLMSSP_NEGOTIATE_OEM</code>). * @param value Indicates whether to set (<code>true</code>) or * clear (<code>false</code>) the specified flag. */ public void setFlag(int flag, boolean value) { setFlags(value ? (getFlags() | flag) : (getFlags() & (0xffffffff ^ flag))); }
/** * Sets or clears the specified flag. * * @param flag * The flag to set/clear (i.e., * <code>NTLMSSP_NEGOTIATE_OEM</code>). * @param value * Indicates whether to set (<code>true</code>) or * clear (<code>false</code>) the specified flag. */ public void setFlag ( int flag, boolean value ) { setFlags(value ? ( getFlags() | flag ) : ( getFlags() & ( 0xffffffff ^ flag ) )); }
/** * Sets or clears the specified flag. * * @param flag * The flag to set/clear (i.e., * <code>NTLMSSP_NEGOTIATE_OEM</code>). * @param value * Indicates whether to set (<code>true</code>) or * clear (<code>false</code>) the specified flag. */ public void setFlag ( int flag, boolean value ) { setFlags(value ? ( getFlags() | flag ) : ( getFlags() & ( 0xffffffff ^ flag ) )); }
/** * Creates a Type-2 message with the specified parameters. * * @param flags The flags to apply to this message. * @param challenge The challenge from the domain controller/server. * @param target The authentication target. */ public Type2Message(int flags, byte[] challenge, String target) { setFlags(flags); setChallenge(challenge); setTarget(target); if (target != null) setTargetInformation(getDefaultTargetInformation()); }
/** * Creates a Type-1 message with the specified parameters. * * @param flags The flags to apply to this message. * @param suppliedDomain The supplied authentication domain. * @param suppliedWorkstation The supplied workstation name. */ public Type1Message(int flags, String suppliedDomain, String suppliedWorkstation) { setFlags(getDefaultFlags() | flags); setSuppliedDomain(suppliedDomain); if (suppliedWorkstation == null) suppliedWorkstation = getDefaultWorkstation(); setSuppliedWorkstation(suppliedWorkstation); }
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); }
setFlags(flags); String target = null; byte[] bytes = readSecurityBuffer(material, 12);
/** * Creates a Type-3 message with the specified parameters. * * @param flags The flags to apply to this message. * @param lmResponse The LanManager/LMv2 response. * @param ntResponse The NT/NTLMv2 response. * @param domain The domain in which the user has an account. * @param user The username for the authenticating user. * @param workstation The workstation from which authentication is * taking place. */ public Type3Message(int flags, byte[] lmResponse, byte[] ntResponse, String domain, String user, String workstation) { setFlags(flags); setLMResponse(lmResponse); setNTResponse(ntResponse); setDomain(domain); setUser(user); setWorkstation(workstation); }
/** * Creates a Type-3 message using default values from the current * environment. */ public Type3Message() { setFlags(getDefaultFlags()); setDomain(getDefaultDomain()); setUser(getDefaultUser()); setWorkstation(getDefaultWorkstation()); }
setFlags(flags); setLMResponse(lmResponse); setNTResponse(ntResponse);
setFlags(flags | getDefaultFlags(type2)); if (workstation == null) workstation = getDefaultWorkstation();
setFlags(getDefaultFlags(type2)); setWorkstation(getDefaultWorkstation()); String domain = getDefaultDomain();