public class AuthenticateSession extends Object
Used for passthru authentication mechanisms.
Modifier and Type | Field and Description |
---|---|
protected static int |
Closed |
static int |
DBGDumpPacket |
static int |
DBGHexDump |
static int |
DBGPacketType |
static int |
DEFAULT_BUFSIZE |
protected SMBPacket |
m_pkt |
protected int |
m_treeid |
static int |
SecurityModeShare |
static int |
SecurityModeUser |
Modifier | Constructor and Description |
---|---|
protected |
AuthenticateSession(PCShare shr,
NetworkSession sess,
int dialect,
SMBPacket pkt)
Class constructor
|
Modifier and Type | Method and Description |
---|---|
protected SMBPacket |
allocatePacket(int pref)
Allocate an SMB packet for this session.
|
void |
CloseSession()
Close this connection with the remote server.
|
void |
doSessionSetup(String userName,
byte[] ascPwd,
byte[] uniPwd)
Perform a session setup to create a session on the remote server validating the user.
|
void |
doSessionSetup(String domain,
String userName,
String wksName,
byte[] ascPwd,
byte[] uniPwd,
int vcNum)
Perform a session setup to create a session on the remote server validating the user.
|
void |
doSessionSetup(Type3NTLMMessage type3Msg)
Perform a session using the type3 NTLM response received from the client
|
int |
getCapabilities()
Return the session capability flags.
|
int |
getDefaultFlags()
Return the default flags settings for this session
|
int |
getDefaultFlags2()
Return the default flags2 settings for this session
|
int |
getDeviceType()
Get the device type that this session is connected to.
|
int |
getDialect()
Get the SMB dialect property
|
String |
getDialectString()
Get the SMB dialect string
|
String |
getDomain()
Get the servers primary domain name
|
byte[] |
getEncryptionKey()
Return the cahllenge encryption key
|
String |
getLANManagerType()
Get the servers LAN manager type
|
int |
getMaximumMultiplexedRequests()
Get the maximum number of multiplxed requests that are allowed
|
int |
getMaximumPacketSize()
Get the maximum packet size allowed for this session
|
int |
getMaximumVirtualCircuits()
Get the maximum virtual circuits allowed on this session
|
int |
getNextMultiplexId()
Get the next multiplex id to uniquely identify a transaction
|
protected int |
getNextSessionId()
Get the next session id
|
String |
getOperatingSystem()
Get the servers operating system type
|
String |
getPassword()
Get the remote share password string
|
PCShare |
getPCShare()
Get the remote share details for this session
|
int |
getProcessId()
Get the process id for this session
|
int |
getSecurityMode()
Return the security mode of the session (user or share)
|
String |
getServer()
Get the remote server name
|
NetworkSession |
getSession()
Access the associated network session
|
int |
getSessionId()
Get the session identifier property
|
String |
getShareName()
Get the remote share name
|
int |
getTreeId()
Get the connected tree identifier.
|
int |
getUserId()
Return the assigned use id for this SMB session
|
String |
getUserName()
Get the remote share user name string
|
boolean |
hasDataAvailable()
Check if there is data available in the network receive buffer
|
static boolean |
hasDebug()
Determine if SMB session debugging is enabled
|
static boolean |
hasDebugOption(int opt)
Determine if the specified debugging option is enabled
|
boolean |
hasEncryptionKey()
Determine if there is a challenge encryption key
|
boolean |
isActive()
Determine if the session is valid, ie.
|
boolean |
isGuest()
Determine if the session has been created as a guest logon
|
boolean |
isUnicode()
Determine if the Unicode flag is enabled
|
boolean |
isUsingExtendedSecurity()
Determine if extended security exchanges are being used
|
void |
pingServer()
Send a single echo request to the server
|
void |
pingServer(int cnt)
Send an echo request to the server
|
protected void |
processAsynchResponse(SMBPacket pkt)
Process an asynchronous packet
|
protected void |
setCapabilities(int caps)
Set the session capability flags
|
static void |
setDebug(int dbg)
Enable/disable SMB session debugging
|
protected void |
setDefaultFlags(int flg)
Set the default SMB packet flags for this session
|
protected void |
setDefaultFlags2(int flg2)
Set the SMB packet default flags2 for this session
|
protected void |
setDeviceType(int dev)
Set the device type for this session.
|
protected void |
setDialect(int dia)
Set the dialect for this session
|
protected void |
setDialectString(String dia)
Set the dialect string for this session
|
protected void |
setDomain(String dom)
Set the remote servers primary domain name
|
void |
setEncryptionKey(byte[] key)
Set the encryption key
|
protected void |
setGuest(boolean sts)
Set the guest status for the session
|
protected void |
setLANManagerType(String lm)
Set the remote servers LAN manager type
|
protected void |
setMaximumMultiplexedRequests(int maxMulti)
Set the maximum number of multiplexed requests allowed
|
protected void |
setMaximumPacketSize(int siz)
Set the maximum packet size allowed on this session
|
protected void |
setMaximumVirtualCircuits(int maxVC)
Set the maximum number of virtual circuits allowed on this session
|
protected void |
setOperatingSystem(String os)
Set the remote servers operating system type
|
protected void |
setPassword(String pwd)
Set the remote share password
|
protected void |
setProcessId(int id)
Set the process id for this session
|
void |
setSecurityMode(int secMode)
Set the session security mode (user or share)
|
protected void |
setServer(String srv)
Set the remote server name
|
protected void |
setSession(NetworkSession netSess)
Set the network session that this SMB session is associated with
|
protected void |
setShareName(String shr)
Set the remote share name
|
protected void |
setTreeId(int id)
Set the connected tree identifier for this session.
|
protected void |
setUserId(int uid)
Set the user identifier for this session
|
protected void |
setUserName(String user)
Set the remote share user name
|
boolean |
supportsExtendedSecurity()
Determine if the session supports extended security
|
boolean |
supportsLargeFiles()
Determine if the session supports large files (ie.
|
boolean |
supportsLevel2Oplocks()
Determine if the session supports level 2 oplocks
|
boolean |
supportsLockAndRead()
Determine if the session supports lock and read
|
boolean |
supportsNTFind()
Determine if the session supports NT find
|
boolean |
supportsNTSmbs()
Determine if the session supports NT specific SMBs
|
boolean |
supportsNTStatusCodes()
Determine if the session supports NT status codes
|
boolean |
supportsRawMode()
Determine if the session supports raw mode read/writes
|
boolean |
supportsRPCAPIs()
Determine if the session supports RPC API requests
|
boolean |
supportsUnicode()
Determine if the session supports Unicode
|
String |
toString()
Output the session details as a string
|
public static final int SecurityModeUser
public static final int SecurityModeShare
protected static final int Closed
public static final int DBGPacketType
public static final int DBGDumpPacket
public static final int DBGHexDump
public static final int DEFAULT_BUFSIZE
protected SMBPacket m_pkt
protected int m_treeid
protected AuthenticateSession(PCShare shr, NetworkSession sess, int dialect, SMBPacket pkt) throws IOException, SMBException
shr
- PCSharesess
- NetworkSessiondialect
- intpkt
- SMBPacketIOException
SMBException
protected final SMBPacket allocatePacket(int pref)
pref
- Preferred SMB packet sizepublic final boolean supportsExtendedSecurity()
public final boolean supportsRawMode()
public final boolean supportsUnicode()
public final boolean supportsLargeFiles()
public final boolean supportsNTSmbs()
public final boolean supportsRPCAPIs()
public final boolean supportsNTStatusCodes()
public final boolean supportsLevel2Oplocks()
public final boolean supportsLockAndRead()
public final boolean supportsNTFind()
public void CloseSession() throws IOException, SMBException
IOException
- If an I/O error occurs.SMBException
- If an SMB level error occurspublic final int getDefaultFlags()
public final int getDefaultFlags2()
public final int getDeviceType()
public final int getDialect()
public final String getDialectString()
public final String getDomain()
public final boolean hasEncryptionKey()
public final byte[] getEncryptionKey()
public final String getLANManagerType()
public final int getMaximumMultiplexedRequests()
public final int getMaximumPacketSize()
public final int getMaximumVirtualCircuits()
public final int getNextMultiplexId()
protected final int getNextSessionId()
public final String getOperatingSystem()
public final String getPassword()
public final PCShare getPCShare()
public final int getSecurityMode()
public final String getServer()
public final NetworkSession getSession()
public final int getCapabilities()
public final int getProcessId()
public final int getSessionId()
public final String getShareName()
public final int getTreeId()
public final int getUserId()
public final String getUserName()
public final boolean hasDataAvailable() throws IOException
IOException
public static boolean hasDebugOption(int opt)
opt
- Debug option bit maskpublic final boolean isActive()
public static boolean hasDebug()
public final boolean isGuest()
public final boolean isUnicode()
public final boolean isUsingExtendedSecurity()
public final void pingServer() throws IOException, SMBException
IOException
SMBException
public final void pingServer(int cnt) throws IOException, SMBException
cnt
- Number of packets to echo from the remote serverIOException
- If an I/O error occursSMBException
- SMB error occurredpublic static void setDebug(int dbg)
dbg
- Bit mask of debug options to enable, or zero to disableprotected final void setDefaultFlags(int flg)
flg
- intprotected final void setDefaultFlags2(int flg2)
flg2
- intprotected final void setDeviceType(int dev)
dev
- Device type for this session.protected final void setDialect(int dia)
dia
- SMB dialect that this session is using.protected final void setDialectString(String dia)
dia
- SMB dialect stringprotected final void setDomain(String dom)
dom
- Servers primary domain name.public final void setEncryptionKey(byte[] key)
key
- byte[]protected final void setGuest(boolean sts)
sts
- booleanprotected final void setLANManagerType(String lm)
lm
- Servers LAN manager type string.protected final void setMaximumMultiplexedRequests(int maxMulti)
maxMulti
- intprotected final void setMaximumPacketSize(int siz)
siz
- Maximum allowed packet size.protected final void setMaximumVirtualCircuits(int maxVC)
maxVC
- intprotected final void setOperatingSystem(String os)
os
- Servers operating system type string.protected final void setPassword(String pwd)
pwd
- Remtoe share password string.public final void setSecurityMode(int secMode)
secMode
- intprotected final void setServer(String srv)
srv
- Server name stringprotected final void setSession(NetworkSession netSess)
netSess
- Network session that this SMB session is to be associated
with.protected final void setCapabilities(int caps)
caps
- Capability flags.protected final void setShareName(String shr)
shr
- Remote share name stringprotected final void setProcessId(int id)
id
- intprotected final void setTreeId(int id)
id
- Tree identifier for this session.protected final void setUserId(int uid)
uid
- User identifierprotected final void setUserName(String user)
user
- Remote share user name stringprotected void processAsynchResponse(SMBPacket pkt)
pkt
- SMBPacketpublic String toString()
public final void doSessionSetup(String userName, byte[] ascPwd, byte[] uniPwd) throws IOException, SMBException
userName
- StringascPwd
- ASCII password hashuniPwd
- Unicode password hashIOException
- If a network error occursSMBException
- If a CIFS error occurspublic final void doSessionSetup(Type3NTLMMessage type3Msg) throws IOException, SMBException
type3Msg
- Type3NTLMMessageIOException
- If a network error occursSMBException
- If a CIFS error occurspublic void doSessionSetup(String domain, String userName, String wksName, byte[] ascPwd, byte[] uniPwd, int vcNum) throws IOException, SMBException
domain
- StringuserName
- StringwksName
- StringascPwd
- ASCII password hashuniPwd
- Unicode password hashvcNum
- Virtual circuit numberIOException
- If a network error occursSMBException
- If a CIFS error occursCopyright © 2005–2017 Alfresco Software. All rights reserved.