From e28f2fa5b31e90be72c2276f8cea3b22d309d406 Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Tue, 9 Feb 2021 16:00:20 +0900 Subject: Imported Upstream version 2.1.20 --- sm/Makefile.am | 2 +- sm/call-agent.c | 8 ++++---- sm/call-dirmngr.c | 4 ++-- sm/certchain.c | 4 ++-- sm/certcheck.c | 2 +- sm/certdump.c | 2 +- sm/certlist.c | 2 +- sm/certreqgen-ui.c | 6 +++--- sm/certreqgen.c | 2 +- sm/decrypt.c | 2 +- sm/delete.c | 2 +- sm/encrypt.c | 2 +- sm/export.c | 6 +++--- sm/fingerprint.c | 2 +- sm/gpgsm.c | 8 ++++---- sm/import.c | 6 +++--- sm/keydb.c | 2 +- sm/keylist.c | 22 +++++++++++++++++----- sm/misc.c | 4 ++-- sm/qualified.c | 2 +- sm/server.c | 4 ++-- sm/sign.c | 2 +- sm/verify.c | 2 +- 23 files changed, 55 insertions(+), 43 deletions(-) (limited to 'sm') diff --git a/sm/Makefile.am b/sm/Makefile.am index 4cfb246..ddc2e22 100644 --- a/sm/Makefile.am +++ b/sm/Makefile.am @@ -23,7 +23,7 @@ bin_PROGRAMS = gpgsm AM_CFLAGS = $(LIBGCRYPT_CFLAGS) $(KSBA_CFLAGS) $(LIBASSUAN_CFLAGS) -AM_CPPFLAGS = -I$(top_srcdir)/common -DKEYBOX_WITH_X509=1 +AM_CPPFLAGS = -DKEYBOX_WITH_X509=1 include $(top_srcdir)/am/cmacros.am if HAVE_W32_SYSTEM diff --git a/sm/call-agent.c b/sm/call-agent.c index 16a2497..0e47c14 100644 --- a/sm/call-agent.c +++ b/sm/call-agent.c @@ -33,11 +33,11 @@ #include "gpgsm.h" #include #include -#include "i18n.h" -#include "asshelp.h" +#include "../common/i18n.h" +#include "../common/asshelp.h" #include "keydb.h" /* fixme: Move this to import.c */ -#include "membuf.h" -#include "shareddefs.h" +#include "../common/membuf.h" +#include "../common/shareddefs.h" #include "passphrase.h" diff --git a/sm/call-dirmngr.c b/sm/call-dirmngr.c index 45303e8..5ee15b7 100644 --- a/sm/call-dirmngr.c +++ b/sm/call-dirmngr.c @@ -32,9 +32,9 @@ #include #include -#include "i18n.h" +#include "../common/i18n.h" #include "keydb.h" -#include "asshelp.h" +#include "../common/asshelp.h" struct membuf { diff --git a/sm/certchain.c b/sm/certchain.c index b3e8656..a361aca 100644 --- a/sm/certchain.c +++ b/sm/certchain.c @@ -34,8 +34,8 @@ #include "keydb.h" #include "../kbx/keybox.h" /* for KEYBOX_FLAG_* */ -#include "i18n.h" -#include "tlv.h" +#include "../common/i18n.h" +#include "../common/tlv.h" /* Object to keep track of certain root certificates. */ diff --git a/sm/certcheck.c b/sm/certcheck.c index 04b3917..1102bcc 100644 --- a/sm/certcheck.c +++ b/sm/certcheck.c @@ -31,7 +31,7 @@ #include #include "keydb.h" -#include "i18n.h" +#include "../common/i18n.h" /* Return the number of bits of the Q parameter from the DSA key diff --git a/sm/certdump.c b/sm/certdump.c index bd37da4..edee76f 100644 --- a/sm/certdump.c +++ b/sm/certdump.c @@ -37,7 +37,7 @@ #include #include "keydb.h" -#include "i18n.h" +#include "../common/i18n.h" struct dn_array_s { diff --git a/sm/certlist.c b/sm/certlist.c index bfc35ce..e493cda 100644 --- a/sm/certlist.c +++ b/sm/certlist.c @@ -32,7 +32,7 @@ #include #include "keydb.h" -#include "i18n.h" +#include "../common/i18n.h" static const char oid_kp_serverAuth[] = "1.3.6.1.5.5.7.3.1"; diff --git a/sm/certreqgen-ui.c b/sm/certreqgen-ui.c index b50d338..9772a3b 100644 --- a/sm/certreqgen-ui.c +++ b/sm/certreqgen-ui.c @@ -29,9 +29,9 @@ #include "gpgsm.h" #include -#include "i18n.h" -#include "ttyio.h" -#include "membuf.h" +#include "../common/i18n.h" +#include "../common/ttyio.h" +#include "../common/membuf.h" /* Prompt for lines and append them to MB. */ diff --git a/sm/certreqgen.c b/sm/certreqgen.c index fe35ea8..4431870 100644 --- a/sm/certreqgen.c +++ b/sm/certreqgen.c @@ -66,7 +66,7 @@ #include #include "keydb.h" -#include "i18n.h" +#include "../common/i18n.h" enum para_name diff --git a/sm/decrypt.c b/sm/decrypt.c index cda4d29..976bd12 100644 --- a/sm/decrypt.c +++ b/sm/decrypt.c @@ -31,7 +31,7 @@ #include #include "keydb.h" -#include "i18n.h" +#include "../common/i18n.h" struct decrypt_filter_parm_s { diff --git a/sm/delete.c b/sm/delete.c index 3536968..56d5b1f 100644 --- a/sm/delete.c +++ b/sm/delete.c @@ -31,7 +31,7 @@ #include #include "keydb.h" -#include "i18n.h" +#include "../common/i18n.h" /* Delete a certificate or an secret key from a key database. */ diff --git a/sm/encrypt.c b/sm/encrypt.c index 3a7d4bb..c43a9e6 100644 --- a/sm/encrypt.c +++ b/sm/encrypt.c @@ -32,7 +32,7 @@ #include #include "keydb.h" -#include "i18n.h" +#include "../common/i18n.h" struct dek_s { diff --git a/sm/export.c b/sm/export.c index d721d52..29a5ac3 100644 --- a/sm/export.c +++ b/sm/export.c @@ -31,9 +31,9 @@ #include #include "keydb.h" -#include "exechelp.h" -#include "i18n.h" -#include "sysutils.h" +#include "../common/exechelp.h" +#include "../common/i18n.h" +#include "../common/sysutils.h" #include "minip12.h" /* A table to store a fingerprint as used in a duplicates table. We diff --git a/sm/fingerprint.c b/sm/fingerprint.c index d8e8405..fbcec58 100644 --- a/sm/fingerprint.c +++ b/sm/fingerprint.c @@ -31,7 +31,7 @@ #include #include -#include "host2net.h" +#include "../common/host2net.h" /* Return the fingerprint of the certificate (we can't put this into diff --git a/sm/gpgsm.c b/sm/gpgsm.c index 34a9b96..bcf479a 100644 --- a/sm/gpgsm.c +++ b/sm/gpgsm.c @@ -35,11 +35,11 @@ #include "passphrase.h" #include "../common/shareddefs.h" #include "../kbx/keybox.h" /* malloc hooks */ -#include "i18n.h" +#include "../common/i18n.h" #include "keydb.h" -#include "sysutils.h" -#include "gc-opt-flags.h" -#include "asshelp.h" +#include "../common/sysutils.h" +#include "../common/gc-opt-flags.h" +#include "../common/asshelp.h" #include "../common/init.h" diff --git a/sm/import.c b/sm/import.c index b284b51..c7b65ad 100644 --- a/sm/import.c +++ b/sm/import.c @@ -31,9 +31,9 @@ #include #include "keydb.h" -#include "exechelp.h" -#include "i18n.h" -#include "sysutils.h" +#include "../common/exechelp.h" +#include "../common/i18n.h" +#include "../common/sysutils.h" #include "../kbx/keybox.h" /* for KEYBOX_FLAG_* */ #include "../common/membuf.h" #include "minip12.h" diff --git a/sm/keydb.c b/sm/keydb.c index 75f83ee..87fc12d 100644 --- a/sm/keydb.c +++ b/sm/keydb.c @@ -31,7 +31,7 @@ #include "gpgsm.h" #include "../kbx/keybox.h" #include "keydb.h" -#include "i18n.h" +#include "../common/i18n.h" static int active_handles; diff --git a/sm/keylist.c b/sm/keylist.c index 6db42e3..1b1a261 100644 --- a/sm/keylist.c +++ b/sm/keylist.c @@ -34,8 +34,8 @@ #include "keydb.h" #include "../kbx/keybox.h" /* for KEYBOX_FLAG_* */ -#include "i18n.h" -#include "tlv.h" +#include "../common/i18n.h" +#include "../common/tlv.h" struct list_external_parm_s { @@ -346,6 +346,14 @@ email_kludge (const char *name) } +/* Print the compliance flags to field 18. ALGO is the gcrypt algo + * number. NBITS is the length of the key in bits. */ +static void +print_compliance_flags (int algo, unsigned int nbits, estream_t fp) +{ + if (algo == GCRY_PK_RSA && nbits >= 2048) + es_fputs ("23", fp); +} /* List one certificate in colon mode */ @@ -496,6 +504,8 @@ list_cert_colon (ctrl_t ctrl, ksba_cert_t cert, unsigned int validity, print_capabilities (cert, fp); /* Field 13, not used: */ es_putc (':', fp); + /* Field 14, not used: */ + es_putc (':', fp); if (have_secret || ctrl->with_secret) { char *cardsn; @@ -504,18 +514,20 @@ list_cert_colon (ctrl_t ctrl, ksba_cert_t cert, unsigned int validity, if (!gpgsm_agent_keyinfo (ctrl, p, &cardsn) && (cardsn || ctrl->with_secret)) { - /* Field 14, not used: */ - es_putc (':', fp); /* Field 15: Token serial number or secret key indicator. */ if (cardsn) es_fputs (cardsn, fp); else if (ctrl->with_secret) es_putc ('+', fp); - es_putc (':', fp); } xfree (cardsn); xfree (p); } + es_putc (':', fp); /* End of field 15. */ + es_putc (':', fp); /* End of field 16. */ + es_putc (':', fp); /* End of field 17. */ + print_compliance_flags (algo, nbits, fp); + es_putc (':', fp); /* End of field 18. */ es_putc ('\n', fp); /* FPR record */ diff --git a/sm/misc.c b/sm/misc.c index 40e989f..1e2465f 100644 --- a/sm/misc.c +++ b/sm/misc.c @@ -29,8 +29,8 @@ #endif #include "gpgsm.h" -#include "i18n.h" -#include "sysutils.h" +#include "../common/i18n.h" +#include "../common/sysutils.h" #include "../common/tlv.h" #include "../common/sexp-parse.h" diff --git a/sm/qualified.c b/sm/qualified.c index 61b071c..718141e 100644 --- a/sm/qualified.c +++ b/sm/qualified.c @@ -26,7 +26,7 @@ #include #include "gpgsm.h" -#include "i18n.h" +#include "../common/i18n.h" #include diff --git a/sm/server.c b/sm/server.c index 0fadcad..37d66e2 100644 --- a/sm/server.c +++ b/sm/server.c @@ -29,8 +29,8 @@ #include "gpgsm.h" #include -#include "sysutils.h" -#include "server-help.h" +#include "../common/sysutils.h" +#include "../common/server-help.h" #define set_error(e,t) assuan_set_error (ctx, gpg_error (e), (t)) diff --git a/sm/sign.c b/sm/sign.c index 0ca575b..a153b51 100644 --- a/sm/sign.c +++ b/sm/sign.c @@ -32,7 +32,7 @@ #include #include "keydb.h" -#include "i18n.h" +#include "../common/i18n.h" /* Hash the data and return if something was hashed. Return -1 on error. */ diff --git a/sm/verify.c b/sm/verify.c index 1ac97cb..6c034e6 100644 --- a/sm/verify.c +++ b/sm/verify.c @@ -32,7 +32,7 @@ #include #include "keydb.h" -#include "i18n.h" +#include "../common/i18n.h" static char * strtimestamp_r (ksba_isotime_t atime) -- cgit v1.2.3