diff options
author | Werner Koch <wk@gnupg.org> | 2024-11-15 09:36:27 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2024-11-15 09:36:27 +0100 |
commit | 17b766b0a3d82b92bd02fce5b65ef02a801eafc7 (patch) | |
tree | 8a30d4f131d2a6eb44027af490bd05b93c5d4831 /tools/gpgconf.c | |
parent | gpg: Consider Kyber to be de-vs compliant. (diff) | |
download | gnupg2-17b766b0a3d82b92bd02fce5b65ef02a801eafc7.tar.xz gnupg2-17b766b0a3d82b92bd02fce5b65ef02a801eafc7.zip |
gpgconf: Include a minimal secure version in the --query-swdb output.
* tools/gpgconf.c (query_swdb): Parse the new minver tag.
Diffstat (limited to '')
-rw-r--r-- | tools/gpgconf.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/gpgconf.c b/tools/gpgconf.c index 08d1dc87d..749f0dafe 100644 --- a/tools/gpgconf.c +++ b/tools/gpgconf.c @@ -433,7 +433,7 @@ valid_swdb_name_p (const char *name) * 'c' :: The version is Current * 'n' :: The current version is already Newer than the * available one. - * urgency :: If the value is greater than zero an urgent update is required. + * minvers :: The minimal secure version. * error :: 0 on success or an gpg_err_code_t * Common codes seen: * GPG_ERR_TOO_OLD :: The SWDB file is to old to be used. @@ -464,6 +464,7 @@ query_swdb (estream_t out, const char *name, const char *current_version) gnupg_isotime_t filedate = {0}; gnupg_isotime_t verified = {0}; char *value_ver = NULL; + char *value_minver = NULL; gnupg_isotime_t value_date = {0}; char *value_size = NULL; char *value_sha2 = NULL; @@ -566,6 +567,8 @@ query_swdb (estream_t out, const char *name, const char *current_version) value_size = xstrdup (fields[1]); else if (!strcmp (p, "sha2") && !value_sha2) value_sha2 = xstrdup (fields[1]); + else if (!strcmp (p, "minver") && !value_minver) + value_minver = xstrdup (fields[1]); } } if (len < 0 || es_ferror (fp)) @@ -616,10 +619,11 @@ query_swdb (estream_t out, const char *name, const char *current_version) else status = 'n'; - es_fprintf (out, "%s:%s:%c::%d:%s:%s:%s:%s:%lu:%s:\n", + es_fprintf (out, "%s:%s:%c:%s:%d:%s:%s:%s:%s:%lu:%s:\n", name, current_version? current_version : "", status, + value_minver? value_minver : value_ver, err, filedate, verified, @@ -629,6 +633,7 @@ query_swdb (estream_t out, const char *name, const char *current_version) value_sha2? value_sha2 : ""); leave: + xfree (value_minver); xfree (value_ver); xfree (value_size); xfree (value_sha2); |