summaryrefslogtreecommitdiff
path: root/tests/test-gpg-verify-result.c
Commit message (Collapse)AuthorAgeFilesLines
* tests/gpg: Test ostree_gpg_verify_result_require_valid_signatureDan Nicholson2020-01-241-0/+136
| | | | | | | Add explicit tests for `ostree_gpg_verify_result_require_valid_signature` in addition to the implicit tests via `ostree pull` and others. This allows checking the error code raised.
* tests/test-gpg-verify-result: Allow specifying signature filesDan Nicholson2020-01-241-21/+53
| | | | | | | | | | Currently tests are always run against the full lgpl2.sig file with all signatures, but it should also be possible to specify one or more of the individual lgpgl2.sig<N> files. Drop the current usage of passing the signature index in the test data since it's always specific to the test function and instead provide an optional array of signature files for the test fixture to sign with.
* tests/gpg-verify-data: Empty out trustdb.gpgDan Nicholson2020-01-241-2/+2
| | | | | | | | | | | | | | | | | | When the private keys were generated, gpg added an ultimate trust entry since you normally want to trust your own keys. However, this throws off the expired signature testing since gpgme considers it valid if the key is fully or ultimately trusted. The use of a trustdb for the test-gpg-verify-result is unlike any other GPG verification in ostree. Under normal circumstances, a temporary GPG homedir is created without any trust information, so all keys are treated as having unknown trust. Regenerate an empty trustdb.gpg in gpg-verify-data so that the tests behave as ostree normally operates. After this the expired signature testing correctly shows up as a non-valid signature. The trustdb was regenerated by simply removing it and running any gpg operation with the gpg-verify-data directory as the homedir.
* lib/gpg: Show information for expired keysDan Nicholson2019-06-191-12/+28
| | | | | | | | | Introduce a new signature attribute for the key expiration timestamp and display it when the key has a non-zero expiration time. Without this, the error shown is `BAD signature`, which isn't correct. Closes: #1872 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: 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/gpg: Add _FINGERPRINT_PRIMARY to OstreeGpgVerifyResultRobert McQueen2017-09-071-1/+1
| | | | | | | | | | | | Revert the switch of _FINGERPRINT to giving the primary key ID rather than the signing key ID, and instead add the primary key ID as a new attribute which is available if the key is not missing. Closes: https://github.com/ostreedev/ostree/issues/608 Closes: #1092 Approved by: cgwalters
* tree-wide: Convert to using autoptr(GString) vs g_string_free(...,TRUE)Colin Walters2017-05-051-2/+1
| | | | | | | | | | | If we're freeing the segment, it's basically always better to use `autoptr()`. Fewer lines, more reliable, etc. Noticed an instance of this in the pull code while reviewing a different PR, decided to do a grep for it and fix it tree wide. Closes: #836 Approved by: pwithnall
* Final excision of libgsystem dependencyColin Walters2016-08-091-1/+1
| | | | | | | | | | | | | | Lots and lots of preparation led to this moment - when nothing apparent changes for users! Woo! But seriously, having the extra dependency is a minor annoyance, and in the big picture I think the libgsystem idea was wrong - we need to land things in GLib, and use git submodules for API-unstable or Linux-specific sharing. For a lot of OSTree, the libgsystem `GFile*` orientation was also wrong, we really want fd-relative. Closes: #444 Approved by: jlebon
* tests: Port to glib-tap.mk, make `make check` run all of the testsColin Walters2016-03-031-1/+1
| | | | | | | | | | | | | | | | | | 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.
* Use g_autoptr(GVariant) instead of gs_unref_variantMatthew Barnes2015-05-061-6/+6
|
* Use g_autofree instead of gs_freeMatthew Barnes2015-05-061-2/+2
|
* gpg: Regenerate test data for test-gpg-verify-resultMatthew Barnes2015-03-191-28/+3
| | | | | | | | | | Turns out the expired signature case was failing because the signature itself was corrupted. Reconstructed the test data and updated the test code. Note, an expired signature is still counted as valid. Also, handy debugging trick for setting a key or signature expiry: the CLI makes it appear the shortest expiry is 1 day, but it also secretly recognizes "seconds=N".
* gpg: Add OstreeGpgVerifyResultMatthew Barnes2015-03-181-0/+457
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).