Hi,
I've written an article on signing FreeBSD pkg repositories with a GPG key on a YubiKey. The approach uses
The article also documents parts of pkg's signing protocol that I had to piece together from the source code — the double-hash verification scheme in libpkg/pkgsign_ossl.c, the stdin behavior in libpkg/pkg_repo_create.c, and the fingerprint computation in libpkg/pkg_repo.c.
I'd appreciate feedback on whether there are any security concerns with this approach — particularly around the GPG agent forwarding and the way the signing script interacts with
Full article: Signing FreeBSD pkg Repositories with a YubiKey
Signing script (Python): sign-repo.py
Full disclosure: I came up with the idea to use
Best,
-Brendan
I've written an article on signing FreeBSD pkg repositories with a GPG key on a YubiKey. The approach uses
gpg-connect-agent PKSIGN for raw RSA signatures (since gpg --sign produces OpenPGP format instead of the PKCS#1 v1.5 that pkg expects) and SSH remote forwarding ( ssh -R) to keep the YubiKey on a local workstation while pkg repo runs on a remote FreeBSD build host.The article also documents parts of pkg's signing protocol that I had to piece together from the source code — the double-hash verification scheme in libpkg/pkgsign_ossl.c, the stdin behavior in libpkg/pkg_repo_create.c, and the fingerprint computation in libpkg/pkg_repo.c.
I'd appreciate feedback on whether there are any security concerns with this approach — particularly around the GPG agent forwarding and the way the signing script interacts with
gpg-agent.Full article: Signing FreeBSD pkg Repositories with a YubiKey
Signing script (Python): sign-repo.py
Full disclosure: I came up with the idea to use
gpg-connect-agent for the raw RSA signatures, and Claude Code did the rest — writing the signing script, the article, and verifying claims against the pkg source code. I use Claude Code extensively in my professional and private life. If you'd like to discuss that, feel free to connect with me on LinkedIn — happy to chat there.Best,
-Brendan