Skip to content

Commit

Permalink
Fix salt retrival with aes128-cts-hmac-sha1-96
Browse files Browse the repository at this point in the history
  • Loading branch information
vruello committed Jul 26, 2024
1 parent a49e13c commit a5201a8
Showing 1 changed file with 4 additions and 3 deletions.
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

0 comments on commit a5201a8

Please sign in to comment.