Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gateway/platforms/weixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1416,7 +1416,7 @@ async def _process_message(self, message: Dict[str, Any]) -> None:
item_list = message.get("item_list") or []
text = _extract_text(item_list)
if text:
content_key = f"content:{sender_id}:{hashlib.md5(text.encode()).hexdigest()}"
content_key = f"content:{sender_id}:{hashlib.md5(text.encode(), usedforsecurity=False).hexdigest()}"
if self._dedup.is_duplicate(content_key):
logger.debug("[%s] Content-dedup: skipping duplicate message from %s", self.name, sender_id)
return
Expand Down Expand Up @@ -2115,7 +2115,7 @@ async def _send_file(
filekey = secrets.token_hex(16)
aes_key = secrets.token_bytes(16)
rawsize = len(plaintext)
rawfilemd5 = hashlib.md5(plaintext).hexdigest()
rawfilemd5 = hashlib.md5(plaintext, usedforsecurity=False).hexdigest()
upload_response = await _get_upload_url(
self._send_session,
base_url=self._base_url,
Expand Down
4 changes: 2 additions & 2 deletions hermes_cli/web_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -11490,7 +11490,7 @@ def _mcp_install_action_name(name: str) -> str:
re-click or a second catalog install doesn't overwrite the first's tracked
process/log while its git clone is still running."""
slug = re.sub(r"[^a-z0-9]+", "-", name.lower()).strip("-")[:48] or "server"
digest = hashlib.sha1(name.encode()).hexdigest()[:8]
digest = hashlib.sha1(name.encode(), usedforsecurity=False).hexdigest()[:8]
action = f"mcp-install-{slug}-{digest}"
_ACTION_LOG_FILES.setdefault(action, f"action-{action}.log")
return action
Expand Down Expand Up @@ -12430,7 +12430,7 @@ def _hub_action_name(verb: str, key: str) -> str:
(readable) + hash (collision-proof) keys each action to its own row.
"""
slug = re.sub(r"[^a-z0-9]+", "-", key.lower()).strip("-")[:48] or "skill"
digest = hashlib.sha1(key.encode()).hexdigest()[:8]
digest = hashlib.sha1(key.encode(), usedforsecurity=False).hexdigest()[:8]
name = f"skills-{verb}-{slug}-{digest}"
_ACTION_LOG_FILES.setdefault(name, f"action-{name}.log")
return name
Expand Down
2 changes: 1 addition & 1 deletion tools/skills_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def _compute_relative_dest(skill_dir: Path, bundled_dir: Path) -> Path:

def _dir_hash(directory: Path) -> str:
"""Compute a hash of all file contents in a directory for change detection."""
hasher = hashlib.md5()
hasher = hashlib.md5(usedforsecurity=False)
try:
for fpath in sorted(directory.rglob("*")):
if fpath.is_file():
Expand Down
Loading