Skip to content

Commit

Permalink
groups -> groupdict
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettthomas committed Feb 14, 2020
1 parent ce0a473 commit 69883a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def test_hide_sensitive_values_hashes():
config = {"sasl.password": "unhashed password", "regular_key": "regular value"}
hashed_config = hide_sensitive_values(config)
hash_pattern = r"\$PBKDF2-HMAC-(?P<algo>[^:]+):(?P<salt>[^:]+):(?P<iterations>\d+)\$(?P<hash>\w+)"
groups = re.match(hash_pattern, hashed_config["sasl.password"]).groups()
groups = re.match(hash_pattern, hashed_config["sasl.password"]).groupdict()
recomputed_hash = hashlib.pbkdf2_hmac(
groups["algo"].lower(), b"unhashed password", bytes.fromhex(groups["salt"]), int(groups["iterations"])
)
Expand Down

0 comments on commit 69883a2

Please sign in to comment.