aboutsummaryrefslogtreecommitdiffstats
path: root/tools (unfollow)
Commit message (Collapse)AuthorFilesLines
2022-06-03Remove remaining support for WindowsCEWerner Koch3-33/+9
--
2022-06-02tools: Minor fix to gpg-connect-agent options.Werner Koch1-2/+2
* tools/gpg-connect-agent.c (enum cmd_and_opt_values): Move oUnBuffered more to the top so that oNoop won't not get the value 'v'.
2022-06-02tools: Add a way to cancell INQUIRE for gpg-connect-agent.NIIBE Yutaka1-5/+7
* tools/gpg-connect-agent.c (handle_inquire): When the helper program exit status is not 0, it means cancellation, now. -- GnuPG-bug-id: 6010 Signed-off-by: NIIBE Yutaka <[email protected]>
2022-06-02tools: Add --unbuffered option to gpg-connect-agent.NIIBE Yutaka1-0/+9
* tools/gpg-connect-agent.c (cmd_and_opt_values): Add oUnBuffered. (opts, opt): Likewise. (main): When unbuffered, set gpgrt_stdin/stdout accordingly. -- Signed-off-by: NIIBE Yutaka <[email protected]>
2022-04-20w32: Do no use Registry item DefaultLogFile for the main tools.Werner Koch2-2/+4
* g10/gpg.c (main): Set LOG_NO_REGISTRY. * sm/gpgsm.c (main): Ditto. * tools/gpg-connect-agent.c (main): Ditto. * tools/gpgconf.c (main): Ditto. (show_other_registry_entries): Print "DefaultLogFile". -- The intention of this mostly forgotten registry entry was to allow for easy debugging of the tools. However, with the global config file common.conf things are anyway better. We disable the use for the commonly used tools so that it does not look like calling gpg on the command line seems to block with no output if the log server (e.g. tcp://1.2.3.4:11111) is not reachable.
2022-03-29gpg,tools: Remove use of repo only zlib-riscos.h.NIIBE Yutaka1-9/+0
* g10/compress.c: Don't use zlib-riscos.h. * tools/gpgsplit.c: Likewise. -- Signed-off-by: NIIBE Yutaka <[email protected]>
2022-03-25tools:gpgconf: Fix gc_component table.NIIBE Yutaka1-0/+2
* tools/gpgconf-comp.c [!BUILD_WITH_TPM2D] (gc_component): Add a dummy entry. -- GnuPG-bug-id: 5701 Reported-by: Adriaan de Groot Signed-off-by: NIIBE Yutaka <[email protected]>
2022-03-22gpgtar: New option --with-logWerner Koch5-38/+51
* tools/gpgtar.c: New option --with-log. * tools/gpgtar.h (opt): Add field with_log. * tools/gpgtar-extract.c (gpgtar_extract): Move directory string building up. Add option --log-file if needed. * tools/gpgtar-create.c (gpgtar_create): Make tmpbuf static becuase it is used outside of its scope. * tools/gpgtar-list.c (gpgtar_list): Ditto.
2022-03-21gpgtar: Finally use a pipe for decryption.Werner Koch5-137/+241
* tools/gpgtar.h (opt): Add new flags. * tools/gpgtar.c: new options --batch, --yes, --no, --status-fd, and --require-compliance. (main): Init signals. * tools/gpgtar-create.c: Add new header files. (gpgtar_create): Rework to use a pipe for encryption and signing. * tools/gpgtar-list.c: Add new header files. (gpgtar_list): Rework to use a pipe for decryption. * tools/gpgtar-extract.c: Add new header files. (gpgtar_extract): Rework to use a pipe for decryption. -- Fixes-commit: 40dbee86f3043aff8a8c2055521e270318e33068
2022-03-08gpgtar,w32: Support file names longer than MAX_PATH.Werner Koch3-13/+10
* tools/gpgtar.c: Replace assert by log_assert. * tools/gpgtar-extract.c: Ditto. (extract_regular): Create files with sysopen flag. * tools/gpgtar-create.c (scan_directory): Use gpgrt_fname_to_wchar. -- Note that for this change libgpg-error 1.45 is required for Windows.
2022-02-21scd,w32: Print code pages with --show-configsWerner Koch1-0/+9
* tools/gpgconf.c (show_configs): Do it.
2022-02-01dirmngr: Avoid initial delay on the first keyserver access.Werner Koch1-1/+1
* dirmngr/dirmngr.c (dirmngr_never_use_tor_p): New. * dirmngr/server.c (ensure_keyserver): Don't even test for the Tor proxy in never-use-tor Mode. * tools/gpgtar-create.c: Include unistd.h to avoid a warning on Windows. -- This delay of 2 or 3 seconds is in particular annoying on Windows. This is now suppressed, as it should be, if --no-use-tor is used. The second patch is unrelated
2022-01-27gpgconf: Teach --show-config the legacy gpgconf.conf.Werner Koch1-1/+21
* tools/gpgconf.c (show_configs): Print gpgconf.conf and a warning.
2022-01-27gpgconf: Return again "keyserver" for gpgsm.Werner Koch1-1/+1
* tools/gpgconf-comp.c (known_options_gpgsm): Change "ldapserver" back to "keyserver".
2022-01-26gpgconf: Fix --list-options for forced optionsWerner Koch1-1/+6
* tools/gpgconf-comp.c (retrieve_options_from_program): Ignore to to ignored options. Add failsafe code to avoid calling percent_escape with NULL. -- Remember: When using ARGPARSE_FLAG_WITHATTR the ARGPARSE_OPT_IGNORE flags in the returned type needs to be considered. GnuPG-bug-id: 5800
2022-01-25gpgconf: Return --ldapserver and --keyserver from dirmngr.Werner Koch1-1/+3
* dirmngr/dirmngr.c: Reorder two option groups. * tools/gpgconf-comp.c (known_options_gpgsm): Rename "keyserver" to "ldapserver" and set level to invisible. (known_options_dirmngr): Add "ldapserver" at the basic level. * sm/gpgsm.c (opts): No more help text for "ldapserver". -- GnuPG-bug-id: 5800
2022-01-12gpgconf: Add command aliases -L -K -R.Werner Koch1-3/+4
* tools/gpgconf.c (enum cmd_and_opt_values): Assign shortcuts. -- I have to type them to often ;-)
2022-01-09gpgtar: List and extract using extended headers.Werner Koch4-62/+272
* tools/gpgtar.h (TF_EXTHDR, TF_GEXTHDR): New. * tools/gpgtar-list.c (parse_header): Set the new type flags. (parse_extended_header): New. (read_header): Add arg r_extheader and parse extended header. (print_header): Consult the extended header. (gpgtar_list): Pass an extended header object. (gpgtar_read_header): Ditto. (gpgtar_print_header): Ditto. * tools/gpgtar-extract.c (extract): New arg exthdr and factor name checking out to ... (check_suspicious_name): new. (extract_regular): Add arg exthdr and consult it. (extract_directory): Likewise. (gpgtar_extract): Provide extheader object. -- GnuPG-bug-id: 5754
2022-01-09gpgtar: Create extended header for long file namesWerner Koch1-18/+217
* tools/gpgtar-create.c (global_header_count): new. (myreadlink): New. (build_header): New arg r_exthdr. Detect and store long file and link names. Factor checkum computation out to ... (compute_checksum): new. (add_extended_header_record): New. (write_extended_header): New. (write_file): Write extended header. -- GnuPG-bug-id: 5754
2021-12-30doc: Typo fixes.Werner Koch1-1/+1
--
2021-12-30gpgconf: Do not list ignored options and mark forced options as r/o.Werner Koch1-7/+17
* tools/gpgconf-comp.c (list_one_option): Skip ignored options and set the no_change flag for forced options. (retrieve_options_from_program): Put the attributes into the option table. --
2021-12-20wkd: Don't beg for donationsWerner Koch1-3/+3
* tools/gpg-wks-server.c (send_congratulation_message): Remove donation hint from message. --
2021-12-17w32: Prepare for the case gcrypt.h will not include winsock2.h.NIIBE Yutaka1-0/+3
* common/dynload.h: Include specific headers only. * common/exechelp-w32.c: Include <windows.h>. * common/gettime.c: Likewise. * common/utf8conv.c: Likewise. * tests/gpgscm/ffi.c: Likewise. * tools/gpgconf.c: Likewise. * configure.ac: Check winsock2.h, removing gl_HEADER_SYS_SOCKET. -- GnuPG-bug-id: 5731 Signed-off-by: NIIBE Yutaka <[email protected]>
2021-11-19gpgconf: Fix last commit.Werner Koch1-3/+3
-- Oops, I noticed the warning only after backporting to 2.2.
2021-11-19gpgconf: Include output of --list-dirs in --show-configs.Werner Koch1-14/+28
* tools/gpgconf.c (list_dirs): Add arg special. (show_other_registry_entries): Print the Homedir. (show_configs): List directories.
2021-11-17gpgconf: --show-configs now prints a bunch of Registry entries.Werner Koch1-11/+103
* tools/gpgconf.c (show_other_registry_entries): New. (show_configs): Call it. Minor reformatting. --
2021-11-17gpgconf: Extend --show-config to show envvars.Werner Koch1-19/+112
* tools/gpgconf.c (my_copy_file): Add arg LISTP and record certain things. (show_configs_one_file): New arg LISTP to be passed thru. (show_configs): Show envars and regisiry values. Signed-off-by: Werner Koch <[email protected]>
2021-11-12tools: Avoid memory leak from gpgspilt.Jakub Jelen1-0/+1
* tools/gpgsplit.c (write_part): Free memory when no longer needed. -- GnuPG-bug-id: 5393 Signed-off-by: Jakub Jelen <[email protected]>
2021-11-12gpg-pair-tool: Fix typos in protocol description.Jakub Jelen1-7/+7
-- GnuPG-bug-id: 5393 Signed-off-by: Jakub Jelen <[email protected]>
2021-11-09wks: Do not mark key files as executableBernhard M. Wiedemann1-1/+1
2021-11-09wks: Allow access to newly created dirsBernhard M. Wiedemann1-2/+2
2021-11-04gpgconf: New command --show-configs.Werner Koch1-5/+155
* tools/gpgconf.c (aShowConfigs): New. (opts): Add --show-configs. (CUTLINE_FMT): New. (show_version_gnupg): Add arg "prefix" and adjust caller. (my_copy_file): New. (show_configs_one_file): New.New. (show_configs): New. (main): Call show_configs. -- The ability to have a consolidated list of all config files is very useful for support cases. This is in particular important due to the global config files and their conditional constructs. Signed-off-by: Werner Koch <[email protected]>
2021-11-03gpgconf: Allow changing gpg's deprecated keyserver optionikloecker/t5462Ingo Klöcker1-0/+1
* tools/gpgconf-comp.c (known_options_gpg): Add "keyserver". -- This allows Kleopatra to read and change the keyserver that is used by gpg if the deprecated keyserver option in gpg.conf is set. GnuPG-bug-id: 5462
2021-10-06common: Respect gpgconf.ctl when looking up translationsIngo Klöcker1-1/+1
* common/i18n.c (i18n_init): Use gnupg_localedir() instead of LOCALEDIR. (i18n_localegettext): Ditto. * tools/gpgconf-comp.c (my_dgettext): Ditto. -- On Unix, gnupg_localedir() returns the locale directory relative to the root directory of the gnupg installation if specified in the gpgconf.ctl. Otherwise, it returns the built-in LOCALEDIR. GnuPG-bug-id: 5999
2021-09-20build: Fix several "include file not found" problemsIngo Klöcker1-4/+5
* dirmngr/Makefile.am (t_ldap_parse_uri_CFLAGS): Add KSBA_CFLAGS. * kbx/Makefile.am (libkeybox_a_CFLAGS, libkeybox509_a_CFLAGS): Add NPTH_CFLAGS. * tools/Makefile.am (gpgtar_CFLAGS, gpg_wks_server_CFLAGS, gpg_wks_client_CFLAGS, gpg_pair_tool_CFLAGS): Add LIBGCRYPT_CFLAGS. -- The tools include gcrypt.h via common/util.h. GnuPG-bug-id: 5592
2021-08-20wkd: Properly unescape the user-id from a key listing.Werner Koch1-6/+16
* tools/wks-util.c (append_to_uidinfo_list): Unescape UID.
2021-08-20wkd: Fix client issue with leading or trailing spaces in user-ids.Werner Koch1-2/+2
* 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 <[email protected]>
2021-08-13agent: New option --check-sym-passphrase-pattern.Werner Koch1-0/+2
* agent/gpg-agent.c (oCheckSymPassphrasePattern): New. (opts): Add --check-sym-passphrase-pattern. (parse_rereadable_options): Set option. (main): Return option info. * tools/gpgconf-comp.c: Add new option. * agent/agent.h (opt): Add var check_sym_passphrase_pattern. (struct pin_entry_info_s): Add var constraints_flags. (CHECK_CONSTRAINTS_NOT_EMPTY): New to replace a hardwired 1. (CHECK_CONSTRAINTS_NEW_SYMKEY): New. * agent/genkey.c (check_passphrase_pattern): Rename to ... (do_check_passphrase_pattern): this to make code reading easier. Handle the --check-sym-passphrase-pattern option. (check_passphrase_constraints): Replace arg no_empty by a generic flags arg. Also handle --check-sym-passphrase-pattern here. * agent/command.c (cmd_get_passphrase): In --newsymkey mode pass CHECK_CONSTRAINTS_NEW_SYMKEY flag. * agent/call-pinentry.c (struct entry_parm_s): Add constraints_flags. (struct inq_cb_parm_s): New. (inq_cb): Use new struct for parameter passing. Pass flags to teh constraints checking. (do_getpin): Pass constraints flag down. (agent_askpin): Take constrainst flag from the supplied pinentry struct. -- Requirements for a passphrase to protect a private key and for a passphrase used for symmetric encryption are different. Thus a the use of a different pattern file will be useful. Note that a pattern file can be used to replace the other passphrase constraints options and thus we don't need to duplicate them for symmetric encryption. GnuPG-bug-id: 5517 Signed-off-by: Werner Koch <[email protected]>
2021-08-11w32: Move socketdir to LCOAL_APPDATAWerner Koch1-2/+2
* common/homedir.c (is_gnupg_default_homedir): Use standard_homedir instead of the constant which makes a difference on Windows. (_gnupg_socketdir_internal) [W32]: Move the directory to LOCAL_APPDATA. (gnupg_cachedir): Remove unsued function. * common/sysutils.c (gnupg_rmdir): New. * tools/gpgconf.c (main): s/rmdir/gnupg_rmdir/. -- That is actually a more correct directory than APPDATA. This fixes a problem with installations where the APPDATA is non a network drive and the resulting socket filename is truncated in our socket helper function (because we use sockaddr also for our local socket emulation on Windows). LOCAL_APPDATA is expected to be on the local box and thus in the majority of cases the resulting socket file name will be short enough. GnuPG-bug-id: 5537 Signed-off-by: Werner Koch <[email protected]>
2021-08-11gpgconf,w32: Print more registry diagnostics with --list-dirs.Werner Koch1-2/+36
* tools/gpgconf.c (list_dirs): Figure out classes with the key. Signed-off-by: Werner Koch <[email protected]>
2021-08-05build: Simplify for string.h and getopt.h.NIIBE Yutaka1-3/+0
* configure.ac (AC_CHECK_HEADERS): Remove string.h and getopt.h. * dirmngr/ks-engine-ldap.c: Remove including getopt.h. * tools/make-dns-cert.c: Likewise. -- Checking string.h is supported by AC_HEADER_STDC. Use of getopt.h is only needed for getopt_long of GNU extention. Signed-off-by: NIIBE Yutaka <[email protected]>
2021-07-29tools: Extend gpg-check-pattern.Werner Koch1-24/+161
* tools/gpg-check-pattern.c: Major rewrite. -- Signed-off-by: Werner Koch <[email protected]> Here is a simple pattern file: ==================== # Pattern to reject passwords which do not comply to # - at least 1 uppercase letter # - at least 1 lowercase letter # - at least one number # - at least one special character # and a few extra things to show the reject mode # Reject is the default mode, ignore case is the default #[reject] #[icase] # If the password starts with "foo" (case insensitive) it is rejected. /foo.*/ [case] # If the password starts with "bar" (case sensitive) it is rejected. /bar.*/ # Switch to accept mode: Only if all patterns up to the next "accept" # or "reject" tag or EOF match, the password is accepted. Otherwise # the password is rejected. [accept] /[A-Z]+/ /[a-z]+/ /[0-9]+/ /[^A-Za-z0-9]+/ ================= Someone™ please write regression tests.
2021-06-25tools: Tweak ccidmon output.Werner Koch1-4/+4
--
2021-06-22tools: Extend ccidmon to print T=1 APDUsWerner Koch1-1/+93
* tools/ccidmon.c (print_as_ascii): New. (print_t1_block): New. (print_p2r_xfrblock): Print APDUs (print_r2p_datablock): Ditto. Signed-off-by: Werner Koch <[email protected]>
2021-06-12card: Fix typo in help messageJiri Kerestes1-1/+1
-- Signed-off-by: Jiri Kerestes <[email protected]>
2021-06-09gpgtar,w32: Fix file size computationWerner Koch1-1/+1
* tools/gpgtar-create.c (fillup_entry_w32): Move parentheses. -- Fixes-commit: 8b8925a2bdbb12dd537dde20a27cdb1416c2f1ae The bug is so obvious that I wonder why it was not reported more often on Windows. (Adding 1 to MAXDWORD (0xfffffff) always gives 0 for the product). Signed-off-by: Werner Koch <[email protected]>
2021-05-28gpgconf: Make runtime changes with different homedir work.Werner Koch1-4/+4
* tools/gpgconf-comp.c (dirmngr_runtime_change): Pass --homedir first.
2021-05-20card: Intialize pointer to avoid double freeJakub Jelen1-0/+1
* tools/gpg-card.c (cmd_salut): Initialize data pointer -- Signed-off-by: Jakub Jelen <[email protected]> GnuPG-bug-id: 5393
2021-04-23tools: Fix for --disable-tpm2d.NIIBE Yutaka1-0/+8
* tools/gpgconf-comp.c: Conditionalize with BUILD_WITH_TPM2D. -- GnuPG-bug-id: 5408 Signed-off-by: NIIBE Yutaka <[email protected]>
2021-04-21card: New option --shadow for command list.Werner Koch3-29/+50
* tools/card-call-scd.c (scd_readkey): Add arg create_shadow. * tools/gpg-card.c (list_one_kinfo): Add arg create_shadow and pass it down to scd-readkey. Change all callers to convey this arg. (cmd_list): Add option --shadow.