class RubySMB::SMB1::Packet::NegotiateResponseExtended

A SMB1 SMB_COM_NEGOTIATE Extended Security Response Packet as defined in [2.2.4.5.2.1 Extended Security Response](msdn.microsoft.com/en-us/library/cc246326.aspx)

Constants

COMMAND

Public Instance Methods

dialects=(dialects) click to toggle source

Stores the list of {RubySMB::SMB1::Dialect} that were sent to the peer/server in the related Negotiate Request. This will be used by the {#negotiated_dialect} method.

@param dialects [Array] array of {RubySMB::SMB1::Dialect} @return dialects [Array] array of {RubySMB::SMB1::Dialect} @raise [ArgumentError] if dialects is not an array of {RubySMB::SMB1::Dialect}

# File lib/ruby_smb/smb1/packet/negotiate_response_extended.rb, line 52
def dialects=(dialects)
  unless dialects.all? { |dialect| dialect.is_a? Dialect }
    raise ArgumentError, 'Dialects must be an array of Dialect objects'
  end
  @dialects = dialects
end
initialize_instance() click to toggle source
# File lib/ruby_smb/smb1/packet/negotiate_response_extended.rb, line 34
def initialize_instance
  super
  smb_header.flags.reply = 1
end
negotiated_dialect() click to toggle source

Returns the negotiated dialect identifier

@return [String] the negotiated dialect identifier or an empty string if the list of {RubySMB::SMB1::Dialect} was not provided.

# File lib/ruby_smb/smb1/packet/negotiate_response_extended.rb, line 62
def negotiated_dialect
  return '' if @dialects.nil? || @dialects.empty?
  @dialects[parameter_block.dialect_index].dialect_string
end
valid?() click to toggle source
Calls superclass method RubySMB::GenericPacket#valid?
# File lib/ruby_smb/smb1/packet/negotiate_response_extended.rb, line 39
def valid?
  return false unless super
  return false unless parameter_block.capabilities.extended_security == 1
  true
end