Class: Rex::Proto::Kerberos::Model::KrbError
- Defined in:
- lib/rex/proto/kerberos/model/krb_error.rb
Overview
This class provides a representation of a Kerberos KRB-ERROR (response error) message definition.
Constant Summary
Constants included from Rex::Proto::Kerberos::Model
AP_REP, AP_REQ, AS_REP, AS_REQ, AUTHENTICATOR, ENC_AP_REP_PART, ENC_KRB_CRED_PART, KRB_CRED, KRB_ERROR, TGS_REP, TGS_REQ, TICKET, VERSION
Instance Attribute Summary collapse
-
#cname ⇒ Rex::Proto::Kerberos::Model::PrincipalName
The name part of the client’s principal identifier.
-
#crealm ⇒ String
The realm part of the client’s principal identifier.
-
#ctime ⇒ Time
The current time of the client’s host.
-
#cusec ⇒ Integer
The microseconds part of the client timestamp.
-
#e_data ⇒ String
Additional data about the error (ASN.1 encoded data).
-
#error_code ⇒ Rex::Proto::Kerberos::Model::Error::ErrorCode
The error request returned by kerberos or the server when a request fails.
-
#etext ⇒ String
Additional text to help explain the error code.
-
#msg_type ⇒ Integer
The type of a protocol message.
-
#pvno ⇒ Integer
The protocol version number.
-
#realm ⇒ String
The realm part of the server’s principal identifier.
-
#sname ⇒ Rex::Proto::Kerberos::Model::PrincipalName
The name part of the server’s identity.
-
#stime ⇒ Time
The current time of the server.
-
#susec ⇒ Integer
The microseconds part of the server timestamp.
Instance Method Summary collapse
-
#decode(input) ⇒ self
Decodes the Rex::Proto::Kerberos::Model::KrbError from an input.
-
#e_data_as_pa_data ⇒ Array<Rex::Proto::Kerberos::Model::PreAuthDataEntry>
Decodes the e_data field as an Array<PreAuthDataEntry>.
-
#e_data_as_pa_data_entry ⇒ Rex::Proto::Kerberos::Model::PreAuthData
Decodes the e_data field as a PreAuthData.
-
#encode ⇒ Object
Rex::Proto::Kerberos::Model::KrbError encoding isn’t supported.
Methods inherited from Element
attr_accessor, attributes, #attributes, decode, #initialize
Constructor Details
This class inherits a constructor from Rex::Proto::Kerberos::Model::Element
Instance Attribute Details
#cname ⇒ Rex::Proto::Kerberos::Model::PrincipalName
Returns The name part of the client’s principal identifier.
36 37 38 |
# File 'lib/rex/proto/kerberos/model/krb_error.rb', line 36 def cname @cname end |
#crealm ⇒ String
Returns The realm part of the client’s principal identifier.
33 34 35 |
# File 'lib/rex/proto/kerberos/model/krb_error.rb', line 33 def crealm @crealm end |
#ctime ⇒ Time
Returns The current time of the client’s host.
18 19 20 |
# File 'lib/rex/proto/kerberos/model/krb_error.rb', line 18 def ctime @ctime end |
#cusec ⇒ Integer
Returns The microseconds part of the client timestamp.
21 22 23 |
# File 'lib/rex/proto/kerberos/model/krb_error.rb', line 21 def cusec @cusec end |
#e_data ⇒ String
Returns additional data about the error (ASN.1 encoded data).
48 49 50 |
# File 'lib/rex/proto/kerberos/model/krb_error.rb', line 48 def e_data @e_data end |
#error_code ⇒ Rex::Proto::Kerberos::Model::Error::ErrorCode
Returns The error request returned by kerberos or the server when a request fails.
30 31 32 |
# File 'lib/rex/proto/kerberos/model/krb_error.rb', line 30 def error_code @error_code end |
#etext ⇒ String
Returns Additional text to help explain the error code.
45 46 47 |
# File 'lib/rex/proto/kerberos/model/krb_error.rb', line 45 def etext @etext end |
#msg_type ⇒ Integer
Returns The type of a protocol message.
15 16 17 |
# File 'lib/rex/proto/kerberos/model/krb_error.rb', line 15 def msg_type @msg_type end |
#pvno ⇒ Integer
Returns The protocol version number.
12 13 14 |
# File 'lib/rex/proto/kerberos/model/krb_error.rb', line 12 def pvno @pvno end |
#realm ⇒ String
Returns The realm part of the server’s principal identifier.
39 40 41 |
# File 'lib/rex/proto/kerberos/model/krb_error.rb', line 39 def realm @realm end |
#sname ⇒ Rex::Proto::Kerberos::Model::PrincipalName
Returns The name part of the server’s identity.
42 43 44 |
# File 'lib/rex/proto/kerberos/model/krb_error.rb', line 42 def sname @sname end |
#stime ⇒ Time
Returns The current time of the server.
24 25 26 |
# File 'lib/rex/proto/kerberos/model/krb_error.rb', line 24 def stime @stime end |
#susec ⇒ Integer
Returns The microseconds part of the server timestamp.
27 28 29 |
# File 'lib/rex/proto/kerberos/model/krb_error.rb', line 27 def susec @susec end |
Instance Method Details
#decode(input) ⇒ self
Decodes the Rex::Proto::Kerberos::Model::KrbError from an input
55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/rex/proto/kerberos/model/krb_error.rb', line 55 def decode(input) case input when String decode_string(input) when OpenSSL::ASN1::ASN1Data decode_asn1(input) else raise ::Rex::Proto::Kerberos::Model::Error::KerberosDecodingError, 'Failed to decode KrbError, invalid input' end self end |
#e_data_as_pa_data ⇒ Array<Rex::Proto::Kerberos::Model::PreAuthDataEntry>
Decodes the e_data field as an Array<PreAuthDataEntry>
78 79 80 81 82 83 84 85 86 |
# File 'lib/rex/proto/kerberos/model/krb_error.rb', line 78 def e_data_as_pa_data pre_auth = [] decoded = OpenSSL::ASN1.decode(self.e_data) decoded.each do |pre_auth_data| pre_auth << Rex::Proto::Kerberos::Model::PreAuthDataEntry.decode(pre_auth_data) end pre_auth end |
#e_data_as_pa_data_entry ⇒ Rex::Proto::Kerberos::Model::PreAuthData
Decodes the e_data field as a PreAuthData
91 92 93 94 95 96 97 98 99 |
# File 'lib/rex/proto/kerberos/model/krb_error.rb', line 91 def e_data_as_pa_data_entry if self.e_data decoded = OpenSSL::ASN1.decode(self.e_data) Rex::Proto::Kerberos::Model::PreAuthDataEntry.decode(decoded) else # This is implementation-defined, so may be different in some cases nil end end |
#encode ⇒ Object
Rex::Proto::Kerberos::Model::KrbError encoding isn’t supported
71 72 73 |
# File 'lib/rex/proto/kerberos/model/krb_error.rb', line 71 def encode raise ::NotImplementedError, 'KrbError encoding not supported' end |