Class: Net::NTLM::TargetInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/net/ntlm/target_info.rb

Overview

Represents a list of AV_PAIR structures

Constant Summary collapse

MSV_AV_EOL =

Allowed AvId values for an AV_PAIR

"\x00\x00".freeze
MSV_AV_NB_COMPUTER_NAME =
"\x01\x00".freeze
MSV_AV_NB_DOMAIN_NAME =
"\x02\x00".freeze
MSV_AV_DNS_COMPUTER_NAME =
"\x03\x00".freeze
MSV_AV_DNS_DOMAIN_NAME =
"\x04\x00".freeze
MSV_AV_DNS_TREE_NAME =
"\x05\x00".freeze
MSV_AV_FLAGS =
"\x06\x00".freeze
MSV_AV_TIMESTAMP =
"\x07\x00".freeze
MSV_AV_SINGLE_HOST =
"\x08\x00".freeze
MSV_AV_TARGET_NAME =
"\x09\x00".freeze
MSV_AV_CHANNEL_BINDINGS =
"\x0A\x00".freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(av_pair_sequence) ⇒ TargetInfo

Returns a new instance of TargetInfo.

Parameters:

  • av_pair_sequence (String)

    AV_PAIR list from challenge message



22
23
24
# File 'lib/net/ntlm/target_info.rb', line 22

def initialize(av_pair_sequence)
  @av_pairs = read_pairs(av_pair_sequence)
end

Instance Attribute Details

#av_pairsObject (readonly)

Returns the value of attribute av_pairs.



26
27
28
# File 'lib/net/ntlm/target_info.rb', line 26

def av_pairs
  @av_pairs
end

Instance Method Details

#to_sObject



28
29
30
31
32
33
34
35
36
37
38
# File 'lib/net/ntlm/target_info.rb', line 28

def to_s
  result = ''
  av_pairs.each do |k,v|
    result << k
    result << [v.length].pack('S')
    result << v
  end
  result << Net::NTLM::TargetInfo::MSV_AV_EOL
  result << [0].pack('S')
  result.force_encoding(Encoding::ASCII_8BIT)
end