aboutsummaryrefslogtreecommitdiffstats
path: root/tools/gpgconf.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* tpm2d: Add tpm2daemon codeJames Bottomley2021-03-101-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tpm2d: New directory. * Makefile.am (SUBDIRS): Add directory. * configure.ac: Detect libtss and decide whether to build tpm2d. * am/cmacros.am: Add a define. * util.h (GNUPG_MODULE_NAME_TPM2DAEMON): New. * common/homedir.c (gnupg_module_name): Add tpm2d. * common/mapstrings.c (macros): Add "TPM2DAEMON". * tools/gpgconf.h (GC_COMPONENT_TPM2DAEMON): New. * tools/gpgconf-comp.c (known_options_tpm2daemon): New. (gc_component): Add TPM2. (tpm2daemon_runtime_change): New. * tpm2d/Makefile.am: New. * tpm2d/command.c: New. * tpm2d/ibm-tss.h: New. * tpm2d/tpm2.c: New. * tpm2d/tpm2.h: New. * tpm2d/tpm2daemon.c: New. * tpm2d/tpm2daemon.h: New. --- This commit adds and plumbs in a tpm2daemon to the build to mirror the operation of scdaemon. The architecture of the code is that tpm2daemon.c itself is pretty much a clone of scd/scdaemon.c just with updated function prefixes (this argues there could be some further consolidation of the daemon handling code). Note that although this commit causes the daemon to be built and installed, nothing actually starts it or uses it yet. Command handling ---------------- command.c is copied from the command handler in scd.c except that the command implementation is now done in terms of tpm2 commands and the wire protocol is far simpler. The tpm2daemon only responds to 4 commands IMPORT: import a standard s-expression private key and export it to TPM2 format. This conversion cannot be undone and the private key now can *only* be used by the TPM2. To anyone who gets hold of the private key now, it's just an encrypted binary blob. PKSIGN: create a signature from the tpm2 key. The TPM2 form private key is retrieved by KEYDATA and the hash to be signed by EXTRA. Note there is no hash specifier because the tpm2 tss deduces the hash type from the length of the EXTRA data. This is actually a limitation of the tpm2 command API and it will be interesting to see how this fares if the tpm2 ever supports say sha3-256 hashes. PKDECRYPT: decrypt (RSA case) or derive (ECC case) a symmetric key. The tpm2 for private key is retrieved by KEYDATA and the information used to create the symmetric key by EXTRA. KILLTPM2D: stop the daemon All the tpm2 primitives used by command.c are in tpm2.h and all the tpm2 specific gunk is confined to tpm2.c, which is the only piece of this that actually does calls into the tss library. Signed-off-by: James Bottomley <[email protected]> Changes from James' patch: - gpgconf: The displayed name is "TPM" and not "TPM2". That string is used by GUIs and should be something the user understands. For example we also use "network" instead of "Dirmngr". - Removed some commented includes. - Use 16 as emulation of GPG_ERR_SOURCE_TPM2. - Silenced a C90 compiler warning and flags unused parameters. - Removed "if HAVE_LIBS" from tpm2/Makefile.am and add missing files so that make distcheck works. Signed-off-by: Werner Koch <[email protected]>
* keyboxd: Integrate into gpgconf.Werner Koch2020-09-241-0/+3
| | | | | | | | | | | | | | * common/asshelp.c (lock_spawning): Use a dedicated name for keyboxd. * common/homedir.c (keyboxd_socket_name): New. (gnupg_module_name): Put keyboxd into libexecdir. * tools/gpgconf-comp.c (known_options_keyboxd): New. (gc_component): Add entry for keyboxd. (keyboxd_runtime_change): New. (gc_component_launch): Support keyboxd. * tools/gpgconf.c (list_dirs): Emit new item keyboxd-socket. (main): Also remove keyboxd socket. Signed-off-by: Werner Koch <[email protected]>
* gpgconf: Fix regression in --launch and --kill from MarchWerner Koch2020-06-241-3/+3
| | | | | | | | | | | | * tools/gpgconf.h (gc_component_id_t): Align order with gc_component array. -- Fixes-commit: b4f1159a5bd7b2799d7d35e883e0632ebf3339c8 gpgconf: Rewrite the gpgconf-comp module from 2020-03-12 Signed-off-by: Werner Koch <[email protected]>
* gpgconf: Rewrite the gpgconf-comp module.Werner Koch2020-03-121-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tools/gpgconf.h (gc_component_t): Change type to ... (gc_component_id_t): this. (GC_COMPONENT_ANY): New, so that we can use that in gpgconf-comp.c directly. * tools/gpgconf-comp.c: Major rework. -- The primary reason for this rework is to support the global options. A second reason is to clean up the code and simplify it so that we do not anymore need to maintain a list of options in the components _and_ in gpgconf-comp.c. What we do now is to 1. Read the option tables directly from the components using the new generic --dump-option-table option. This includes the header (group) descriptions. 2. Read the default values from the components as before using --gpgconf-list and update gpgconf's internal tables with that info. 3. Read the options using gpgrt_argparser in the same way as we do this in the components. The changes also do away with the second level notion of backends; they were only used for dirmngr's extra dirmngr_ldapservers.conf file. We intend to remove that file and replace it with a regular option so that it will be similar on how OpenPGP keyservers are specified. The whole thing will currently be slower than before (in particular on Windows) but we can optimize that by keeping a cached version of the option tables and the default values in a per homedir cache file. There is also some work planned to remove most of the data returned by --gpgconf-list. What can also be done is to replace the internal tables, which list the gpgconf maintainable options, by a configuration file so that admins are able to maintain the list of these options. GnuPG-bug-id: 4788 Signed-off-by: Werner Koch <[email protected]>
* build: Always use EXTERN_UNLESS_MAIN_MODULE pattern.Werner Koch2020-02-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | * common/util.h (EXTERN_UNLESS_MAIN_MODULE): Add the definion only here but now without the Norcroft-C. Change all other places where it gets defined. * common/iobuf.h (iobuf_debug_mode): Declare unconditionally as extern. * common/iobuf.c (iobuf_debug_mode): Define it here. * agent/gpg-agent.c (INCLUDED_BY_MAIN_MODULE): Define here and also in all main modules of all other programs. * g10/main.h: Put util.h before the local header files. -- This change is required for use with gcc/ld's LTO feature which does not allow common blocks. Further gcc 10 will make -fno-common the default and thus this chnage is always needed. What a pitty. Co-authored-by: Tomáš Mráz GnuPG-bug-id: 4831 Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 21d9bd8b87a9f793a106095e3838eb71825189d7) - Applied respective chnages also to gpg-card and keyboxd. Signed-off-by: Werner Koch <[email protected]>
* conf: New option --show-socket.Werner Koch2019-02-261-0/+28
| | | | | | | | | | | | | | | | | | | | | | * tools/gpgconf-comp.c (gc_component_t): Move this enum to ... * tools/gpgconf.h: here. * tools/gpgconf.c (oShowSocket): New. (opts): Add new option. (main): Implement new option. -- This is a convenience options for software which directly connects to gpg-agent and thus needs to new the socket. By using --show-socket along with --launch that software can also autostart the agent or the dirmngr. Without this two calls to gpgconf would be required. Actually the same behaviour can be achieved by running gpg-connect-agent to query the running gpg-agent's socket via GETINFO. The gpg-connect also makes sure that the agent is started. This is not anymore suggested because gpgconf shall in future be used for all such things. Signed-off-by: Werner Koch <[email protected]>
* conf: New option --status-fd.Werner Koch2017-12-181-0/+4
| | | | | | | | | | | | | | * tools/gpgconf.c (oStatusFD): New const. (opts): New option --status-fd. (statusfp): New var. (set_status_fd): New. (gpgconf_write_status): New. (gpgconf_failure): New. (main): Set status fd and replace exit by gpgconf_failure. * tools/gpgconf-comp.c: Repalce exit by gpgconf_failure. (gc_process_gpgconf_conf): Print a few warning status messages. Signed-off-by: Werner Koch <[email protected]>
* tools: Fix memory leaks and improve error handling.Justus Winter2017-01-101-0/+4
| | | | | | | | | | | | | * tools/gpgconf-comp.c (gc_option_free): New function. (gc_components_free): Likewise. (gc_components_init): Likewise. (retrieve_options_from_program): Use 'xfree', fix memory leak. (change_options_program): Improve error handling. (gc_component_change_options): Fix memory leaks. * tools/gpgconf.c (main): Initialize components. * tools/gpgconf.h (gc_components_init): New prototype. Signed-off-by: Justus Winter <[email protected]>
* gpgconf: New command --apply-profile.Werner Koch2016-12-161-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tools/gpgconf.c (aApplyProfile): New. (opts): New command --apply-profile. (main): Implement that command. * tools/gpgconf-comp.c (option_check_validity): Add arg VERBATIM. (change_options_program): Ditto. (change_one_value): Ditto. (gc_component_change_options): Ditto. (gc_apply_profile): New. -- Here is an example for a profile --8<---------------cut here---------------start------------->8--- # foo.prf - Sample profile [gpg] compliance de-vs default-new-key-algo brainpoolP256r1+brainpoolP256r1 [gpgsm] enable-crl-checks [gpg-agent] default-cache-ttl 900 max-cache-ttl [] 3600 no-allow-mark-trusted no-allow-external-cache enforce-passphrase-constraints min-passphrase-len 9 min-passphrase-nonalpha 0 [dirmngr] keyserver hkp://keys.gnupg.net allow-ocsp --8<---------------cut here---------------end--------------->8--- Note that flags inside of brackets are allowed after the option name. The only defined flag for now is "[default]". In case the value starts with a bracket, it is possible to insert "[]" as a nop-flag. Signed-off-by: Werner Koch <[email protected]>
* Change all http://www.gnu.org in license notices to https://Werner Koch2016-11-051-1/+1
| | | | --
* gpgconf: Add limited support for -0.Werner Koch2016-08-041-0/+1
| | | | | | | | | | | | * tools/gpgconf.h (opt): Add field 'null'. * tools/gpgconf.c: Add option --null/-0. (list_dirs): Use it here. -- This option changes the delimites for --list-dir with arguments from LF to Nul. Signed-off-by: Werner Koch <[email protected]>
* gpgconf: Exit with failure if --launch fails.Werner Koch2014-12-171-1/+1
| | | | | | | * tools/gpgconf-comp.c (gc_component_launch): Return an error code. * tools/gpgconf.c (main): Exit if launch failed. -- GnuPG-bug-id: 1791
* gpgconf: Add command --launch.Werner Koch2014-04-081-0/+3
| | | | | | | * tools/gpgconf.c: Add command --launch. * tools/gpgconf-comp.c (gc_component_launch): New. Signed-off-by: Werner Koch <[email protected]>
* Lock scdaemon to CCID if once found.Werner Koch2011-02-231-0/+3
| | | | | | | | This solves a problem where ccid was used, the card unplugged and then scdaemon tries to find a new (plugged in) reader and thus will eventually try PC/SC over and over again. Also added an explicit --kill command to gpgconf.
* Fix regression in logging.Werner Koch2010-08-181-6/+6
| | | | | | Add a registry key to enable catch-all remote debugging for W32. Replace more stdio stuff by estream.
* Add --reload command to gpgconf.Werner Koch2009-03-031-0/+3
| | | | | | Fix a problem in exechelp.c Get ready for a release.
* doc/Marcus Brinkmann2008-05-261-0/+5
| | | | | | | | | | | | | | | | | | 2008-05-26 Marcus Brinkmann <[email protected]> * tools.texi (Invoking gpgconf): Document --list-dirs. tools/ 2008-05-26 Marcus Brinkmann <[email protected]> * gpgconf.c (enum cmd_and_opt_values): Add aListDirs. (opts): Add aListDirs option. (main): Handle aListDirs. * gpgconf.h (gc_percent_escape): New declaration. * gpgconf-comp.c (my_percent_escape): Make non-static and rename to ... (gc_percent_escape): ... this. Change all callers.
* doc/Marcus Brinkmann2008-05-191-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | 2008-05-20 Marcus Brinkmann <[email protected]> * tools.texi (Invoking gpgconf): Add --dry-run and --check-options. (Checking programs): Document --check-options. tools/ 2008-05-20 Marcus Brinkmann <[email protected]> * gpgconf.h (gc_component_check_programs): Rename to ... (gc_check_programs): ... this. (gc_component_change_options): Add argument OUT. (gc_component_check_options): New function. * gpgconf.c (enum cmd_and_opt_values): New option aCheckOptions. (opts): Add new option aCheckOptions (aka --check-options). (main): Handle new option aCheckOptions. * gpgconf-comp.c (gc_component_check_programs): Rename to ... (gc_check_programs): ... this. Refactor core of it to ... (gc_component_check_options): ... this new function. (gc_component_change_options): Add new argument OUT. Externally verify all changes. Implement option --dry-run.
* New option --list-config for gpgconf.Werner Koch2007-10-231-1/+4
|
* New command --check-programs for gpgconf.Werner Koch2007-08-291-0/+3
|
* Changed to GPLv3.Werner Koch2007-07-041-4/+2
| | | | | Removed intl/.
* Support for a global gpgconf configuration file.Werner Koch2007-03-061-0/+4
|
* Updated FSF's address.Werner Koch2006-06-201-1/+2
|
* 2004-02-23 Marcus Brinkmann <[email protected]>Marcus Brinkmann2004-02-231-6/+8
| | | | | | | * gpgconf.h (struct): Add member runtime. * gpgconf.c: Add new option oRuntime. (main): Same here.
* 2004-01-29 Marcus Brinkmann <[email protected]>Marcus Brinkmann2004-01-281-4/+19
| | | | | | | | | * gpgconf-list.c: File removed. * README.gpgconf: New file. * gpgconf-comp.c: New file. * Makefile.am (gpgconf_SOURCES): Remove gpgconf-list.c, add gpgconf-comp.c.
* * Manifest: New.Werner Koch2004-01-051-0/+41
* gpgconf.c, gpgconf.h, gpgconf-list.c: New. A skeleton for now. * no-libgcrypt.c: New. * Makefile.am: Add above.