aboutsummaryrefslogtreecommitdiffstats
path: root/agent/trustlist.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2024-10-31agent: Fix status output for LISTTRUSTED.NIIBE Yutaka1-2/+2
* agent/trustlist.c (istrusted_internal): When LISTMODE is enabled, TRUSTLISTFPR status output should be done. -- GnuPG-bug-id: 7363 Signed-off-by: NIIBE Yutaka <[email protected]> Fixes-commit: 4275d5fa7a51731544d243ba16628a9958ffe3ce
2024-10-01agent: Add option --status to the LISTRUSTED command.Werner Koch1-9/+50
* agent/trustlist.c (istrusted_internal): Add arg listmode and print new status line in this mode. Adjust callers. (agent_listtrusted): Add new args ctrl and status_mode. Get all trusted keys and then call is_trusted_internal for all of them. * agent/command.c (cmd_listtrusted): Add new option --status. -- This allows in a non-restricted connection to list all trusted keys in one go.
2024-09-19agent: Fix detection of the trustflag de-vs.Werner Koch1-1/+1
* agent/trustlist.c (read_one_trustfile): Fix comparison. -- Fixes-commit: a5360ae4c7bfe6df6754409d5bd5c5a521ae5e6f GnuPG-bug-Id: 5079
2024-05-31indent: Fix spellingDaniel Kahn Gillmor1-2/+2
-- These are non-substantive corrections for minor spelling mistakes within the GnuPG codebase. With something like this applied to the codebase, and a judiciously tuned spellchecker integrated as part of a standard test suite, it should be possible to keep a uniform orthography within the project. GnuPG-bug-id: 7116
2023-09-26agent,common,gpg: Use unsigned int for 1-bit field.NIIBE Yutaka1-7/+7
* agent/trustlist.c (struct trustitem_s): Use unsigned int. * common/audit.c (struct log_item_s): Likewise. * g10/packet.h (struct seckey_info): Likewise. -- Signed-off-by: NIIBE Yutaka <[email protected]>
2023-04-03agent: Add trustlist flag "de-vs".Werner Koch1-1/+7
* agent/trustlist.c (struct trustitem_s): Add field de_vs. (read_one_trustfile): Parse it. (istrusted_internal): Emit TRUSTLISTFLAG status line. * sm/gpgsm.h (struct rootca_flags_s): Add field de_vs. * sm/call-agent.c (istrusted_status_cb): Detect the flags. * sm/sign.c (write_detached_signature): Remove unused vars. -- Right now this flag has no effect; we first need to specify the exact behaviour. GnuPG-bug-id: 5079
2022-11-10agent: Allow trustlist on Windows in Unicode homedirs.Werner Koch1-1/+1
* agent/trustlist.c (agent_marktrusted): Use gnupg_access.
2022-06-14agent: New option --no-user-trustlist and --sys-trustlist-name.Werner Koch1-9/+34
* agent/gpg-agent.c (oNoUserTrustlist,oSysTrustlistName): New. (opts): Add new option names. (parse_rereadable_options): Parse options. (finalize_rereadable_options): Reset allow-mark-trusted for the new option. * agent/agent.h (opt): Add fields no_user_trustlist and sys_trustlist_name. * agent/trustlist.c (make_sys_trustlist_name): New. (read_one_trustfile): Use here. (read_trustfiles): Use here. Implement --no-user-trustlist. -- With the global options we can now avoid that a user changes the Root-CA trust by editing the trustlist.txt. However, to implement this we need a new option so that we don't need to rely on some magic like --no-allow-mark-trusted has been put into a force section. The second option makes system administration easier as it allows to keep the trustlist in a non-distributed file. GnuPG-bug-id: 5990
2022-02-27agent: New flag "qual" for the trustlist.txt.Werner Koch1-15/+17
* agent/trustlist.c (struct trustitem_s): Add flag "qual". (read_one_trustfile): Rename arg "allow_include" to "systrust" and change callers. Parse new flag "qual". (istrusted_internal): Print all flags. * sm/call-agent.c (istrusted_status_cb): Detect the "qual" flag. * sm/gpgsm.h (struct rootca_flags_s): Add flag "qualified". * sm/certchain.c (do_validate_chain): Take care of the qualified flag.
2020-10-20Replace all calls to access by gnupg_accessWerner Koch1-7/+10
* common/sysutils.c (gnupg_access): New. Replace all calls to access by this wrapper. * common/homedir.c (w32_shgetfolderpath): Change to return UTF-8 directory name. (standard_homedir): Adjust for change. (w32_commondir, gnupg_cachedir): Ditto. -- Also use SHGetFolderPathW instead of SHGetFolderPathA on Windows. This is required to correctly handle non-ascii filenames on Windows. GnuPG-bug-id: 5098
2019-05-14agent: Replace most assert by log_assert.Werner Koch1-2/+1
--
2017-04-28Spelling fixes in docs and comments.NIIBE Yutaka1-1/+1
-- In addition, fix trailing spaces in tests/inittests. GnuPG-bug-id: 3121 Reported-by: ka7 (klemens) Signed-off-by: NIIBE Yutaka <[email protected]>
2017-03-07agent: Resolve conflict of util.h.NIIBE Yutaka1-1/+1
* agent/Makefile.am (AM_CPPFLAGS): Remove -I$(top_srcdir)/common. * agent/call-pinentry.c, agent/call-scd.c: Follow the change. * agent/command-ssh.c, agent/command.c, agent/cvt-openpgp.c: Ditto. * agent/divert-scd.c, agent/findkey.c, agent/genkey.c: Ditto. * agent/gpg-agent.c, agent/pksign.c, agent/preset-passphrase.c: Ditto. * agent/protect-tool.c, agent/protect.c, agent/trustlist.c: Ditto. * agent/w32main.c: Ditto. -- For openpty function, we need to include util.h on some OS. We also have util.h in common/, so this change is needed. Signed-off-by: NIIBE Yutaka <[email protected]>
2016-11-05Change all http://www.gnu.org in license notices to https://Werner Koch1-1/+1
--
2016-06-07Replace use of opt.homedir by accessor functions.Werner Koch1-3/+21
* common/homedir.c (the_gnupg_homedir): New var. (gnupg_set_homedir): New. (gnupg_homedir): New. * g10/options.h (struct opt): Remove 'homedir' and replace all users by the new accessor functions. * g13/g13-common.h (struct opt): Ditto. * scd/scdaemon.h (struct opt): Ditto. * sm/gpgsm.h (struct opt): Ditto. * dirmngr/dirmngr.h (struct opt): Ditto. * agent/preset-passphrase.c (opt_homedir): Ditto. * agent/protect-tool.c (opt_homedir): Ditto. -- This will make detection of a non-default homedir easier. Signed-off-by: Werner Koch <[email protected]>
2015-11-19agent: Improve error handling.Justus Winter1-1/+1
* agent/trustlist.c (istrusted_internal): Initialize 'err'. -- There is a plausible path of execution so that a branch condition uses the uninitialized value. Found using the Clang Static Analyzer. Signed-off-by: Justus Winter <[email protected]>
2015-06-30agent: Use different translation func for Pinentry strings.Werner Koch1-9/+9
* po/Makevars (XGETTEXT_OPTIONS): Add keyword "L_". * common/i18n.c (i18n_localegettext): New stub. * common/i18n.h: Expand the LunderscoreIMPL macro. * agent/agent.h (L_): New. (LunderscoreIMPL): New. * agent/call-pinentry.c (setup_qualitybar): Add arg ctrl anc change caller. * agent/findkey.c (try_unprotect_cb): Add local var ctrl. * agent/genkey.c (check_passphrase_constraints): Replace xtryasprintf by xtrystrdup to avoid gcc warning. Unfortinately this changes the string. (agent_ask_new_passphrase): Cleanup the use of initial_errtext. -- Static strings in gpg-agent need to be translated according to the locale set by the caller. This is required so that a gpg-agent can be started in one locale and a gpg can be run in another. If we don't do this the static strings (prompt, buttons) are not or in the wrong locale translated while dynamic strings (e.g. key description) uses the locale of gpg. This is only the first part of the change the actual local switching still needs to be implemented. Debian-bug-id: 788983 Signed-off-by: Werner Koch <[email protected]>
2014-03-07agent: Make --allow-mark-trusted the default.Werner Koch1-1/+2
* agent/gpg-agent.c (opts, main): Add option --no-allow-mark-trusted. Put this option into the gpgconf-list. (main): Enable opt.allow_mark_trusted by default. * tools/gpgconf-comp.c (gc_options_gpg_agent): Replace allow-mark-trusted by no-allow-mark-trusted. * agent/trustlist.c (agent_marktrusted): Always set the "relax" flag. -- These changes have been in effect for the Gpg4win Windows version since 2011-01-24 and thus first released with Gpg4win 2.1.0. Given the current state of PKIX it does not make any sense to lure the Unix user into false security by making it harder to trust self-signed or CAcert certificates. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 90b419f3e9d05e509348d047e05fcc79e87be6cf) Resolved conflicts: NEWS agent/gpg-agent.c
2012-06-05Change all quotes in strings and comments to the new GNU standard.Werner Koch1-14/+14
The asymmetric quotes used by GNU in the past (`...') don't render nicely on modern systems. We now use two \x27 characters ('...'). The proper solution would be to use the correct Unicode symmetric quotes here. However this has the disadvantage that the system requires Unicode support. We don't want that today. If Unicode is available a generated po file can be used to output proper quotes. A simple sed script like the one used for en@quote is sufficient to change them. The changes have been done by applying sed -i "s/\`\([^'\`]*\)'/'\1'/g" to most files and fixing obvious problems by hand. The msgid strings in the po files were fixed with a similar command.
2012-04-30agent: Fix deadlock in trustlist due to the switch to npth.Werner Koch1-44/+78
* agent/trustlist.c (clear_trusttable): New. (agent_reload_trustlist): Use new function. (read_trustfiles): Require to be called with lock held. (agent_istrusted): Factor all code out to ... (istrusted_internal): new. Add ALREADY_LOCKED arg. Make sure the table islocked. Do not print TRUSTLISTFLAG stati if called internally. (agent_marktrusted): Replace calls to agent_reload_trustlist by explicit code. -- In contrast to pth, npth does not use recursive mutexes by default. However, the code in trustlist.c assumed recursive locks and thus we had to rework it.
2012-01-25Port to npth.Marcus Brinkmann1-8/+16
* configure.ac: Don't check for PTH but for NPTH. (AH_BOTTOM): Remove PTH_SYSCALL_SOFT. (have_pth): Rename to ... (have_npth): ... this. (USE_GNU_NPTH): Rename to ... (USE_GNU_PTH): ... this. * m4/npth.m4: New file. * agent/Makefile.am, agent/cache.c, agent/call-pinentry.c, agent/call-scd.c, agent/findkey.c, agent/gpg-agent.c, agent/trustlist.c, common/Makefile.am, common/estream.c, common/exechelp-posix.c, common/exechelp-w32.c, common/exechelp-w32ce.c, common/http.c, common/init.c, common/sysutils.c, dirmngr/Makefile.am, dirmngr/crlfetch.c, dirmngr/dirmngr.c, dirmngr/dirmngr_ldap.c, dirmngr/ldap-wrapper-ce.c, dirmngr/ldap-wrapper.c, dirmngr/ldap.c, g13/Makefile.am, g13/call-gpg.c, g13/g13.c, g13/runner.c, scd/Makefile.am, scd/apdu.c, scd/app.c, scd/ccid-driver.c, scd/command.c, scd/scdaemon.c, tools/Makefile.am: Port to npth.
2011-02-04Nuked almost all trailing white space.post-nuke-of-trailing-wsWerner Koch1-22/+22
We better do this once and for all instead of cluttering all future commits with diffs of trailing white spaces. In the majority of cases blank or single lines are affected and thus this change won't disturb a git blame too much. For future commits the pre-commit scripts checks that this won't happen again.
2011-01-19Fixed a CR/LF problem on WindowsWerner Koch1-3/+6
2010-08-26.Werner Koch1-2/+2
2010-04-14Whole lot of changes to support CE.Werner Koch1-7/+6
2010-03-10Merged jnlib into common.Werner Koch1-1/+0
2009-12-02Fix usage of realloc.Werner Koch1-1/+2
2009-06-17Use cancel button in confirmation only if requested.Werner Koch1-2/+2
2009-06-03Fixed an fopen problem on Windows Vista.Werner Koch1-11/+12
2009-03-26Fixed a trustlist update problem.Werner Koch1-31/+85
Pretty format the marktrusted pinentry prompt.
2009-03-19Changed order of the confirmation questions for root certificatesWerner Koch1-64/+104
and stores negative answers in trustlist.txt.
2008-05-27Fixed segv in gpg-agent (command marktrusted).Werner Koch1-7/+11
Replaced almost all free by xfree. Translation fixes.
2007-08-27Implemented more gpg-agen options to support certain passphrase policies.Werner Koch1-12/+60
New tool gpg-check-pattern.
2007-08-10Implemented the chain model for X.509 validation.Werner Koch1-1/+12
2007-07-04Changed to GPLv3.Werner Koch1-4/+2
Removed intl/.
2007-06-14A whole bunch of changes to allow building for Windows.Werner Koch1-3/+21
See the ChangeLogs for details.
2007-04-03 * trustlist.c (read_trustfiles): Take a missing trustlist as anWerner Koch1-1/+11
empty one.
2006-11-14New command GETEVENTCOUNTER.Werner Koch1-0/+1
* command.c (bump_key_eventcounter): New. (bump_card_eventcounter): New. (cmd_geteventcounter): New command. * gpg-agent.c (handle_signal): Call bump_card_eventcounter. * findkey.c (agent_write_private_key): Call bump_key_eventcounter. * trustlist.c (agent_reload_trustlist): Ditto.
2006-11-09gpg-agent.c (main): In detached mode connect standard descriptors to /dev/null.Werner Koch1-2/+1
Other minor fixes
2006-10-16Allow to cancel marktrusted.Werner Koch1-1/+7
2006-09-25New "relax" option for trustlist.txtWerner Koch1-14/+61
2006-09-15Allow for a global trustlist.Werner Koch1-238/+345
2006-09-06The big Assuan error code removal.Werner Koch1-2/+2
2006-06-20Updated FSF's address.Werner Koch1-1/+2
2005-07-27Removed directories which are only used by the 1.9 branchWerner Koch1-306/+0
2005-01-13* acinclude.m4 (GNUPG_PTH_VERSION_CHECK): Link a simple testV1-9-15Werner Koch1-10/+32
program to see whether the installation is sane. * certreqgen.c (proc_parameters): Cast printf arg.
2004-07-22* trustlist.c (read_list): Allow colons in the fingerprint.Werner Koch1-13/+15
(headerblurb): Rephrased. * gpg-agent.c (handle_connections): Increase the stack size ot 256k. * de.po: Updated. * scdaemon.c (main): Bumbed thread stack size up to 512k. * keylist.c (list_cert_raw): Print the keygrip.
2004-05-11* gpg-agent.c (handle_signal): Reload the trustlist on SIGHUP.Werner Koch1-22/+89
(start_connection_thread): Hack to simulate a ticker. * trustlist.c (agent_trustlist_housekeeping) (agent_reload_trustlist): New. Protected all global functions here with a simple counter which is sufficient for Pth. * fingerprint.c (gpgsm_get_key_algo_info): New. * sign.c (gpgsm_sign): Don't assume RSA in the status line. * keylist.c (list_cert_colon): Really print the algorithm and key length. (list_cert_raw, list_cert_std): Ditto. (list_cert_colon): Reorganized to be able to tell whether a root certificate is trusted.
2004-05-03* gpg-agent.c: Remove help texts for options lile --lc-ctype.Werner Koch1-1/+5
(main): New option --allow-mark-trusted. * trustlist.c (agent_marktrusted): Use it here. * gpg-agent.texi (Agent Options): Add --allow-mark-trusted. * gpgconf-comp.c: Add --allow-mark-trusted for the gpg-agent.
2004-01-28(agent_marktrusted): Check whether the trustlist isWerner Koch1-0/+16
writable.