Exception: Rex::Proto::Kerberos::Pac::Error::MissingInfoBuffer

Inherits:
PacError
  • Object
show all
Defined in:
lib/rex/proto/kerberos/pac/error.rb

Overview

To be raised when a PAC object does not contain one or more specific Info Buffers

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(msg = nil, ul_types:) ⇒ MissingInfoBuffer

Returns a new instance of MissingInfoBuffer.

Parameters:

  • msg (String, nil) (defaults to: nil)
  • ul_types (Array<Integer>)

    The ul types of the missing info buffers.



23
24
25
26
# File 'lib/rex/proto/kerberos/pac/error.rb', line 23

def initialize(msg = nil, ul_types:)
  @ul_types = ul_types
  super(msg || generate_message)
end

Instance Attribute Details

#ul_typesArray<Integer>

Returns The ul types of the missing info buffers.

Returns:

  • (Array<Integer>)

    The ul types of the missing info buffers



19
20
21
# File 'lib/rex/proto/kerberos/pac/error.rb', line 19

def ul_types
  @ul_types
end

Instance Method Details

#generate_messageString

Returns A message created containing the names of the missing buffers.

Returns:

  • (String)

    A message created containing the names of the missing buffers.



29
30
31
32
33
34
# File 'lib/rex/proto/kerberos/pac/error.rb', line 29

def generate_message
  missing_buffer_names = @ul_types.map do |ul_type|
    Rex::Proto::Kerberos::Pac::Krb5PacElementType.const_name(ul_type)
  end
  "Missing Info Buffer(s): #{missing_buffer_names.join(', ')}"
end