aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gpgme.h.in11
-rw-r--r--src/key.c1
-rw-r--r--src/keylist.c24
3 files changed, 35 insertions, 1 deletions
diff --git a/src/gpgme.h.in b/src/gpgme.h.in
index 0a90c8d2..6471f0ad 100644
--- a/src/gpgme.h.in
+++ b/src/gpgme.h.in
@@ -627,7 +627,13 @@ struct _gpgme_key_sig
unsigned int exportable : 1;
/* Internal to GPGME, do not use. */
- unsigned int _unused : 28;
+ unsigned int _unused : 12;
+
+ /* The depth of a trust signature, 0 if no trust signature. */
+ unsigned int trust_depth : 8;
+
+ /* The trust value of a trust signature, 0 if no trust signature. */
+ unsigned int trust_value : 8;
/* The public key algorithm used to create the signature. */
gpgme_pubkey_algo_t pubkey_algo;
@@ -644,6 +650,9 @@ struct _gpgme_key_sig
/* The expiration timestamp, 0 if the subkey does not expire. */
long int expires;
+ /* The scope of a trust signature. Might be NULL. */
+ char *trust_scope;
+
/* Same as in gpgme_signature_t. */
gpgme_error_t status;
diff --git a/src/key.c b/src/key.c
index e4b85774..322bd0ac 100644
--- a/src/key.c
+++ b/src/key.c
@@ -369,6 +369,7 @@ gpgme_key_unref (gpgme_key_t key)
notation = next_notation;
}
+ free (keysig->trust_scope);
free (keysig);
keysig = next_keysig;
}
diff --git a/src/keylist.c b/src/keylist.c
index a4de3ad5..42743f07 100644
--- a/src/keylist.c
+++ b/src/keylist.c
@@ -967,6 +967,30 @@ keylist_colon_handler (void *priv, char *line)
if (fields >= 7)
keysig->expires = _gpgme_parse_timestamp (field[6], NULL);
+ /* Field 8 has the trust depth and the trust value. */
+ if (fields >= 8 && *field[7])
+ {
+ const char *trust_depth = field[7];
+ char *trust_value = strchr (field[7] + 1, ' ');
+ if (trust_value)
+ *(trust_value++) = '\0';
+ if (trust_value)
+ {
+ int depth = atoi (trust_depth);
+ int value = atoi (trust_value);
+
+ if (depth >= 1 && depth < 256)
+ keysig->trust_depth = depth;
+ if (value >= 1 && value < 256)
+ keysig->trust_value = value;
+ }
+ }
+
+ /* Field 9 has the trust signature scope (a regular expression). */
+ if (fields >= 9)
+ if (_gpgme_decode_c_string (field[8], &keysig->trust_scope, 0))
+ return gpg_error (GPG_ERR_ENOMEM); /* FIXME */
+
/* Field 11 has the signature class (eg, 0x30 means revoked). */
if (fields >= 11)
if (field[10][0] && field[10][1])