summaryrefslogtreecommitdiff
path: root/src/libostree/ostree-gpg-verify-result.h
diff options
context:
space:
mode:
authorDan Nicholson <nicholson@endlessm.com>2019-06-15 09:56:44 -0500
committerDan Nicholson <nicholson@endlessm.com>2020-01-24 13:02:17 -0700
commit0fbfc0b2079f32b919ae6b804bda40332e03b618 (patch)
treeb1d4eb254f500dcbd14a948b6b231748e1f6363d /src/libostree/ostree-gpg-verify-result.h
parent2c24f28ce45fe9c416650f004e30bcb97c76e0f0 (diff)
downloadostree-0fbfc0b2079f32b919ae6b804bda40332e03b618.tar.gz
lib/gpg: Add more specific OstreeGpgError codes
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
Diffstat (limited to 'src/libostree/ostree-gpg-verify-result.h')
-rw-r--r--src/libostree/ostree-gpg-verify-result.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libostree/ostree-gpg-verify-result.h b/src/libostree/ostree-gpg-verify-result.h
index 7c71ecdc..f71ab981 100644
--- a/src/libostree/ostree-gpg-verify-result.h
+++ b/src/libostree/ostree-gpg-verify-result.h
@@ -159,6 +159,11 @@ gboolean ostree_gpg_verify_result_require_valid_signature (OstreeGpgVerifyResult
* @OSTREE_GPG_ERROR_NO_SIGNATURE: A signature was expected, but not found.
* @OSTREE_GPG_ERROR_INVALID_SIGNATURE: A signature was malformed.
* @OSTREE_GPG_ERROR_MISSING_KEY: A signature was found, but was created with a key not in the configured keyrings.
+ * @OSTREE_GPG_ERROR_EXPIRED_SIGNATURE: A signature was expired. Since: 2019.7.
+ * @OSTREE_GPG_ERROR_EXPIRED_KEY: A signature was found, but the key used to
+ * sign it has expired. Since: 2019.7.
+ * @OSTREE_GPG_ERROR_REVOKED_KEY: A signature was found, but the key used to
+ * sign it has been revoked. Since: 2019.7.
*
* Errors returned by signature creation and verification operations in OSTree.
* These may be returned by any API which creates or verifies signatures.
@@ -169,6 +174,9 @@ typedef enum {
OSTREE_GPG_ERROR_NO_SIGNATURE = 0,
OSTREE_GPG_ERROR_INVALID_SIGNATURE,
OSTREE_GPG_ERROR_MISSING_KEY,
+ OSTREE_GPG_ERROR_EXPIRED_SIGNATURE,
+ OSTREE_GPG_ERROR_EXPIRED_KEY,
+ OSTREE_GPG_ERROR_REVOKED_KEY,
} OstreeGpgError;
/**