summaryrefslogtreecommitdiff
path: root/src/libostree/ostree-repo-pull-verify.c
Commit message (Collapse)AuthorAgeFilesLines
* Update FSF license notices to use URL instead of addressJoseph Marrero2021-12-071-3/+1
|
* Add an API to verify a commit signature explicitlyColin Walters2021-08-301-0/+115
| | | | | | | | | | | | | We have a bunch of APIs to do GPG verification of a commit, but that doesn't generalize to signapi. Further, they require the caller to check the signature status explicitly which seems like a trap. This much higher level API works with both GPG and signapi. The intention is to use this in things that are doing "external pulls" like the ostree-ext tar import support. There we will get the commitmeta from the tarball and we want to verify it at the same time we import the commit.
* signapi: Change API to also return a success messageColin Walters2020-06-171-7/+14
| | | | | | | | | | | | | | | | | | | This is the dual of https://github.com/ostreedev/ostree/pull/2129/commits/1f3c8c5b3de978f6e069c24938967f823cce7ee8 where we output more detail when signapi fails to validate. Extend the API to return a string for success, which we output to stdout. This will help the test suite *and* end users validate that the expected thing is happening. In order to make this cleaner, split the "verified commit" set in the pull code into GPG and signapi verified sets, and have the signapi verified set contain the verification string. We're not doing anything with the verification string in the pull code *yet* but I plan to add something like `ostree pull --verbose` which would finally print this.
* pull: Add support for sign-verify=<list>Colin Walters2020-05-221-22/+114
| | | | | | | | | | | | | | | | | | | | | The goal here is to move the code towards a model where the *client* can explicitly specify which signature types are acceptable. We retain support for `sign-verify=true` for backwards compatibility. But in that configuration, a missing public key is just "no signatures found". With `sign-verify=ed25519` and no key configured, we can explicitly say `No keys found for required signapi type ed25519` which is much, much clearer. Implementation side, rather than maintaining `gboolean sign_verify` *and* `GPtrArray sign_verifiers`, just have the array. If it's `NULL` that means not to verify. Note that currently, an explicit list is an OR of signatures, not AND. In practice...I think most people are going to be using a single entry anyways.
* pull: Further cleanup signapi verificationColin Walters2020-05-121-13/+28
| | | | | | | | | | | | | | | | | | Previously in the pull code, every time we went to verify a commit we would re-initialize an `OstreeSign` instance of each time, re-parse the remote configuration and re-load its public keys etc. In most cases this doesn't matter really because we're pulling one commit, but if e.g. pulling a commit with history would get a bit silly. This changes things so that the pull code initializes the verifiers once, and reuses them thereafter. This is continuing towards changing the code to support explicitly configured verifiers, xref https://github.com/ostreedev/ostree/issues/2080
* signing: Change API to create instances directlyColin Walters2020-05-101-26/+11
| | | | | | | This cleans up the verification code; it was weird how we'd get the list of known names and then try to create an instance from it (and throw an error if that failed, which couldn't happen).
* lib: Move gpg/signapi bits into ostree-repo-pull-verify.cColin Walters2020-04-181-0/+302
`ostree-repo-pull.c` is huge; separate some of the GPG/signing verification functions into their own file so they're more easily seen.