eric6/Plugins/CheckerPlugins/CodeStyleChecker/Security/Checks/insecureHashlibNew.py

changeset 7615
ca2949b1a29a
parent 7614
646742c260bd
child 7619
ef2b5af23ce7
equal deleted inserted replaced
7614:646742c260bd 7615:ca2949b1a29a
13 # 13 #
14 # Original Copyright 2014 Hewlett-Packard Development Company, L.P. 14 # Original Copyright 2014 Hewlett-Packard Development Company, L.P.
15 # 15 #
16 # SPDX-License-Identifier: Apache-2.0 16 # SPDX-License-Identifier: Apache-2.0
17 # 17 #
18
19 from Security.SecurityDefaults import SecurityDefaults
18 20
19 21
20 def getChecks(): 22 def getChecks():
21 """ 23 """
22 Public method to get a dictionary with checks handled by this module. 24 Public method to get a dictionary with checks handled by this module.
45 @type dict 47 @type dict
46 """ 48 """
47 if config and "insecure_hashes" in config: 49 if config and "insecure_hashes" in config:
48 insecureHashes = [h.lower() for h in config["insecure_hashes"]] 50 insecureHashes = [h.lower() for h in config["insecure_hashes"]]
49 else: 51 else:
50 insecureHashes = ['md4', 'md5', 'sha', 'sha1'] 52 insecureHashes = SecurityDefaults["insecure_hashes"]
51 53
52 if isinstance(context.callFunctionNameQual, str): 54 if isinstance(context.callFunctionNameQual, str):
53 qualnameList = context.callFunctionNameQual.split('.') 55 qualnameList = context.callFunctionNameQual.split('.')
54 func = qualnameList[-1] 56 func = qualnameList[-1]
55 if 'hashlib' in qualnameList and func == 'new': 57 if 'hashlib' in qualnameList and func == 'new':

eric ide

mercurial