summaryrefslogtreecommitdiff
path: root/src/libostree/ostree-gpg-verifier.h
Commit message (Collapse)AuthorAgeFilesLines
* tree-wide: Run clang-formatColin Walters2023-05-021-51/+34
| | | | | This is a one-time tree wide reformatting to ensure consistency going forward.
* Update FSF license notices to use URL instead of addressJoseph Marrero2021-12-071-3/+1
|
* lib/repo: Add ostree_repo_remote_get_gpg_keys()Dan Nicholson2021-07-151-0/+6
| | | | | | | | | | | | | | | | This function enumerates the trusted GPG keys for a remote and returns an array of `GVariant`s describing them. This is useful to see which keys are collected by ostree for a particular remote. The same information can be gathered with `gpg`. However, since ostree allows multiple keyring locations, that's only really useful if you have knowledge of how ostree collects GPG keyrings. The format of the variants is documented in `OSTREE_GPG_KEY_GVARIANT_FORMAT`. This format is primarily a copy of selected fields within `gpgme_key_t` and its subtypes. The fields are placed within vardicts rather than using a more efficient tuple of concrete types. This will allow flexibility if more components of `gpgme_key_t` are desired in the future.
* lib/repo: Search a list of paths in gpgkeypath for gpg keysrfairley2018-11-211-0/+13
| | | | | | | | | | | | | | | | | | This allows specifying gpgpath as list of paths that can point to a file or a directory. If a directory path is given, paths to all regular files in the directory are added to the remote as gpg ascii keys. If the path is not a directory, the file is directly added (whether regular file, empty - errors will be reported later when verifying gpg keys e.g. when pulling). Adding the gpgkeypath property looks like: ostree --repo=repo remote add --set=gpgpath="/path/key1.asc,/path/keys.d" R1 https://example.com/some/remote/ostree/repo Closes #773 Closes: #1773 Approved by: cgwalters
* Add SPDX-License-Identifier to source filesMarcus Folkesson2018-01-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | SPDX License List is a list of (common) open source licenses that can be referred to by a “short identifier”. It has several advantages compared to the common "license header texts" usually found in source files. Some of the advantages: * It is precise; there is no ambiguity due to variations in license header text * It is language neutral * It is easy to machine process * It is concise * It is simple and can be used without much cost in interpreted environments like java Script, etc. * An SPDX license identifier is immutable. * It provides simple guidance for developers who want to make sure the license for their code is respected See http://spdx.org for further reading. Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com> Closes: #1439 Approved by: cgwalters
* lib/gpg: Print debug info when reading GPG keysMatthew Leeds2017-10-031-1/+2
| | | | | | | | | | | | This commit adds debug output whenever libostree reads GPG keys, which can come from different locations in the file system. This is especially helpful in debugging "GPG signatures found, but none are in trusted keyring" errors, which in my case was caused by OSTree looking in /usr/local/share/ostree/trusted.gpg.d/ rather than /usr/share/ostree/trusted.gpg.d/. Closes: #1241 Approved by: cgwalters
* tree-wide: Remove Emacs modelinesColin Walters2017-09-211-2/+1
| | | | | | | | | We added a `.dir-locals.el` in commit: 9a77017d87b74c5e2895cdd64ad098018929403f There's no need to have it per-file, with that people might think to add other editors, which is the wrong direction. Closes: #1206 Approved by: jlebon
* lib: Port gpg verification for remotes to fd-relativeColin Walters2017-08-081-2/+10
| | | | | | | | This was the last use of `repo->repodir` internally, and will help finally add `ostree_repo_open_at()`. Closes: #1034 Approved by: jlebon
* Add "gpgkeypath" option to remotesColin Walters2016-11-171-0/+3
| | | | | | | | | | | | | | | | For Project Atomic, we already have RPM signatures which use files in `/etc/pki/rpm-gpg`. It's convenient to simply bind the OSTree remote configuration to those file paths, rather than having duplicate key data. This does mean that we need to parse the files for verification, so we end up importing them into the verifier's temporary keyring, which is a bit ugly, but it's what other projects do. Closes: https://github.com/ostreedev/ostree/issues/573 Closes: #575 Approved by: giuseppe
* repo: Factor out setting up a GPG verifierKrzesimir Nowak2016-05-271-0/+5
| | | | | | | | | Moved out setting up a GPG verifier to a separate function, as I would like to use it for the any data verification function in the following commit. Closes: #310 Approved by: cgwalters
* repo: Change GPG verification policyMatthew Barnes2015-06-101-2/+5
| | | | | | | | | The global keyring directory (trusted.gpg.d) is deprecated. Only use it when a specified remote does NOT have its own keyring, or when verifying local repository objects. Note, because mixing in the global keyring directory is now an explicit choice, OstreeGpgVerifier no longer needs to implement GInitableIface.
* gpg: Fix _ostree_gpg_verifier_add_keyring()Matthew Barnes2015-05-011-4/+3
| | | | | | The function never fails, but its API makes it look like it can. Fortunately it's private, so just fix it.
* gpg: Add OstreeGpgVerifyResultMatthew Barnes2015-03-181-8/+6
| | | | | | | | | | Wrappers a referenced gpgme_verify_result_t so detailed verify results can be examined independently of executing a verify operation. _ostree_gpg_verifier_check_signature() now returns this object instead of a single valid/invalid boolean, but the idea is for OstreeRepo to also return this object for commit signature verification so it can be utilized at the CLI layer (and possibly by other programs).
* OstreeGpgVerifier: Take the signed data as a GBytesMatthew Barnes2015-03-161-1/+1
| | | | | | | | | Similar to c2b01ad. For some reason I was thinking the commit data still needed to be written to disk prior to verifying, but it's just another artifact of spawning gpgv2 (predates using GPGME). Makes for a nice cleanup in fetch_metadata_to_verify_delta_superblock() as well.
* OstreeGpgVerifier: Take the signature as a GBytesMatthew Barnes2015-03-061-1/+1
| | | | | | | | | | The signature data is in memory to begin with, so there's no need to write it to disk only to immediately read it back. Also, because the GPGME multi-keyring workaround is somewhat expensive to setup and teardown, concatenate all signatures into a single GBytes so _ostree_gpg_verifier_check_signature() is only called once. We're currently only looking for one valid signature anyway.
* gpg: Remove _ostree_gpg_verifier_set_homedir()Matthew Barnes2015-03-021-3/+0
| | | | Never called, and the setting is never applied anyway.
* trivial: Don't include config.h in headersColin Walters2013-10-151-1/+0
| | | | | This should be included by each .c file. This fixes using libostree from a "plain" project without config.h.
* pull: Verify commits with gpg signatures from detached metadataJeremy Whiting2013-09-291-0/+64
This uses gpgv for verification against DATADIR/ostree/pubring.gpg by default. The keyring can be overridden by specifying OSTREE_GPG_HOME. Add a unit test for commit signing with gpg key and verifying on pull; to implement this we ship a test GPG key generated with no password for Ostree Tester <test@test.com>. Change all of the existing tests to disable GPG verification.