policies/password: fix symbols not being checked correctly
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
		| @ -70,9 +70,8 @@ class PasswordPolicy(Policy): | |||||||
|             return PolicyResult(False, self.error_message) |             return PolicyResult(False, self.error_message) | ||||||
|         if self.amount_symbols > 0: |         if self.amount_symbols > 0: | ||||||
|             count = 0 |             count = 0 | ||||||
|             for symbol in self.symbol_charset.split(): |             for symbol in self.symbol_charset: | ||||||
|                 if symbol in password: |                 count += password.count(symbol) | ||||||
|                     count += 1 |  | ||||||
|             if count < self.amount_symbols: |             if count < self.amount_symbols: | ||||||
|                 LOGGER.debug("password failed", reason="amount_symbols") |                 LOGGER.debug("password failed", reason="amount_symbols") | ||||||
|                 return PolicyResult(False, self.error_message) |                 return PolicyResult(False, self.error_message) | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 Jens Langhammer
					Jens Langhammer