aboutsummaryrefslogtreecommitdiffstats
path: root/src/keylist.c
diff options
context:
space:
mode:
authorJustus Winter <[email protected]>2017-05-30 12:35:57 +0000
committerJustus Winter <[email protected]>2017-06-01 12:16:11 +0000
commit05fa2a9c7764b28fdac35eb72631439df948ca0e (patch)
tree4fac29e23cd01185155e099fa93cbeda7f2bf933 /src/keylist.c
parentcore: Sort the status table. (diff)
downloadgpgme-05fa2a9c7764b28fdac35eb72631439df948ca0e.tar.gz
gpgme-05fa2a9c7764b28fdac35eb72631439df948ca0e.zip
Add flag 'is_de_vs' to decryption results and signatures.
* NEWS: Update. * lang/cpp/src/decryptionresult.cpp (DecryptionResult::isDeVs): New function. * lang/cpp/src/decryptionresult.h (DecryptionResult::isDeVs): New prototype. * lang/cpp/src/verificationresult.cpp (Signature::isDeVs): New function. * lang/cpp/src/verificationresult.h (Signature::isDeVs): New prototype. * lang/python/src/results.py (DecryptResult): Turn field 'is_de_vs' into a boolean. (Signature): Likewise. * src/decrypt.c (_gpgme_decrypt_status_handler): Handle the new compliance status line. * src/verify.c (_gpgme_verify_status_handler): Likewise. * src/gpgme.h.in (gpgme_status_code_t): Add new status codes for the new status lines. * src/keylist.c (parse_pub_field18): Move function to 'util.h'. (keylist_colon_handler): Adapt callsites. * src/status-table.c (status_table): Add new status lines. * src/util.h (PARSE_COMPLIANCE_FLAGS): New macro. This used to be 'parse_pub_field18', but turned into a macro to make it polymorphic. -- When decrypting data and verifying signatures, report whether the operations are in compliance with the criteria for data classified as VS-NfD. This information can the be presented to the user. GnuPG-bug-id: 3059 Signed-off-by: Justus Winter <[email protected]>
Diffstat (limited to 'src/keylist.c')
-rw-r--r--src/keylist.c21
1 files changed, 2 insertions, 19 deletions
diff --git a/src/keylist.c b/src/keylist.c
index e16ba4d1..5e1c61e6 100644
--- a/src/keylist.c
+++ b/src/keylist.c
@@ -416,23 +416,6 @@ parse_sec_field15 (gpgme_key_t key, gpgme_subkey_t subkey, char *field)
}
-/* Parse the compliance field. */
-static void
-parse_pub_field18 (gpgme_subkey_t subkey, char *field)
-{
- char *p, *endp;
- unsigned long ul;
-
- for (p = field; p && (ul = strtoul (p, &endp, 10)) && p != endp; p = endp)
- {
- switch (ul)
- {
- case 23: subkey->is_de_vs = 1; break;
- }
- }
-}
-
-
/* Parse a tfs record. */
static gpg_error_t
parse_tfs_record (gpgme_user_id_t uid, char **field, int nfield)
@@ -731,7 +714,7 @@ keylist_colon_handler (void *priv, char *line)
/* Field 18 has the compliance flags. */
if (fields >= 17 && *field[17])
- parse_pub_field18 (subkey, field[17]);
+ PARSE_COMPLIANCE_FLAGS (field[17], subkey);
if (fields >= 20)
{
@@ -814,7 +797,7 @@ keylist_colon_handler (void *priv, char *line)
/* Field 18 has the compliance flags. */
if (fields >= 17 && *field[17])
- parse_pub_field18 (subkey, field[17]);
+ PARSE_COMPLIANCE_FLAGS (field[17], subkey);
break;