@@ -6,7 +6,7 @@ private import experimental.cryptography.CryptoAlgorithmNames
6
6
private import experimental.cryptography.modules.stdlib.HashlibModule as HashlibModule
7
7
8
8
/**
9
- * `hmac` is a ptyhon standard library module for key-based hashing algorithms.
9
+ * `hmac` is a python standard library module for key-based hashing algorithms.
10
10
* https://docs.python.org/3/library/hmac.html
11
11
*/
12
12
// -----------------------------------------------
@@ -23,25 +23,27 @@ module Hashes {
23
23
24
24
DataFlow:: Node getDigestModParamSrc ( GenericHmacHashCall call ) {
25
25
result = Utils:: getUltimateSrcFromApiNode ( call .( API:: CallNode ) .getParameter ( 2 , "digestmod" ) )
26
+ or
27
+ result = Utils:: getUltimateSrcFromApiNode ( call .( API:: CallNode ) .getParameter ( 2 , "digest" ) )
26
28
}
27
29
28
30
/**
29
31
* This class captures the common behavior for all HMAC operations:
30
32
* hmac.HMAC https://docs.python.org/3/library/hmac.html#hmac.HMAC
31
33
* hmac.new https://docs.python.org/3/library/hmac.html#hmac.new
32
34
* hmac.digest https://docs.python.org/3/library/hmac.html#hmac.digest
33
- * These operations commonly set the algorithm as a string in the third argument (`digestmod`)
35
+ * These operations commonly set the algorithm as a string in the third argument (`digest` or ` digestmod`)
34
36
* of the operation itself.
35
37
*
36
- * NOTE: `digestmod` is the digest name, digest constructor or module for the HMAC object to use, however
38
+ * NOTE: `digest` or ` digestmod` is the digest name, digest constructor or module for the HMAC object to use, however
37
39
* this class only identifies string names. The other forms are found by CryptopgraphicArtifacts,
38
40
* modeled in `HmacHMACConsArtifact` and `Hashlib.qll`, specifically through hashlib.new and
39
41
* direct member accesses (e.g., hashlib.md5).
40
42
*
41
- * Where no `digestmod` exists, the algorithm is assumed to be `md5` per the docs found here:
43
+ * Where no `digest` or ` digestmod` exists, the algorithm is assumed to be `md5` per the docs found here:
42
44
* https://docs.python.org/3/library/hmac.html#hmac.new
43
45
*
44
- * Where `digestmod` exists but is not a string and not a hashlib algorithm, it is assumed
46
+ * Where `digest` or ` digestmod` exists but is not a string and not a hashlib algorithm, it is assumed
45
47
* to be `UNKNOWN`. Note this includes cases wheere the digest is provided as a `A module supporting PEP 247.`
46
48
* Such modules are currently not modeled.
47
49
*/
0 commit comments