Module jcifs
Class PreauthIntegrityNegotiateContext
java.lang.Object
org.codelibs.jcifs.smb.internal.smb2.nego.PreauthIntegrityNegotiateContext
- All Implemented Interfaces:
Decodable,Encodable,NegotiateContextRequest,NegotiateContextResponse
public class PreauthIntegrityNegotiateContext
extends Object
implements NegotiateContextRequest, NegotiateContextResponse
SMB2 Pre-authentication Integrity Negotiate Context.
This negotiate context is used in SMB 3.1.1 to establish
pre-authentication integrity protection against downgrade attacks.
- Author:
- mbechler
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intSHA-512static final intContext type -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for deserialization.PreauthIntegrityNegotiateContext(Configuration config, int[] hashAlgos, byte[] salt) Constructs a preauth integrity negotiate context with the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionintdecode(byte[] buffer, int bufferIndex, int len) Decode data from a byte bufferintencode(byte[] dst, int dstIndex) Encodes this object into the specified byte array.intGets the negotiate context type.int[]Gets the supported hash algorithms for preauth integrity.byte[]getSalt()Gets the salt value used for preauth integrity.intsize()Returns the size in bytes that this object will occupy when encoded.
-
Field Details
-
NEGO_CTX_PREAUTH_TYPE
public static final int NEGO_CTX_PREAUTH_TYPEContext type- See Also:
-
HASH_ALGO_SHA512
public static final int HASH_ALGO_SHA512SHA-512- See Also:
-
-
Constructor Details
-
PreauthIntegrityNegotiateContext
Constructs a preauth integrity negotiate context with the specified parameters.- Parameters:
config- the SMB configurationhashAlgos- the supported hash algorithmssalt- the salt value for preauth integrity
-
PreauthIntegrityNegotiateContext
public PreauthIntegrityNegotiateContext()Default constructor for deserialization.
-
-
Method Details
-
getSalt
public byte[] getSalt()Gets the salt value used for preauth integrity.- Returns:
- the salt
-
getHashAlgos
public int[] getHashAlgos()Gets the supported hash algorithms for preauth integrity.- Returns:
- the hashAlgos
-
getContextType
public int getContextType()Gets the negotiate context type.- Specified by:
getContextTypein interfaceNegotiateContextRequest- Specified by:
getContextTypein interfaceNegotiateContextResponse- Returns:
- the SMB2 negotiate context type
- See Also:
-
encode
public int encode(byte[] dst, int dstIndex) Encodes this object into the specified byte array. -
decode
Decode data from a byte buffer- Specified by:
decodein interfaceDecodable- Parameters:
buffer- the byte buffer containing the data to decodebufferIndex- the starting index in the bufferlen- the maximum length of data to decode- Returns:
- decoded length
- Throws:
SMBProtocolDecodingException- if decoding fails- See Also:
-
size
public int size()Returns the size in bytes that this object will occupy when encoded.
-