feat(verify): native OpenPGP + SSH signature verification (no gpg/ssh-keygen) - #97
Merged
Conversation
…-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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds native verification of commit/tag signatures so
bitcan verify OpenPGP and SSH signatures without shelling out togpgorssh-keygen.bitx_openpgpmodule (extlayer) implementing native OpenPGP + SSH signature verification.signing_helpers.mbtincmd/bitwires the native verifier into the signing/verify path.gpg.openpgpKeyringFileconfig (or theBIT_OPENPGP_KEYRINGenv var) holding an armored public key. When unset, behavior is unchanged and verification falls back togpg.gpg.nativeVerify; default behavior is preserved.Layering
bitx_openpgpsits in theextlayer and is consumed bycmd/bit, so dependencies still flow downward (core → mid → high → ext → cmd).Testing
gpgandssh-keygenoutput.Notes
🤖 Generated with Claude Code
Generated by Claude Code