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

Function _parse_upn

scapy/layers/kerberos.py:4154–4172  ·  view source on GitHub ↗

Extract the username and realm from full UPN

(upn)

Source from the content-addressed store, hash-verified

4152
4153
4154def _parse_upn(upn):
4155 """
4156 Extract the username and realm from full UPN
4157 """
4158 m = re.match(r"^([^@\\/]+)(@|\\)([^@\\/]+)$", upn)
4159 if not m:
4160 err = "Invalid UPN: '%s'" % upn
4161 if "/" in upn:
4162 err += ". Did you mean '%s' ?" % upn.replace("/", "\\")
4163 elif "@" not in upn and "\\" not in upn:
4164 err += ". Provide domain as so: '%s@domain.local'" % upn
4165 raise ValueError(err)
4166 if m.group(2) == "@":
4167 user = m.group(1)
4168 domain = m.group(3)
4169 else:
4170 user = m.group(3)
4171 domain = m.group(1)
4172 return user, domain
4173
4174
4175def _parse_spn(spn):

Callers 14

add_credMethod · 0.90
from_cli_argumentsMethod · 0.90
__init__Method · 0.90
GSS_Init_sec_contextMethod · 0.90
fromUPNMethod · 0.85
__init__Method · 0.85
_fast_wrapMethod · 0.85
tgs_reqMethod · 0.85
_parse_spnFunction · 0.85
krb_as_reqFunction · 0.85
krb_get_saltFunction · 0.85

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected