(self, sidstr, msdn=False)
| 1066 | self._add_cred(tkt) |
| 1067 | |
| 1068 | def _build_sid(self, sidstr, msdn=False): |
| 1069 | if not sidstr: |
| 1070 | return None |
| 1071 | m = re.match(r"S-(\d+)-(\d+)-?((?:\d+-?)*)", sidstr.strip()) |
| 1072 | if not m: |
| 1073 | raise ValueError("Invalid SID format: %s" % sidstr) |
| 1074 | subauthors = [] |
| 1075 | if m.group(3): |
| 1076 | subauthors = [int(x) for x in m.group(3).split("-")] |
| 1077 | if msdn: |
| 1078 | return WINNT_SID( |
| 1079 | Revision=int(m.group(1)), |
| 1080 | IdentifierAuthority=WINNT_SID_IDENTIFIER_AUTHORITY( |
| 1081 | Value=struct.pack(">Q", int(m.group(2)))[2:], |
| 1082 | ), |
| 1083 | SubAuthority=subauthors, |
| 1084 | ) |
| 1085 | else: |
| 1086 | return SID( |
| 1087 | Revision=int(m.group(1)), |
| 1088 | IdentifierAuthority=RPC_SID_IDENTIFIER_AUTHORITY( |
| 1089 | Value=struct.pack(">Q", int(m.group(2)))[2:] |
| 1090 | ), |
| 1091 | SubAuthority=subauthors, |
| 1092 | ) |
| 1093 | |
| 1094 | def _build_ticket(self, store): |
| 1095 | if store["CC.ClaimsArrays"]: |
no test coverage detected