Class HTTPNTLMAuthentication
- java.lang.Object
-
- org.tmatesoft.svn.core.internal.io.dav.http.HTTPAuthentication
-
- org.tmatesoft.svn.core.internal.io.dav.http.HTTPNTLMAuthentication
-
- Direct Known Subclasses:
HTTPApacheNTLMAuthentication
,HTTPNativeNTLMAuthentication
class HTTPNTLMAuthentication extends HTTPAuthentication
- Version:
- 1.3
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
DEFAULT_CHARSET
private static int
LM_RESPONSE_LENGTH
private java.lang.String
myCharset
private boolean
myIsNegotiateLocalCall
private byte[]
myNonce
private int
myPosition
private byte[]
myResponse
protected int
myState
private static long
NEGOTIATE_128
private static long
NEGOTIATE_56
private static long
NEGOTIATE_ALWAYS_SIGN
private static long
NEGOTIATE_DATAGRAM_STYLE
private static long
NEGOTIATE_DOMAIN_SUPPLIED
private static long
NEGOTIATE_KEY_EXCHANGE
private static long
NEGOTIATE_LAN_MANAGER_KEY
private static long
NEGOTIATE_LOCAL_CALL
private static long
NEGOTIATE_NETWARE
private static long
NEGOTIATE_NTLM
private static long
NEGOTIATE_NTLM2_KEY
private static long
NEGOTIATE_OEM
private static long
NEGOTIATE_SEAL
private static long
NEGOTIATE_SIGN
private static long
NEGOTIATE_TARGET_INFO
private static long
NEGOTIATE_UNICODE
private static long
NEGOTIATE_WORKSTATION_SUPPLIED
private static java.lang.String
NTLM_CASE_CONVERTION_PROPERTY
private static java.lang.String
OLD_NTLM_CASE_CONVERTION_PROPERTY
private static java.util.Map<java.lang.Long,java.lang.String>
ourFlags
private static byte[]
ourMagicBytes
private static java.util.Map<java.lang.Integer,java.lang.String>
ourTargetInfoTypes
private static java.lang.String
PROTOCOL_NAME
private static long
REQUEST_ACCEPT_RESPONSE
private static long
REQUEST_INIT_RESPONSE
private static long
REQUEST_NON_NT_SESSION_KEY
private static long
REQUEST_TARGET
private static long
TARGET_TYPE_DOMAIN
private static long
TARGET_TYPE_SERVER
private static long
TARGET_TYPE_SHARE
protected static int
TYPE1
protected static int
TYPE3
private static int
UNINITIATED
-
Constructor Summary
Constructors Modifier Constructor Description protected
HTTPNTLMAuthentication(java.lang.String charset)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
addByte(byte b)
private void
addBytes(byte[] bytes)
boolean
allowPropmtForCredentials()
java.lang.String
authenticate()
private void
calcResp(byte[] keys, byte[] results)
private byte[]
convertToShortValue(int num)
private byte[]
encrypt(byte[] key, byte[] bytes)
java.lang.String
getAuthenticationScheme()
private javax.crypto.Cipher
getCipher(byte[] key)
java.lang.String
getDomain()
private java.lang.String
getResponse()
java.lang.String
getUserName()
private byte[]
hashPassword(char[] password)
private void
initResponse(int bufferSize)
boolean
isInType3State()
boolean
isNative()
private boolean
isUpperCase()
void
parseChallenge(java.lang.String challenge)
void
setType1State()
void
setType3State()
private byte[]
setupKey(byte[] key56)
private static int
toInt(byte[] num)
private long
toLong(byte[] num)
-
Methods inherited from class org.tmatesoft.svn.core.internal.io.dav.http.HTTPAuthentication
clear, clear, getASCIIBytes, getBytes, getBytes, getChallengeParameter, getChallengeParameters, getPassword, getRawUserName, isSchemeSupportedByServer, parseAuthParameters, setChallengeParameter, setCredentials, setPassword, setUserName
-
-
-
-
Field Detail
-
NTLM_CASE_CONVERTION_PROPERTY
private static final java.lang.String NTLM_CASE_CONVERTION_PROPERTY
- See Also:
- Constant Field Values
-
OLD_NTLM_CASE_CONVERTION_PROPERTY
private static final java.lang.String OLD_NTLM_CASE_CONVERTION_PROPERTY
- See Also:
- Constant Field Values
-
DEFAULT_CHARSET
private static final java.lang.String DEFAULT_CHARSET
- See Also:
- Constant Field Values
-
PROTOCOL_NAME
private static final java.lang.String PROTOCOL_NAME
- See Also:
- Constant Field Values
-
LM_RESPONSE_LENGTH
private static final int LM_RESPONSE_LENGTH
- See Also:
- Constant Field Values
-
UNINITIATED
private static final int UNINITIATED
- See Also:
- Constant Field Values
-
TYPE1
protected static final int TYPE1
- See Also:
- Constant Field Values
-
TYPE3
protected static final int TYPE3
- See Also:
- Constant Field Values
-
ourMagicBytes
private static byte[] ourMagicBytes
-
NEGOTIATE_UNICODE
private static final long NEGOTIATE_UNICODE
- See Also:
- Constant Field Values
-
NEGOTIATE_OEM
private static final long NEGOTIATE_OEM
- See Also:
- Constant Field Values
-
REQUEST_TARGET
private static final long REQUEST_TARGET
- See Also:
- Constant Field Values
-
NEGOTIATE_SIGN
private static final long NEGOTIATE_SIGN
- See Also:
- Constant Field Values
-
NEGOTIATE_SEAL
private static final long NEGOTIATE_SEAL
- See Also:
- Constant Field Values
-
NEGOTIATE_DATAGRAM_STYLE
private static final long NEGOTIATE_DATAGRAM_STYLE
- See Also:
- Constant Field Values
-
NEGOTIATE_LAN_MANAGER_KEY
private static final long NEGOTIATE_LAN_MANAGER_KEY
- See Also:
- Constant Field Values
-
NEGOTIATE_NETWARE
private static final long NEGOTIATE_NETWARE
- See Also:
- Constant Field Values
-
NEGOTIATE_NTLM
private static final long NEGOTIATE_NTLM
- See Also:
- Constant Field Values
-
NEGOTIATE_DOMAIN_SUPPLIED
private static final long NEGOTIATE_DOMAIN_SUPPLIED
- See Also:
- Constant Field Values
-
NEGOTIATE_WORKSTATION_SUPPLIED
private static final long NEGOTIATE_WORKSTATION_SUPPLIED
- See Also:
- Constant Field Values
-
NEGOTIATE_LOCAL_CALL
private static final long NEGOTIATE_LOCAL_CALL
- See Also:
- Constant Field Values
-
NEGOTIATE_ALWAYS_SIGN
private static final long NEGOTIATE_ALWAYS_SIGN
- See Also:
- Constant Field Values
-
TARGET_TYPE_DOMAIN
private static final long TARGET_TYPE_DOMAIN
- See Also:
- Constant Field Values
-
TARGET_TYPE_SERVER
private static final long TARGET_TYPE_SERVER
- See Also:
- Constant Field Values
-
TARGET_TYPE_SHARE
private static final long TARGET_TYPE_SHARE
- See Also:
- Constant Field Values
-
NEGOTIATE_NTLM2_KEY
private static final long NEGOTIATE_NTLM2_KEY
- See Also:
- Constant Field Values
-
REQUEST_INIT_RESPONSE
private static final long REQUEST_INIT_RESPONSE
- See Also:
- Constant Field Values
-
REQUEST_ACCEPT_RESPONSE
private static final long REQUEST_ACCEPT_RESPONSE
- See Also:
- Constant Field Values
-
REQUEST_NON_NT_SESSION_KEY
private static final long REQUEST_NON_NT_SESSION_KEY
- See Also:
- Constant Field Values
-
NEGOTIATE_TARGET_INFO
private static final long NEGOTIATE_TARGET_INFO
- See Also:
- Constant Field Values
-
NEGOTIATE_128
private static final long NEGOTIATE_128
- See Also:
- Constant Field Values
-
NEGOTIATE_KEY_EXCHANGE
private static final long NEGOTIATE_KEY_EXCHANGE
- See Also:
- Constant Field Values
-
NEGOTIATE_56
private static final long NEGOTIATE_56
- See Also:
- Constant Field Values
-
ourFlags
private static java.util.Map<java.lang.Long,java.lang.String> ourFlags
-
ourTargetInfoTypes
private static java.util.Map<java.lang.Integer,java.lang.String> ourTargetInfoTypes
-
myState
protected int myState
-
myCharset
private java.lang.String myCharset
-
myResponse
private byte[] myResponse
-
myPosition
private int myPosition
-
myNonce
private byte[] myNonce
-
myIsNegotiateLocalCall
private boolean myIsNegotiateLocalCall
-
-
Method Detail
-
setType1State
public void setType1State()
-
setType3State
public void setType3State()
-
isInType3State
public boolean isInType3State()
-
initResponse
private void initResponse(int bufferSize)
-
addByte
private void addByte(byte b)
-
addBytes
private void addBytes(byte[] bytes)
-
convertToShortValue
private byte[] convertToShortValue(int num)
-
getResponse
private java.lang.String getResponse()
-
parseChallenge
public void parseChallenge(java.lang.String challenge) throws SVNException
- Throws:
SVNException
-
toInt
private static int toInt(byte[] num)
-
authenticate
public java.lang.String authenticate() throws SVNException
- Specified by:
authenticate
in classHTTPAuthentication
- Throws:
SVNException
-
getAuthenticationScheme
public java.lang.String getAuthenticationScheme()
- Specified by:
getAuthenticationScheme
in classHTTPAuthentication
-
isNative
public boolean isNative()
-
getUserName
public java.lang.String getUserName()
- Overrides:
getUserName
in classHTTPAuthentication
-
getDomain
public java.lang.String getDomain()
-
toLong
private long toLong(byte[] num)
-
isUpperCase
private boolean isUpperCase()
-
hashPassword
private byte[] hashPassword(char[] password) throws SVNException
- Throws:
SVNException
-
calcResp
private void calcResp(byte[] keys, byte[] results) throws SVNException
- Throws:
SVNException
-
encrypt
private byte[] encrypt(byte[] key, byte[] bytes) throws SVNException
- Throws:
SVNException
-
getCipher
private javax.crypto.Cipher getCipher(byte[] key) throws SVNException
- Throws:
SVNException
-
setupKey
private byte[] setupKey(byte[] key56)
-
allowPropmtForCredentials
public boolean allowPropmtForCredentials()
-
-