MCPcopy Index your code
hub / github.com/secdev/scapy / _parse_spn

Function _parse_spn

scapy/layers/kerberos.py:4175–4187  ·  view source on GitHub ↗

Extract ServiceName and realm from full SPN

(spn)

Source from the content-addressed store, hash-verified

4173
4174
4175def _parse_spn(spn):
4176 """
4177 Extract ServiceName and realm from full SPN
4178 """
4179 # See [MS-ADTS] sect 2.2.21 for SPN format. We discard the servicename.
4180 m = re.match(r"^((?:[^@\\/]+)/(?:[^@\\/]+))(?:/[^@\\/]+)?(?:@([^@\\/]+))?$", spn)
4181 if not m:
4182 try:
4183 # If SPN is a UPN, we are doing U2U :D
4184 return _parse_upn(spn)
4185 except ValueError:
4186 raise ValueError("Invalid SPN: '%s'" % spn)
4187 return m.group(1), m.group(2)
4188
4189
4190def _spn_are_equal(spn1, spn2):

Callers 5

add_credMethod · 0.90
from_cli_argumentsMethod · 0.90
fromSPNMethod · 0.85
__init__Method · 0.85
_spn_are_equalFunction · 0.85

Calls 1

_parse_upnFunction · 0.85

Tested by

no test coverage detected