19 lines
558 B
Python
19 lines
558 B
Python
from cert_portal.directory import decode_object_sid, encode_object_sid
|
|
|
|
|
|
def test_sid_round_trip_typical_account():
|
|
sid = "S-1-5-21-3623811015-3361044348-30300820-1013"
|
|
assert decode_object_sid(encode_object_sid(sid)) == sid
|
|
|
|
|
|
def test_sid_well_known_administrators():
|
|
sid = "S-1-5-32-544"
|
|
assert decode_object_sid(encode_object_sid(sid)) == sid
|
|
|
|
|
|
def test_sid_revision_and_authority():
|
|
raw = encode_object_sid("S-1-5-18")
|
|
assert raw[0] == 1
|
|
assert raw[1] == 1 # one sub-authority
|
|
assert decode_object_sid(raw) == "S-1-5-18"
|