Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix salt retrival with aes128-cts-hmac-sha1-96 #8

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions gmsad/salt.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,8 @@ def get_salt_from_rep(kdc_rep: bytes) -> str:
if padata['padata-type'].native == PA_ETYPE_INFO2:
etype = ETYPE_INFO2()
for pa_etype_info2_value in etype.load(padata['padata-value'].native):
if pa_etype_info2_value['etype'].native == AES256_CTS_HMAC_SHA1h96_ENC_TYPE:
if (pa_etype_info2_value['etype'].native == AES256_CTS_HMAC_SHA1h96_ENC_TYPE
or pa_etype_info2_value['etype'].native == AES128_CTS_HMAC_SHA1_96_ENC_TYPE):
# XXX: Adding str just for mypy
return str(pa_etype_info2_value['salt'].native)
else:
Expand All @@ -362,8 +363,8 @@ def get_salt_from_rep(kdc_rep: bytes) -> str:
if padata['padata-type'] == PA_ETYPE_INFO2:
etype = ETYPE_INFO2()
for pa_etype_info2_value in etype.load(padata['padata-value']):
if pa_etype_info2_value['etype'].native == AES256_CTS_HMAC_SHA1h96_ENC_TYPE \
or pa_etype_info2_value['etype'].native == AES128_CTS_HMAC_SHA1_96_ENC_TYPE:
if (pa_etype_info2_value['etype'].native == AES256_CTS_HMAC_SHA1h96_ENC_TYPE
or pa_etype_info2_value['etype'].native == AES128_CTS_HMAC_SHA1_96_ENC_TYPE):
# XXX: Adding str just for mypy
return str(pa_etype_info2_value['salt'])
raise Exception("Could not retrieve salt from AS_REP (tag number %d)" % tag)
Expand Down
Loading