diff options
author | Justus Winter <[email protected]> | 2017-05-31 12:33:45 +0000 |
---|---|---|
committer | Justus Winter <[email protected]> | 2017-06-01 10:09:43 +0000 |
commit | 8a012280e0f0a462c094d106355aa436fceb1b76 (patch) | |
tree | 894f6e525cbe50c8cc121a46069f213f58f0e6b5 /g10/keylist.c | |
parent | gpg: Fix compliance computation. (diff) | |
download | gnupg-8a012280e0f0a462c094d106355aa436fceb1b76.tar.gz gnupg-8a012280e0f0a462c094d106355aa436fceb1b76.zip |
gpg,common: Move the compliance framework.
* common/Makefile.am (common_sources): Add new files.
* common/compliance.c: New file. Move 'gnupg_pk_is_compliant' here,
and tweak it to not rely on types private to gpg.
* common/compliance.h: New file. Move the compliance enum here.
* g10/keylist.c (print_compliance_flags): Adapt callsite.
* g10/main.h (gnupg_pk_is_compliant): Remove prototype.
* g10/misc.c (gnupg_pk_is_compliant): Remove function.
* g10/options.h (opt): Use the new compliance enum.
* sm/keylist.c (print_compliance_flags): Use the common functions.
Signed-off-by: Justus Winter <[email protected]>
Diffstat (limited to 'g10/keylist.c')
-rw-r--r-- | g10/keylist.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/g10/keylist.c b/g10/keylist.c index e2b8fef05..4848bab64 100644 --- a/g10/keylist.c +++ b/g10/keylist.c @@ -44,6 +44,7 @@ #include "../common/mbox-util.h" #include "../common/zb32.h" #include "tofu.h" +#include "../common/compliance.h" static void list_all (ctrl_t, int, int); @@ -1180,14 +1181,19 @@ print_compliance_flags (PKT_public_key *pk, { int any = 0; + if (!keylength) + keylength = nbits_from_pk (pk); + if (pk->version == 5) { - es_fputs ("8", es_stdout); + es_fputs (gnupg_status_compliance_flag (CO_GNUPG), es_stdout); any++; } - if (gnupg_pk_is_compliant (CO_DE_VS, pk, keylength, curvename)) + if (gnupg_pk_is_compliant (CO_DE_VS, pk->pubkey_algo, pk->pkey, + keylength, curvename)) { - es_fputs (any? " 23":"23", es_stdout); + es_fprintf (es_stdout, any ? " %s" : "%s", + gnupg_status_compliance_flag (CO_DE_VS)); any++; } } |