CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/lib/rex/proto/gss/spnego_neg_token_targ.rb
Views: 11704
1
require 'rasn1'
2
3
module Rex::Proto::Gss
4
# Negotiation token returned by the target to the initiator
5
# https://www.rfc-editor.org/rfc/rfc2478
6
class SpnegoNegTokenTarg < RASN1::Model
7
ACCEPT_COMPLETED = 'accept-completed'
8
ACCEPT_INCOMPLETE = 'accept-incomplete'
9
REJECT = 'reject'
10
REQUEST_MIC = 'request-mic'
11
12
NEG_RESULTS = { ACCEPT_COMPLETED => 0,
13
ACCEPT_INCOMPLETE => 1,
14
REJECT => 2,
15
REQUEST_MIC => 3}
16
17
sequence :token, explicit: 1, class: :context, constructed: true,
18
content: [enumerated(:neg_result, enum: NEG_RESULTS, explicit: 0, class: :context, constructed: true, optional: true),
19
objectid(:supported_mech, explicit: 1, class: :context, constructed: true, optional: true),
20
octet_string(:response_token, explicit: 2, class: :context, constructed: true, optional: true),
21
octet_string(:mech_list_mic, explicit: 3, class: :context, constructed: true, optional: true)
22
]
23
24
def neg_result
25
self[:neg_result].value
26
end
27
28
def supported_mech
29
self[:supported_mech].value
30
end
31
32
def response_token
33
self[:response_token].value
34
end
35
36
def mech_list_mic
37
self[:mech_list_mic].value
38
end
39
end
40
end
41