Skip to content

feat(verify): native OpenPGP + SSH signature verification (no gpg/ssh-keygen) - #97

Merged
mizchi merged 1 commit into
mainfrom
claude/bold-mendel-2d7ygx
Jun 26, 2026
Merged

feat(verify): native OpenPGP + SSH signature verification (no gpg/ssh-keygen)#97
mizchi merged 1 commit into
mainfrom
claude/bold-mendel-2d7ygx

Conversation

@mizchi

@mizchi mizchi commented Jun 26, 2026

Copy link
Copy Markdown
Member

Summary

Adds native verification of commit/tag signatures so bit can verify OpenPGP and SSH signatures without shelling out to gpg or ssh-keygen.

  • New bitx_openpgp module (ext layer) implementing native OpenPGP + SSH signature verification.
  • signing_helpers.mbt in cmd/bit wires the native verifier into the signing/verify path.
  • Public key source is configured via gpg.openpgpKeyringFile config (or the BIT_OPENPGP_KEYRING env var) holding an armored public key. When unset, behavior is unchanged and verification falls back to gpg.
  • Native SSH verification is opt-in via gpg.nativeVerify; default behavior is preserved.

Layering

bitx_openpgp sits in the ext layer and is consumed by cmd/bit, so dependencies still flow downward (core → mid → high → ext → cmd).

Testing

  • Whitebox tests verify OpenPGP and SSH signatures against fixtures produced by real gpg and ssh-keygen output.
  • Verified builds across native, js, and wasm backends.

Notes

🤖 Generated with Claude Code


Generated by Claude Code

…-keygen)

Add a new bitx_openpgp module that verifies detached OpenPGP and SSHSIG
signatures in pure MoonBit via mizchi/experimental_crypto, so commit/tag
signature verification no longer requires shelling out to gpg or ssh-keygen
(and works on native/js/wasm alike).

- bitx_openpgp: verify_detached_armored (OpenPGP) + verify_ssh_detached
  (SSHSIG, namespace "git"), each validated against real GnuPG and
  ssh-keygen signatures in whitebox tests.
- cmd/bit signing_helpers: signing_verify_payload now prefers native
  verification, falling back to the external program otherwise:
    * OpenPGP — native when gpg.openpgpKeyringFile (or BIT_OPENPGP_KEYRING)
      points to a file of ASCII-armored public keys; else gpg.
    * SSH — native when gpg.nativeVerify=true (or BIT_NATIVE_VERIFY) and
      gpg.ssh.allowedSignersFile is set; else ssh-keygen.
  This covers verify-commit, verify-tag and log --show-signature.

Default behavior is unchanged (external programs) unless a native key source
is configured. Verified end-to-end: bit verify-commit validates a real
gpg-signed commit with only the native path.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WHFC6qxKjqjrixgjFtGihM
@mizchi
mizchi merged commit 5ca5004 into main Jun 26, 2026
21 checks passed
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.

2 participants