Java Code Examples for jcifs.ntlmssp.NtlmFlags#NTLMSSP_NEGOTIATE_SIGN

The following examples show how to use jcifs.ntlmssp.NtlmFlags#NTLMSSP_NEGOTIATE_SIGN . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NtlmContext.java    From jcifs with GNU Lesser General Public License v2.1 6 votes vote down vote up
/**
 * @param tc
 *            context to use
 * @param auth
 *            credentials
 * @param doSigning
 *            whether signing is requested
 */
public NtlmContext ( CIFSContext tc, NtlmPasswordAuthenticator auth, boolean doSigning ) {
    this.transportContext = tc;
    this.auth = auth;
    this.ntlmsspFlags = this.ntlmsspFlags | NtlmFlags.NTLMSSP_REQUEST_TARGET | NtlmFlags.NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY
            | NtlmFlags.NTLMSSP_NEGOTIATE_128;
    if ( !auth.isAnonymous() ) {
        this.ntlmsspFlags |= NtlmFlags.NTLMSSP_NEGOTIATE_SIGN | NtlmFlags.NTLMSSP_NEGOTIATE_ALWAYS_SIGN | NtlmFlags.NTLMSSP_NEGOTIATE_KEY_EXCH;
    }
    else if ( auth.isGuest() ) {
        this.ntlmsspFlags |= NtlmFlags.NTLMSSP_NEGOTIATE_KEY_EXCH;
    }
    else {
        this.ntlmsspFlags |= NtlmFlags.NTLMSSP_NEGOTIATE_ANONYMOUS;
    }
    this.requireKeyExchange = doSigning;
    this.workstation = tc.getConfig().getNetbiosHostname();
}
 
Example 2
Source File: NtlmContext.java    From jcifs-ng with GNU Lesser General Public License v2.1 6 votes vote down vote up
/**
 * @param tc
 *            context to use
 * @param auth
 *            credentials
 * @param doSigning
 *            whether signing is requested
 */
public NtlmContext ( CIFSContext tc, NtlmPasswordAuthenticator auth, boolean doSigning ) {
    this.transportContext = tc;
    this.auth = auth;
    this.ntlmsspFlags = this.ntlmsspFlags | NtlmFlags.NTLMSSP_REQUEST_TARGET | NtlmFlags.NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY
            | NtlmFlags.NTLMSSP_NEGOTIATE_128;
    if ( !auth.isAnonymous() ) {
        this.ntlmsspFlags |= NtlmFlags.NTLMSSP_NEGOTIATE_SIGN | NtlmFlags.NTLMSSP_NEGOTIATE_ALWAYS_SIGN | NtlmFlags.NTLMSSP_NEGOTIATE_KEY_EXCH;
    }
    else if ( auth.isGuest() ) {
        this.ntlmsspFlags |= NtlmFlags.NTLMSSP_NEGOTIATE_KEY_EXCH;
    }
    else {
        this.ntlmsspFlags |= NtlmFlags.NTLMSSP_NEGOTIATE_ANONYMOUS;
    }
    this.requireKeyExchange = doSigning;
    this.workstation = tc.getConfig().getNetbiosHostname();
}