summaryrefslogtreecommitdiff
path: root/tests/test-remote-gpg-import.sh
Commit message (Collapse)AuthorAgeFilesLines
* Update FSF license notices to use URL instead of addressJoseph Marrero2021-12-071-3/+1
|
* tests/gpg: Add tests for importing updated remote GPG keysDan Nicholson2020-01-241-1/+60
| | | | | | | This checks whether gpg-import will properly update the keyring for a key that already exists. In particular, we check that changing the key expiration time or revoking it results in commit verification failure after re-importing the keys.
* lib/gpg: Add more specific OstreeGpgError codesDan Nicholson2020-01-241-3/+3
| | | | | | | | | | | | | | | | | Currently `ostree_gpg_verify_result_require_valid_signature` always returns an error that the key used for the signature is missing from the keyring. However, all that's been determined is that there are no valid signatures. The error could also be from an expired signature, an expired key, a revoked key or an invalid signature. Provide values for these missing errors and return them from `ostree_gpg_verify_result_require_valid_signature`. The description of each result is appended to the error message, but since the result can contain more than one signature but only a single error can be returned, the status of the last signature is used for the error code. See the comment for rationale. Related: flatpak/flatpak#1450
* tests: Always cleanup gpg-agent when exitingDan Nicholson2019-06-191-2/+0
| | | | | | | | | | | | | | | | Add `libtest_cleanup_gpg()` to the array of commands to run when exiting. This provides 2 improvements: 1. You don't need to worry about whether the test will spawn a gpg-agent and therefore require adding a call to `libtest_cleanup_gpg()`. 2. All the existing users were calling `libtest_cleanup_gpg()` at the end of the script. If there was a failure and the script exited early, then it wouldn't cleanup and there may be a stray gpg-agent hanging around. Closes: #1799 Approved by: cgwalters
* lib/repo: Search a list of paths in gpgkeypath for gpg keysrfairley2018-11-211-0/+73
| | | | | | | | | | | | | | | | | | 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
* tree-wide: Replace archive-z2 with archiveColin Walters2017-09-011-1/+1
| | | | | | | | | | | | In almost all places. There are just a few exceptions; one tricky bit for example is that the repo config must still have `mode=archive-z2`, since `archive` used to mean something else. (We could very likely just get rid of that check, but eh, later). I also added a test that one can still do `ostree repo init --mode=archive-z2`. Closes: #1125 Approved by: jlebon
* core: Fix default value of disable_xattrsColin Walters2017-04-041-1/+1
| | | | | | | Sigh. Rather awful regression from https://github.com/ostreedev/ostree/pull/759 Closes: #775 Approved by: jlebon
* pull: Do GPG verify commit objects when using deltasColin Walters2016-11-211-1/+36
| | | | | | | | | | | | | | | | | | | | | | | The fact that we weren't doing this is at best an oversight, and for some deployment models a security vulnerability. Having both `gpg-verify` and `gpg-verify-summary` shows that we were intending them to be orthogonal/independent. Lately I've been advocating moving towards pinned TLS instead of gpg-signed summaries, and if we follow that path, performing GPG verification of commit objects even if using deltas is more important, as it provides an at-rest verifiable authenticity and integrity mechanism. Content providers which are signing their summary files and/or using TLS (particularly pinned TLS) for transport should treat this as a nice-to-have. However, for providers which are serving content over plain HTTP and relying on GPG, this is a critical update. Closes: https://github.com/ostreedev/ostree/issues/517 Closes: #589 Approved by: jlebon
* Add "gpgkeypath" option to remotesColin Walters2016-11-171-2/+29
| | | | | | | | | | | | | | | | 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
* tests: Make failing to kill the GPG agent non-fatalColin Walters2016-03-311-1/+1
| | | | | | | | | | | | | It's not working for me in `make check` on a RHEL 7 Workstation, apparently because no GPG agent is spawned. I'm guessing this has something to do with the GPG version? The downside of this is we will be less likely to notice if GPG changes again and we start leaking agents like we're in The Matrix Reloaded. But the real solution to that is containers anyways. Closes: #233 Approved by: smcv
* In tests that use gpg, terminate the gpg-agent after testingSimon McVittie2016-03-311-0/+1
| | | | | | | | | Otherwise we leak those processes. Signed-off-by: Simon McVittie <smcv@debian.org> Closes: #232 Approved by: cgwalters
* tests: Port to glib-tap.mk, make `make check` run all of the testsColin Walters2016-03-031-0/+4
| | | | | | | | | | | | | | | | | | OSTree's code for testing predates the `glib-tap.mk` making its way into GLib. Let's switch to it, as it provides a number of advantages. By far the biggest advantage is that `make check` can start to run most of the tests *in addition* to having them work installed. This commit keeps the installed tests working, but `make check` turns out to be really broken because...our TAP usage has bitrotted to say the least. Fix that all up. Do some hacks so that the tests work uninstalled as well - in particular, `glib-tap.mk` and the bits encoded into `g_test_build_filename()` assume *recursive* Automake (blah). Work around that by creating a symlink when installed to loop back.
* tests: Use "bash strict mode"Colin Walters2016-01-271-1/+1
| | | | | | | | | | I noticed in the static deltas tests, there were some tests that should have been under `-o pipefail` to ensure we properly propagate errors. There were a few places where we were referencing undefined variables. Overall, this is clearly a good idea IMO.
* tests: Use temporary gpg homedirDan Nicholson2015-06-041-12/+12
| | | | | | | libtest always makes a copy of the gpghome directory to the test directory, so there's no need to operate on the installed copy. This allows test-remote-gpg-import to pass as an unprivileged user since it otherwise couldn't create the temp files gpgme creates.
* tests/remote-gpg-import: Only commit workdirColin Walters2015-06-021-3/+3
| | | | | | | | Just noticed this while debugging something else. We don't want to commit the whole test dir, just the workdir. Trying to commit the repo itself is potentially subject to race conditions at least.
* tests: Add test-remote-gpg-import.shMatthew Barnes2015-05-131-0/+142