lib/gpg-verify: Add an OstreeGpgError error domain
Add a new error domain for GPG signing/verification errors, and use it throughout libostree for describing verification errors. This replaces various uses of G_IO_ERROR_FAILED, and one instance of G_IO_ERROR_NOT_FOUND (for which some code in ot-builtin-show.c had to be changed to ensure it was still handled correctly). The use of a separate error domain allows failures in GPG operations to be handled separately from network failures (where the summary file could not be found to be downloaded, for example) or timeouts. Signed-off-by: Philip Withnall <withnall@endlessm.com> Closes: #1064 Closes: #1071 Approved by: mbarnes
This commit is contained in:
1 parent
f1102763df
commit
75bce24cb9
7 files changed
+39
-11
No files matched your search
@@ -137,4 +137,25 @@ _OSTREE_PUBLIC
|
||||
gboolean ostree_gpg_verify_result_require_valid_signature (OstreeGpgVerifyResult *result,
|
||||
GError **error);
|
||||
|
||||
/**
|
||||
* OstreeGpgError:
|
||||
* @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.
|
||||
*
|
||||
* Errors returned by signature creation and verification operations in OSTree.
|
||||
* These may be returned by any API which creates or verifies signatures.
|
||||
*
|
||||
* Since: 2017.10
|
||||
*/
|
||||
typedef enum {
|
||||
OSTREE_GPG_ERROR_NO_SIGNATURE = 0,
|
||||
OSTREE_GPG_ERROR_INVALID_SIGNATURE,
|
||||
OSTREE_GPG_ERROR_MISSING_KEY,
|
||||
} OstreeGpgError;
|
||||
|
||||
_OSTREE_PUBLIC
|
||||
GQuark ostree_gpg_error_quark (void);
|
||||
#define OSTREE_GPG_ERROR (ostree_gpg_error_quark ())
|
||||
|
||||
G_END_DECLS
|
||||
Reference in new issue
Block a user