Skip to content

Commit

Permalink
Small edit to hmac weak key doc (#391)
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Brown <eric.brown@securesauce.dev>
  • Loading branch information
ericwb committed Mar 27, 2024
1 parent a519096 commit e21de6a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions precli/rules/python/stdlib/hmac_weak_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
import secrets
key = secrets.token_bytes(None)
key = secrets.token_bytes(nbytes=32)
message = b"Hello, world!"
hmac.new(key, msg=message, digestmod=hashlib.sha3_384)
```
## Remediation
Adjust the key size to be least the length of the digest size.
Adjust the key size to be at least the size of the digest.
```python
import hashlib
Expand Down

0 comments on commit e21de6a

Please sign in to comment.