spnego = gssapi.raw.oids.OID.from_int_seq('1.3.6.1.5.5.2')
c = gssapi.creds.Credentials(mechs=[spnego], usage='initiate')
tname = gssapi.raw.names.import_name("F23/server", name_type=gssapi.raw.types.NameType.hostbased_service)
ac = gssapi.creds.Credentials(mechs=[spnego], usage='accept')
seci = gssapi.SecurityContext(creds=c, name=tname, mech=spnego, usage='initiate')
seca = gssapi.SecurityContext(creds=ac, usage='accept')
it = seci.step(token=None)
ot = seca.step(token=it)
it = seci.step(token=ot)
ot = seca.step(token=it)
it = seci.step(token=ot)
e = seci.wrap("Secrets", True)
o = seca.unwrap(e.message)
o.message
'Secrets'
So far I checked with GDB that the seq numbers were reset after the MEchListMIC operation happened and started again from 0.
[Test Case]
create a file with some credentials:
$ echo F23:guest:guest > ~/ntlmcreds.txt FILE=~/ ntlmcreds. txt
$ export NTLM_USER_
$ python
import gssapi
spnego = gssapi. raw.oids. OID.from_ int_seq( '1.3.6. 1.5.5.2' ) creds.Credentia ls(mechs= [spnego] , usage='initiate') raw.names. import_ name("F23/ server" , name_type= gssapi. raw.types. NameType. hostbased_ service) creds.Credentia ls(mechs= [spnego] , usage='accept')
c = gssapi.
tname = gssapi.
ac = gssapi.
seci = gssapi. SecurityContext (creds= c, name=tname, mech=spnego, usage='initiate') SecurityContext (creds= ac, usage='accept') token=None)
seca = gssapi.
it = seci.step(
ot = seca.step(token=it)
it = seci.step(token=ot)
ot = seca.step(token=it)
it = seci.step(token=ot)
e = seci.wrap( "Secrets" , True) e.message)
o = seca.unwrap(
o.message
'Secrets'
So far I checked with GDB that the seq numbers were reset after the MEchListMIC operation happened and started again from 0.