-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide detached binary signatures #4966
Comments
I think you can solve this by running If that doesn't work, I'd be interested in seeing the PKGBUILD file. |
Unfortunately there is not much room in the PKGBUILD to execute arbitrary steps before the source files are automatically verified. I am currently working on a hack to trick the script into thinking it is unsigned, only to do the signature checking "manually" (still scripted) later. If that doesn't work, I'll recreate the initial "naive" PKGBUILD for v0.12.0 that breaks. In the meantime, you can see the old (v0.11.1) PKGBUILD at https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=lnd-bin&id=af46491b041c3694b1d7f555dda403679f1e1874 |
Alright, I was able to make it work. Minor security regression because now I can no longer pin the pgp pubkey fingerprints in the PKGBUILD, but that's something that needs to be fixed in makepkg. |
Reopening because on further investigation, cleartext signatures seem to have some pitfalls. From discussion on the makepkg bug report:
From the gpg manpages:
I've tested and it's possible to insert lines into |
Is this surprising behavior though? As long as the contents/hashes being changed invalidates the signature, then I'm not sure that there's an issue with it. |
It's one of those "not surprising if you think about it but it's easy to overlook" kind of things, which is probably the biggest reason for any security flaw to exist in software. For example, if I take a naive approach, and do
there will be a warning about improperly formatted lines, but I can choose to ignore those, expecting them to be the signature and pgp block demarcation. I might (naively, erroneously) expect there to be an error if any line was added to the .asc (outside of the signed block). There won't be. If github were to provide a message signed with roasbeef's pgp key that does not include any sha sums, and appended a sha256sum of a malicious binary, it could sneak it past this verification scheme. Couldn't quickly find one for roasbeef but e.g. I retrieved this message from guggero's keybase, signed with the same key as the releases:
(The content of the tar.gz is the text "malicious") The correct way of handling it is to output the contents of the signed message block after verifying it, before parsing it, but that leaves me wondering why not provide them separate in the first place, when that is less likely to lead to mistakes? Is there a reason why clearsigned manifests might be preferred over detached signatures? |
Further discussion on the Arch bug tracker indicates that manifests are suboptimal for automated checks, as they involve either upstream-specific filtering of the manifest lines, or using insecure The solution with least pitfalls is to provide detached signatures for the individual binary archives themselves. |
@setpill after looking into this, moving away from a manifest would be a much bigger change, but we've modified the signature/verification flow to use detached signatures. we're planning to tag an 0.12.1-beta.rc4 so that we can test out the new setup, would be great to get your feedback and see if this helps out your use case! |
Can confirm this works. I noticed that @Crypt-iQ has not linked their keybase and github accounts, so I've left checking of their signature out for now. |
Background
I'm trying to package the latest release for Arch (AUR package lnd-bin).
Unfortunately, makepkg assumes that anyDiscussion on Arch bug tracker indicates that lnd's binary signing scheme is unsupported.somefile.txt.asc
file is a signature forsomefile.txt
, whereas the different signed manifests are now self-contained. I intend to file a bug with makepkg about this, but in the meantime, would it be possible to provide separate manifests and signatures?Your environment
lnd
uname -a
on *Nix)btcd
,bitcoind
, or other backendSteps to reproduce
If needed I can share the PKGBUILD file, but it's a bit overkill to understand the problem at hand.
The text was updated successfully, but these errors were encountered: