60 if func in insecureHashes: |
60 if func in insecureHashes: |
61 if keywords.get("usedforsecurity", "True") == "True": |
61 if keywords.get("usedforsecurity", "True") == "True": |
62 reportError( |
62 reportError( |
63 context.node.lineno - 1, |
63 context.node.lineno - 1, |
64 context.node.col_offset, |
64 context.node.col_offset, |
65 "S332", |
65 "S-332", |
66 "H", |
66 "H", |
67 "H", |
67 "H", |
68 func.upper(), |
68 func.upper(), |
69 ) |
69 ) |
70 elif func == "new": |
70 elif func == "new": |
112 name = args[1] if len(args) > 1 else keywords.get("salt") |
112 name = args[1] if len(args) > 1 else keywords.get("salt") |
113 if isinstance(name, str) and name in insecureHashes: |
113 if isinstance(name, str) and name in insecureHashes: |
114 reportError( |
114 reportError( |
115 context.node.lineno - 1, |
115 context.node.lineno - 1, |
116 context.node.col_offset, |
116 context.node.col_offset, |
117 "S331", |
117 "S-331", |
118 "M", |
118 "M", |
119 "H", |
119 "H", |
120 name.upper(), |
120 name.upper(), |
121 ) |
121 ) |
122 |
122 |
124 name = args[0] if args else keywords.get("method") |
124 name = args[0] if args else keywords.get("method") |
125 if isinstance(name, str) and name in insecureHashes: |
125 if isinstance(name, str) and name in insecureHashes: |
126 reportError( |
126 reportError( |
127 context.node.lineno - 1, |
127 context.node.lineno - 1, |
128 context.node.col_offset, |
128 context.node.col_offset, |
129 "S331", |
129 "S-331", |
130 "M", |
130 "M", |
131 "H", |
131 "H", |
132 name.upper(), |
132 name.upper(), |
133 ) |
133 ) |
134 |
134 |