Skip to content

Commit

Permalink
fix an exception when nt key cache is enabled but no max login attemp…
Browse files Browse the repository at this point in the history
…t is defined. (#8156)
  • Loading branch information
stgmsa authored Aug 6, 2024
1 parent cc924ee commit 4db4484
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions bin/pyntlm_auth/config_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,16 @@ def config_load():
print(f" NT key cache: expire value '{nt_key_cache_expire}' too large, set to maximum value: 864000")
nt_key_cache_expire = 864000

ad_old_password_allowed_period, error = get_int_value(ad_old_password_allowed_period)
if error is not None:
print(f" NT Key cache: unable to parse 'ad_old_password_allowed_period', cache disabled.")
nt_key_cache_enabled = False
break
if ad_old_password_allowed_period < 0 or ad_old_password_allowed_period > 99999:
print(f" NT Key cache: 'ad_old_password_allowed_period' ranges from 0..99999, cache disabled.")
nt_key_cache_enabled = False
break

ad_account_lockout_threshold, error = get_int_value(ad_account_lockout_threshold)
if error is not None:
print(" NT Key cache: can not parse 'ad_account_lockout_threshold', cache disabled.")
Expand Down Expand Up @@ -212,16 +222,6 @@ def config_load():
nt_key_cache_enabled = False
break

ad_old_password_allowed_period, error = get_int_value(ad_old_password_allowed_period)
if error is not None:
print(f" NT Key cache: unable to parse 'ad_old_password_allowed_period', cache disabled.")
nt_key_cache_enabled = False
break
if ad_old_password_allowed_period < 0 or ad_old_password_allowed_period > 99999:
print(f" NT Key cache: 'ad_old_password_allowed_period' ranges from 0..99999, cache disabled.")
nt_key_cache_enabled = False
break

max_allowed_attempts_per_device, error = get_int_value(max_allowed_attempts_per_device)
s_device = 'max_allowed_attempts_per_device'
s_threshold = 'ad_account_lockout_threshold'
Expand Down

0 comments on commit 4db4484

Please sign in to comment.