gootsaud / bike-riding

Audit required: Insecure hash function PTC-W1003
Security
Major
a year agoa year old
Use of insecure sha1 hash function
617
618    @staticmethod
619    def get_template_key(name: str) -> str:
620        return "tmpl_" + sha1(name.encode("utf-8")).hexdigest()621
622    @staticmethod
623    def get_module_filename(name: str) -> str:
Use of insecure sha1 hash function
160
161    def get_source_checksum(self, source: str) -> str:
162        """Returns a checksum for the source."""
163        return sha1(source.encode("utf-8")).hexdigest()164
165    def get_bucket(
166        self,
Use of insecure sha1 hash function
151        self, name: str, filename: t.Optional[t.Union[str]] = None
152    ) -> str:
153        """Returns the unique hash key for this template name."""
154        hash = sha1(name.encode("utf-8"))155
156        if filename is not None:
157            hash.update(f"|{filename}".encode())