1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00
Werner Koch b4345f7521
wkd: Fix client issue with leading or trailing spaces in user-ids.
* common/recsel.c (recsel_parse_expr): Add flag -t.
* common/stringhelp.c: Remove assert.h.
(strtokenize): Factor code out to do_strtokenize.
(strtokenize_nt): New.
(do_strtokenize): Add arg trim to support the strtokenize_nt.
* common/t-stringhelp.c (test_strtokenize_nt): New test cases.

* tools/wks-util.c (wks_list_key): Use strtokenize_nt and the recsel
flag -t.
--

This fixes a bug with user ids with leading spaces because:

wks-client lists all mail addresses from the key and matches them to the
requested mail address.

If there are several user-ids all with the same mail address
wks-client picks one of them and then extracts exactly that user id.
However, here it does not match by the mail address but by the full
user-id so that we can be sure that there will be only one user-id in
the final key.

The filter built expression unfortunately strips leading blanks but
requires a verbatim match.  Thus it won't find the user id again and
errors out.

The new -t flag and a non-trimming strtokenize solves the problem.

Signed-off-by: Werner Koch <wk@gnupg.org>
2021-08-20 09:18:22 +02:00
..
2020-09-24 10:37:41 +02:00
2018-10-25 16:53:05 -04:00
2015-10-28 10:20:17 +01:00
2021-01-11 14:19:06 +01:00
2020-02-18 18:07:46 -05:00
2021-08-11 11:50:41 +02:00
2015-11-17 12:50:22 +01:00
2017-04-28 10:06:33 +09:00
2021-03-10 12:33:08 +01:00
2017-02-21 13:11:46 -05:00
2018-10-25 16:53:05 -04:00
2018-10-25 16:53:05 -04:00
2019-04-16 13:24:10 +09:00
2021-05-20 14:31:23 +02:00
2019-07-12 12:11:26 +09:00
2020-02-18 18:07:46 -05:00
2016-03-02 14:27:30 +01:00
2018-10-25 16:53:05 -04:00
2018-10-24 15:56:18 -04:00
2020-11-05 11:19:15 -08:00
2019-10-01 10:32:31 +02:00
2018-10-24 15:56:18 -04:00
2020-02-18 18:07:46 -05:00
2020-02-18 18:07:46 -05:00
2020-02-18 18:07:46 -05:00
2020-09-11 15:23:22 +02:00
2020-04-24 15:37:48 +02:00
2021-08-11 11:50:41 +02:00
2017-02-21 13:11:46 -05:00

Common functionality used by all modules of GnuPG.