Skip to content

Commit 7ffbfa8

Browse files
committed
Python: Expand stdlib md5 tests with keyword-arguments
1 parent fa88f22 commit 7ffbfa8

File tree

1 file changed

+8
-0
lines changed
  • python/ql/test/experimental/library-tests/frameworks/stdlib

1 file changed

+8
-0
lines changed

python/ql/test/experimental/library-tests/frameworks/stdlib/test_md5.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
print(hasher.hexdigest())
66

77

8+
hasher = hashlib.md5(string=b"secret message") # $ MISSING: CryptographicOperation CryptographicOperationInput=b"secret message" CryptographicOperationAlgorithm=MD5
9+
print(hasher.hexdigest())
10+
11+
812
hasher = hashlib.md5()
913
hasher.update(b"secret") # $ MISSING: CryptographicOperation CryptographicOperationInput=b"secret" CryptographicOperationAlgorithm=MD5
1014
hasher.update(b" message") # $ MISSING: CryptographicOperation CryptographicOperationInput=b" message" CryptographicOperationAlgorithm=MD5
@@ -15,6 +19,10 @@
1519
print(hasher.hexdigest())
1620

1721

22+
hasher = hashlib.new('md5', data=b"secret message") # $ MISSING: CryptographicOperation CryptographicOperationInput=b"secret message" CryptographicOperationAlgorithm=MD5
23+
print(hasher.hexdigest())
24+
25+
1826
hasher = hashlib.new('md5')
1927
hasher.update(b"secret") # $ MISSING: CryptographicOperation CryptographicOperationInput=b"secret" CryptographicOperationAlgorithm=MD5
2028
hasher.update(b" message") # $ MISSING: CryptographicOperation CryptographicOperationInput=b" message" CryptographicOperationAlgorithm=MD5

0 commit comments

Comments
 (0)