-
Notifications
You must be signed in to change notification settings - Fork 14
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
Add --keyring and --fingerprint options #32
base: main
Are you sure you want to change the base?
Conversation
Should bmaptool error out if the user supplied the |
678925a
to
9053bcd
Compare
- detached and clear-signed data was swapped - instead of duplicating gnupghome and uids, use a global dictionary - export the keyring for each key in preparation for --keyring - store the fingerprint in the fpr attribute of a global dictionary - key name "imposter" is a misnomer, better is "unknown" - fix function name uknown -> unknown - export the "correct" GNUPGHOME as an environment variable - gpgv must be run with --output=- to write the signed text from a clearsigned file
9053bcd
to
0536cf7
Compare
Hi @JPEWdev, while rebasing this pull request on top of I'm looking forward to your thoughts on the new --fingerprint and --keyring options. |
0536cf7
to
d9e74c8
Compare
Would it make more sense to have an option to pass arbitrary arguments to gnupg instead of having to parrot and handle arguments for it? It's been a while since I've used gnupg so idk if that makes sense |
This would mean that the user would have to pass different options depending on which verification backend they like to use. For gpg, they would have to add Another argument in favour of convenience (i.e.: let bmaptool do extra magic) is that currently only gpg and gpgv are supported but alternative gpg implementations exist now for many years and a number of important projects are switching away from gpg these days. For example, since last week, apt uses sqv instead of gpgv for verification. This means, that the next Debian releases and its derivatives like Ubuntu will no longer have gpgv installed but will come with sqv by default. I want to add sqv support to bmaptool as well, but that's another pull request. :) Lastly, I personally become more and more frustrated with gpg and am welcoming the addition of alternative implementations. For example, I tried out the changes from bmaptool in the main branch as a Debian package and observed that now bmaptool fails to build as a Debian package. Why? It turns out that gpg-agent limits the socket path to 108 characters. This means that in a normal Debian build environment, gpg is not able to create a new key because it cannot connect to the gpg agent as the path to its socket is too long. Alternative implementations, like Stateless OpenPGP do not require a daemon process to run anymore to do key operations and do therefore not suffer from this issue. I'd like to add support for this. In summary: I think it would be really nice if bmaptool would try to be as convenient as possible and abstract away the implementation details of gpg, gpgv, sqv (sequoia) or sopv (rpgp) and just do the right thing automatically depending on which gpg verification tool is installed. (maybe slightly related to this is also the current mess surrounding the gpg schism which is happening with two different but conflicting gpg standards being developed independently from each other because they cannot agree on a common format ) |
Ya, that makes sense. I think your point all make sense to me. I also agree that gpg has been frustrating lately, so I would not mind replacing it :) I'm fine with this in principle, but @moto-timo and @twoerner should chime in if they have thoughts. Between work and FOSSDEM coming up, it might be a while before I can review this |
Ah I nearly would've made it to Brussels this year but work got in the way. XD I broke out the more important part of this pull request into its own pull request so that this can be discussed independently from the new commandline arguments for gpg keyring and fingerprint: #43 Enjoy FOSDEM! 😄 |
Also, for others reviewing this, this is how bmaptool looks in practice with this change:
In other words, this allows me, as a Debian Developer to release Debian system images which any user of Debian or its derivatives like Ubuntu can download and has a trust path from their locally installed (and thus also gpg verified) keyring to the image file I offer for download which is signed with one key inside the keyring. Since you already trust all the keys in the Debian keyring (because the software you have installed can be modified by any person in this keyring) the fingerprint option does not add much in this case but I think it's useful when using other keyrings to make sure that what is downloaded comes from the person I think it is from. |
Building on the work of #1 and #31 it is possible to further refactor the gpg verification code and add additional verification mechanisms other than using the python gpgme binding. With these changes, it is possible to pass a gpg keyring to bmaptool. So now I can instruct consumers of my disk images to run this:
And they will have the assurance that whatever they download, extract and copy to their disk was signed by the same gpg keys as their Debian OS. For even more paranoid people there is the --fingerprint option which forces the bmap file to be signed by the given fingerprint.
What do you think?