[seahorse] pgp: Fix setting key trust to "never"
- From: Stefan Walter <stefw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [seahorse] pgp: Fix setting key trust to "never"
- Date: Mon, 13 Dec 2010 10:05:11 +0000 (UTC)
commit 5bb9786c52a13463d8f172cf7fa2c57c7bd0362d
Author: nobled <nobled dreamwidth org>
Date: Mon Feb 22 16:08:09 2010 +0000
pgp: Fix setting key trust to "never"
The value of NEVER is less than UNKNOWN in
libcryptui/cryptui.h, so don't use UNKNOWN as the minimum
trust level. Fixes a comparison of a SeahorseValidity type
with a gpgme_validity_t. Also make the documentation accurate,
and make the relative ordering clearer in the code.
Thanks to Pablo Castellano for debugging.
Closes: bgo#609344.
libseahorse/seahorse-validity.h | 2 +-
pgp/seahorse-gpgme-key-op.c | 18 +++++++++---------
2 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/libseahorse/seahorse-validity.h b/libseahorse/seahorse-validity.h
index cfcbc8e..4582dbb 100644
--- a/libseahorse/seahorse-validity.h
+++ b/libseahorse/seahorse-validity.h
@@ -32,8 +32,8 @@
typedef enum {
SEAHORSE_VALIDITY_REVOKED = CRYPTUI_VALIDITY_REVOKED,
SEAHORSE_VALIDITY_DISABLED = CRYPTUI_VALIDITY_DISABLED,
- SEAHORSE_VALIDITY_UNKNOWN = CRYPTUI_VALIDITY_UNKNOWN,
SEAHORSE_VALIDITY_NEVER = CRYPTUI_VALIDITY_NEVER,
+ SEAHORSE_VALIDITY_UNKNOWN = CRYPTUI_VALIDITY_UNKNOWN,
SEAHORSE_VALIDITY_MARGINAL = CRYPTUI_VALIDITY_MARGINAL,
SEAHORSE_VALIDITY_FULL = CRYPTUI_VALIDITY_FULL,
SEAHORSE_VALIDITY_ULTIMATE = CRYPTUI_VALIDITY_ULTIMATE
diff --git a/pgp/seahorse-gpgme-key-op.c b/pgp/seahorse-gpgme-key-op.c
index 37d7c48..0c41f9c 100644
--- a/pgp/seahorse-gpgme-key-op.c
+++ b/pgp/seahorse-gpgme-key-op.c
@@ -821,12 +821,12 @@ edit_trust_transit (guint current_state, gpgme_status_code_t status,
/**
* seahorse_gpgme_key_op_set_trust:
- * @skey: #SeahorseKey whose trust will be changed
- * @trust: New trust value that must be at least #SEAHORSE_VALIDITY_UNKNOWN.
- * If @skey is a #SeahorseKeyPair, then @trust cannot be #SEAHORSE_VALIDITY_UNKNOWN.
- * If @skey is not a #SeahorseKeyPair, then @trust cannot be #SEAHORSE_VALIDITY_ULTIMATE.
+ * @pkey: #SeahorseGpgmeKey whose trust will be changed
+ * @trust: New trust value that must be at least #SEAHORSE_VALIDITY_NEVER.
+ * If @pkey is a #SeahorseKeyPair, then @trust cannot be #SEAHORSE_VALIDITY_UNKNOWN.
+ * If @pkey is not a #SeahorseKeyPair, then @trust cannot be #SEAHORSE_VALIDITY_ULTIMATE.
*
- * Tries to change the owner trust of @skey to @trust.
+ * Tries to change the owner trust of @pkey to @trust.
*
* Returns: Error value
**/
@@ -839,7 +839,7 @@ seahorse_gpgme_key_op_set_trust (SeahorseGpgmeKey *pkey, SeahorseValidity trust)
DEBUG_OPERATION(("[GPGME_KEY_OP] set_trust: trust = %i",trust));
g_return_val_if_fail (SEAHORSE_IS_GPGME_KEY (pkey), GPG_E (GPG_ERR_WRONG_KEY_USAGE));
- g_return_val_if_fail (trust >= GPGME_VALIDITY_UNKNOWN, GPG_E (GPG_ERR_INV_VALUE));
+ g_return_val_if_fail (trust >= SEAHORSE_VALIDITY_NEVER, GPG_E (GPG_ERR_INV_VALUE));
g_return_val_if_fail (seahorse_gpgme_key_get_trust (pkey) != trust, GPG_E (GPG_ERR_INV_VALUE));
if (seahorse_object_get_usage (SEAHORSE_OBJECT (pkey)) == SEAHORSE_USAGE_PRIVATE_KEY)
@@ -848,12 +848,12 @@ seahorse_gpgme_key_op_set_trust (SeahorseGpgmeKey *pkey, SeahorseValidity trust)
g_return_val_if_fail (trust != SEAHORSE_VALIDITY_ULTIMATE, GPG_E (GPG_ERR_INV_VALUE));
switch (trust) {
- case SEAHORSE_VALIDITY_UNKNOWN:
- menu_choice = GPG_UNKNOWN;
- break;
case SEAHORSE_VALIDITY_NEVER:
menu_choice = GPG_NEVER;
break;
+ case SEAHORSE_VALIDITY_UNKNOWN:
+ menu_choice = GPG_UNKNOWN;
+ break;
case SEAHORSE_VALIDITY_MARGINAL:
menu_choice = GPG_MARGINAL;
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]