Path: blob/master/lib/rex/proto/kerberos/pac/error.rb
19612 views
# frozen_string_literal: true12module Rex3module Proto4module Kerberos5module Pac6module Error7# Generic Pac Error8class PacError < StandardError9def initialize(msg = 'Invalid PAC')10super11end12end1314# To be raised when a PAC object does not contain one or more specific Info Buffers15class MissingInfoBuffer < PacError1617# @return [Array<Integer>] The ul types of the missing info buffers18attr_accessor :ul_types1920# @param [String, nil] msg21# @param [Array<Integer>] ul_types The ul types of the missing info buffers.22def initialize(msg = nil, ul_types:)23@ul_types = ul_types24super(msg || generate_message)25end2627# @return [String] A message created containing the names of the missing buffers.28def generate_message29missing_buffer_names = @ul_types.map do |ul_type|30Rex::Proto::Kerberos::Pac::Krb5PacElementType.const_name(ul_type)31end32"Missing Info Buffer(s): #{missing_buffer_names.join(', ')}"33end34end35end36end37end38end39end404142