@@ -3848,33 +3848,6 @@ def decodeIntToUnicode(value):
38483848
38493849 return retVal
38503850
3851- def checkIntegrity ():
3852- """
3853- Checks integrity of code files during the unhandled exceptions
3854- """
3855-
3856- if not paths :
3857- return
3858-
3859- logger .debug ("running code integrity check" )
3860-
3861- retVal = True
3862-
3863- baseTime = os .path .getmtime (paths .SQLMAP_SETTINGS_PATH ) + 3600 # First hour free parking :)
3864- for root , _ , filenames in os .walk (paths .SQLMAP_ROOT_PATH ):
3865- for filename in filenames :
3866- if re .search (r"(\.py|\.xml|_)\Z" , filename ):
3867- filepath = os .path .join (root , filename )
3868- if os .path .getmtime (filepath ) > baseTime :
3869- logger .error ("wrong modification time of '%s'" % filepath )
3870- retVal = False
3871-
3872- suffix = extractRegexResult (r"#(?P<result>\w+)" , VERSION_STRING )
3873- if suffix and suffix not in {"dev" , "stable" }:
3874- retVal = False
3875-
3876- return retVal
3877-
38783851def getDaysFromLastUpdate ():
38793852 """
38803853 Get total number of days from last update
@@ -5600,14 +5573,15 @@ def checkSums():
56005573
56015574 retVal = True
56025575
5603- for entry in getFileItems (paths .DIGEST_FILE ):
5604- match = re .search (r"([0-9a-f]+)\s+([^\s]+)" , entry )
5605- if match :
5606- expected , filename = match .groups ()
5607- filepath = os .path .join (paths .SQLMAP_ROOT_PATH , filename )
5608- checkFile (filepath )
5609- if not hashlib .sha256 (open (filepath , "rb" ).read ()).hexdigest () == expected :
5610- retVal &= False
5611- break
5576+ if paths .get ("DIGEST_FILE" ):
5577+ for entry in getFileItems (paths .DIGEST_FILE ):
5578+ match = re .search (r"([0-9a-f]+)\s+([^\s]+)" , entry )
5579+ if match :
5580+ expected , filename = match .groups ()
5581+ filepath = os .path .join (paths .SQLMAP_ROOT_PATH , filename )
5582+ checkFile (filepath )
5583+ if not hashlib .sha256 (open (filepath , "rb" ).read ()).hexdigest () == expected :
5584+ retVal &= False
5585+ break
56125586
56135587 return retVal
0 commit comments