about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorStefan Kropp <stefan.kropp@posteo.de>2022-04-30 22:04:47 +0200
committerMichael Vetter <jubalh@iodoru.org>2022-05-03 23:00:11 +0200
commit62018f48c5f1a0410445fce5bca5fdd6a9e4d907 (patch)
tree6069e292923ec8d8d5570a7ed2d63be0bf147fd8
parent7acc044a527fd0d62afb4ff8742fc77e91f17e00 (diff)
downloadprofani-tty-62018f48c5f1a0410445fce5bca5fdd6a9e4d907.tar.gz
ox_key_is_usable - Logging and owner trust check
 * Added logging messages (INFO if key can not be used)
 * Check owner_trust < GPGME_VALIDITY_MARGINAL

The key can not be used if the owner_trust is less than MARGINAL.
-rw-r--r--src/pgp/gpg.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/pgp/gpg.c b/src/pgp/gpg.c
index 99d37c64..25704847 100644
--- a/src/pgp/gpg.c
+++ b/src/pgp/gpg.c
@@ -1110,6 +1110,12 @@ _ox_key_is_usable(gpgme_key_t key, const char* const barejid, gboolean secret)
     gboolean result = TRUE;
 
     if (key->revoked || key->expired || key->disabled) {
+        log_info("OX:  %s's key is revoked, expired or disabled", barejid);
+        result = FALSE;
+    }
+
+    if (key->owner_trust < GPGME_VALIDITY_MARGINAL) {
+        log_info("OX: Owner trust of %s's key is < GPGME_VALIDITY_MARGINAL", barejid);
         result = FALSE;
     }