Skip to content

Clear secret buffers with a wipe the compiler keeps; read-only CI token - #130

Merged
Neo-Desktop merged 1 commit into
mainfrom
claude/project-thread-6jr0mj
Dec 1, 2026
Merged

Neo-Desktop merged 1 commit into
mainfrom
claude/project-thread-6jr0mj

Conversation

@Neo-Desktop

Copy link
Copy Markdown
Collaborator

Requested by Sydney · project thread

Summary

This PR corrects the 7 open code scanning findings.

  • Call to memset may be deleted (1 finding, native-ssh/src/ppk.c): a compiler can remove a memset on a buffer that is not used again. A new function, wipe(), writes the zeros through a volatile pointer, thus the compiler keeps them. All 25 memset(…, 0, …) calls in ppk.c now use wipe(), not only the one in the finding. The result of each call does not change.
  • Workflow does not contain permissions (6 findings): android.yml and apple.yml now set permissions: contents: read. The jobs only read the repository. The signing keys come from the release environment, not from the token.

Test

  • native-ssh built with -Wall -Wextra -Werror (GCC, Linux). dmodemssh_test passes.
  • CI on this PR.

Generated by Claude Code

ppk.c cleared keys and other secret data with memset. A compiler can
remove a memset on a buffer that is not used again. A new function,
wipe(), writes the zeros through a volatile pointer, thus the compiler
keeps the writes. All the memset calls in ppk.c now use wipe(). The
result of each call does not change.

The Android and Apple workflows now set permissions: contents: read.
The jobs only read the repository. The signing keys come from the
release environment, not from the token.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRUrfg8fQaXPrMeiQ9h
Signed-off-by: Neo-Desktop <321592+Neo-Desktop@users.noreply.github.com>
@Neo-Desktop Neo-Desktop self-assigned this Dec 1, 2026
@Neo-Desktop
Neo-Desktop merged commit 2de00dd into main Dec 1, 2026
13 checks passed
@Neo-Desktop
Neo-Desktop deleted the claude/project-thread-6jr0mj branch December 1, 2026 07:29
Neo-Desktop added a commit that referenced this pull request Dec 1, 2026
GitHub's release-asset server sometimes sends HTTP 618 ("jwt:expired")
for a short time. One failed request stopped the configure step: the
libusb download in the Android build, release and device jobs, and the
Mbed TLS download in the Apple engine job and the native job (main
after #128 and #130, and the D-Modem bump pull request #129).

cmake/download.cmake has dmodem_download(), the same function as
D-Modem's (D-Modem/D-Modem#259). It tries the download again after 5,
10, 20 and 40 s and checks the SHA-256 on each attempt. libusb.cmake and
native-ssh's BundledLibssh.cmake now use it. ExternalProject unpacks the
local tarballs.

DMODEM_DOWNLOAD_CACHE (a CMake variable or an environment variable) is
a directory that keeps the tarballs. The Android and Apple jobs keep it
with actions/cache, so a build downloads them only when a version
changes.

Tested with a local server that fails the first request: the configure
step passes on the second attempt, and a second configure copies the
tarballs from the cache.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRU5FgB38hBPKmc9VHT
Signed-off-by: Neo-Desktop <321592+Neo-Desktop@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant