Package com.hierynomus.smbj.connection
Class SMBSessionBuilder
java.lang.Object
com.hierynomus.smbj.connection.SMBSessionBuilder
[MS-SMB2] 3.2.5.3.1 Handling a New Authentication
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static interface
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final String
private final SmbConfig
private final Connection
private final ConnectionContext
(package private) static final String
(package private) static final byte[]
(package private) static final byte[]
(package private) static final byte[]
(package private) static final byte[]
(package private) static final byte[]
(package private) static final byte[]
(package private) static final byte[]
(package private) static final byte[]
(package private) static final byte[]
(package private) static final byte[]
(package private) static final byte[]
private static final org.slf4j.Logger
private final SessionTable
private final SMBSessionBuilder.SessionFactory
private final SessionTable
-
Constructor Summary
ConstructorsConstructorDescriptionSMBSessionBuilder
(Connection connection, SmbConfig config, SMBSessionBuilder.SessionFactory sessionFactory) -
Method Summary
Modifier and TypeMethodDescriptionprivate SecretKey
private void
deriveKeys
(SMB2SessionSetup response, SMB2Dialect dialect, SessionContext context) establish
(AuthenticationContext authContext) Establish a new session on the connection using the passed credentials.private Authenticator
getAuthenticator
(AuthenticationContext context) private SMBSessionBuilder.BuilderContext
initiateSessionSetup
(SMBSessionBuilder.BuilderContext ctx, byte[] securityContext) private SMBSessionBuilder.BuilderContext
newContext
(AuthenticationContext authContext, Authenticator authenticator) private Session
private void
processAuthenticationToken
(SMBSessionBuilder.BuilderContext ctx, byte[] inputToken) private Session
private void
updatePreauthIntegrityValue
(SMBSessionBuilder.BuilderContext ctx, SessionContext sessionContext, SMB2Packet packet) private void
-
Field Details
-
KDF_ENC_LABEL_SMB311
static final byte[] KDF_ENC_LABEL_SMB311 -
KDF_DEC_LABEL_SMB311
static final byte[] KDF_DEC_LABEL_SMB311 -
KDF_ENCDEC_LABEL
static final byte[] KDF_ENCDEC_LABEL -
KDF_ENC_CONTEXT
static final byte[] KDF_ENC_CONTEXT -
KDF_DEC_CONTEXT
static final byte[] KDF_DEC_CONTEXT -
KDF_SIGN_CONTEXT
static final byte[] KDF_SIGN_CONTEXT -
KDF_SIGN_LABEL
static final byte[] KDF_SIGN_LABEL -
KDF_SIGN_LABEL_SMB311
static final byte[] KDF_SIGN_LABEL_SMB311 -
KDF_APP_CONTEXT
static final byte[] KDF_APP_CONTEXT -
KDF_APP_LABEL
static final byte[] KDF_APP_LABEL -
KDF_APP_LABEL_SMB311
static final byte[] KDF_APP_LABEL_SMB311 -
HMAC_SHA256_ALGORITHM
- See Also:
-
AES_128_CMAC_ALGORITHM
- See Also:
-
logger
private static final org.slf4j.Logger logger -
config
-
connectionContext
-
sessionFactory
-
sessionTable
-
preauthSessionTable
-
connection
-
-
Constructor Details
-
SMBSessionBuilder
public SMBSessionBuilder(Connection connection, SmbConfig config, SMBSessionBuilder.SessionFactory sessionFactory)
-
-
Method Details
-
establish
Establish a new session on the connection using the passed credentials.- Returns:
- a (new) Session that is authenticated for the user.
-
newContext
private SMBSessionBuilder.BuilderContext newContext(AuthenticationContext authContext, Authenticator authenticator) -
setupSession
- Throws:
IOException
-
newSession
-
processAuthenticationToken
private void processAuthenticationToken(SMBSessionBuilder.BuilderContext ctx, byte[] inputToken) throws IOException - Throws:
IOException
-
initiateSessionSetup
private SMBSessionBuilder.BuilderContext initiateSessionSetup(SMBSessionBuilder.BuilderContext ctx, byte[] securityContext) throws TransportException - Throws:
TransportException
-
getAuthenticator
- Throws:
SpnegoException
-
validateAndSetSigning
-
updatePreauthIntegrityValue
private void updatePreauthIntegrityValue(SMBSessionBuilder.BuilderContext ctx, SessionContext sessionContext, SMB2Packet packet) -
deriveKeys
-
deriveKey
-