aboutsummaryrefslogtreecommitdiffstats
path: root/agent/protect-tool.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2018-03-27agent: Make the request origin a part of the cache items.Werner Koch1-1/+2
* agent/cache.c (agent_put_cache): Add arg 'ctrl' and change all callers to pass it. (agent_get_cache): Ditto. * agent/cache.c (struct cache_items_s): Add field 'restricted'. (housekeeping): Adjust debug output. (agent_flush_cache): Ditto. (agent_put_cache): Ditto. Take RESTRICTED into account. (agent_get_cache): Ditto. -- If requests are coming from different sources they should not share the same cache. This way we make sure that a Pinentry pops up for a remote request to a key we have already used locally. GnuPG-bug-id: 3858 Signed-off-by: Werner Koch <[email protected]>
2017-03-07agent: Resolve conflict of util.h.NIIBE Yutaka1-3/+3
* 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-09-17Fix comment and format.NIIBE Yutaka1-1/+1
* agent/protect-tool.c (main): Fix comment. * doc/DETAILS (colon listings): Fix list. * tests/openpgp/multisig.test: Fix comment. -- Signed-off-by: NIIBE Yutaka <[email protected]>
2016-09-17Fix more spellingDaniel Kahn Gillmor1-1/+1
* NEWS, acinclude.m4, agent/command-ssh.c, agent/command.c, agent/gpg-agent.c, agent/keyformat.txt, agent/protect-tool.c, common/asshelp.c, common/b64enc.c, common/recsel.c, doc/DETAILS, doc/HACKING, doc/Notes, doc/TRANSLATE, doc/dirmngr.texi, doc/faq.org, doc/gpg-agent.texi, doc/gpg.texi, doc/gpgsm.texi, doc/instguide.texi, g10/armor.c, g10/gpg.c, g10/keyedit.c, g10/mainproc.c, g10/pkclist.c, g10/tofu.c, g13/sh-cmd.c, g13/sh-dmcrypt.c, kbx/keybox-init.c, m4/pkg.m4, sm/call-dirmngr.c, sm/gpgsm.c, tests/Makefile.am, tests/gpgscm/Manual.txt, tests/gpgscm/scheme.c, tests/openpgp/gpgv-forged-keyring.scm, tests/openpgp/multisig.test, tests/openpgp/verify.scm, tests/pkits/README, tools/applygnupgdefaults, tools/gpg-connect-agent.c, tools/mime-maker.c, tools/mime-parser.c: minor spelling cleanup. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
2016-08-12Call log_set_prefix() with human-readable labels.Daniel Kahn Gillmor1-1/+1
* agent/preset-passphrase.c, agent/protect-tool.c, dirmngr/dirmngr.c * dirmngr/t-http.c, g10/gpg.c, g10/gpgv.c, g13/g13-syshelp.c * g13/g13.c, kbx/kbxutil.c, scd/scdaemon.c, sm/gpgsm.c * tests/gpgscm/main.c, tools/gpg-check-pattern.c * tools/gpg-connect-agent.c, tools/gpgconf.c, tools/gpgtar.c * tools/symcryptrun.c: Invoke log_set_prefix() with human-readable labels. -- Some invocations of log_set_prefix() were done with raw numeric values instead of values that humans can understand. Use symbolic representations instead of numeric for better readability. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
2016-08-09Cleanup initialization of libgcrypt.Ben Kibbey1-7/+0
* common/init.c (init_common_subsystems): Initialize libgcrypt. * dirmngr/Makefile.am (dirmngr_ldap): Link with libgcrypt. -- Most other modules already call gcry_check_version() after init_common_subsystems() so may as well move initialization of libgcrypt to here. Also fixes a warning in the system log from gpgconf --homedir. Signed-off-by: Ben Kibbey <[email protected]>
2016-06-07common: Remove homedir arg from start_new_{dirmngr,gpg_agent}.Werner Koch1-1/+0
* common/asshelp.c (start_new_gpg_agent): Remove arg 'homedir' in favor of gnupg_homedir (). Change all callers. (start_new_dirmngr): Ditto. * common/get-passphrase.c (gnupg_prepare_get_passphrase): Remove arg 'homedir'. Signed-off-by: Werner Koch <[email protected]>
2016-06-07Replace use of opt.homedir by accessor functions.Werner Koch1-6/+2
* 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]>
2016-04-14agent: Allow gpg-protect-tool to handle openpgp-native protection.Werner Koch1-13/+96
* agent/protect-tool.c (read_and_unprotect): Add arg ctrl and pass to agent_unprotect. (main): Allocate a simple CTRL object and pass it to read_and_unprotect. (convert_from_openpgp_native): Remove stub. (agent_key_available, agent_get_cache): New stubs. (agent_askpin): New emulation for the one in call-pinentry.c. (agent_write_private_key): New to dump key. * agent/Makefile.am (gpg_protect_tool_SOURCES): Add cvt-openpgp.c -- Signed-off-by: Werner Koch <[email protected]>
2016-04-12agent: Implement new protection mode openpgp-s2k3-ocb-aes.Werner Koch1-1/+7
* agent/protect.c (agent_protect): Add arg use_ocb. Change all caller to pass -1 for default. * agent/protect-tool.c: New option --debug-use-ocb. (oDebugUseOCB): New. (opt_debug_use_ocb): New. (main): Set option. (read_and_protect): Implement option. * agent/protect.c (OCB_MODE_SUPPORTED): New macro. (PROT_DEFAULT_TO_OCB): New macro. (do_encryption): Add args use_ocb, hashbegin, hashlen, timestamp_exp, and timestamp_exp_len. Implement OCB. (agent_protect): Change to support OCB. (do_decryption): Add new args is_ocb, aadhole_begin, and aadhole_len. Implement OCB. (merge_lists): Allow NULL for sha1hash. (agent_unprotect): Change to support OCB. (agent_private_key_type): Remove debug output. -- Instead of using the old OpenPGP way of appending a hash of the plaintext and encrypt that along with the plaintext, the new scheme uses a proper authenticated encryption mode. See keyformat.txt for a description. Libgcrypt 1.7 is required. This mode is not yet enabled because there would be no way to return to an older GnuPG version. To test the new scheme use gpg-protect-tool: ./gpg-protect-tool -av -P abc -p --debug-use-ocb <plain.key >prot.key ./gpg-protect-tool -av -P abc -u <prot.key Any key from the private key storage should work. Signed-off-by: Werner Koch <[email protected]>
2015-04-24common: Remove two JNLIB_ macros (jnlib merge).Werner Koch1-1/+0
* configure.ac: Merge seperate jnlib checks. (HAVE_JNLIB_LOGGING): Remove. * common/logging.c, common/simple-pwquery.c (JNLIB_NEED_AFLOCAL): Rename to GNUPG_COMMON_NEED_AFLOCAL. Change all tests. -- Signed-off-by: Werner Koch <[email protected]>
2015-01-28Add a hook to be called right after main.Werner Koch1-0/+1
* common/init.c (early_system_init): New stub function. Signed-off-by: Werner Koch <[email protected]>
2013-11-18Make use of the *_NAME etc macros.Werner Koch1-1/+1
Replace hardwired strings at many places with new macros from config.h and use the new strusage macro replacement feature. * common/asshelp.c (lock_spawning) [W32]: Change the names of the spawn sentinels. * agent/command.c (cmd_import_key): Use asprintf to create the prompt.
2013-05-22Implement unattended OpenPGP secret key import.Werner Koch1-1/+13
* agent/command.c (cmd_import_key): Add option --unattended. * agent/cvt-openpgp.c (convert_transfer_key): New. (do_unprotect): Factor some code out to ... (prepare_unprotect): new function. (convert_from_openpgp): Factor all code out to ... (convert_from_openpgp_main): this. Add arg 'passphrase'. Implement openpgp-native protection modes. (convert_from_openpgp_native): New. * agent/t-protect.c (convert_from_openpgp_native): New dummy fucntion * agent/protect-tool.c (convert_from_openpgp_native): Ditto. * agent/protect.c (agent_unprotect): Add arg CTRL. Adjust all callers. Support openpgp-native protection. * g10/call-agent.c (agent_import_key): Add arg 'unattended'. * g10/import.c (transfer_secret_keys): Use unattended in batch mode. -- With the gpg-agent taking care of the secret keys, the user needs to migrate existing keys from secring.gpg to the agent. This and also the standard import of secret keys required the user to unprotect the secret keys first, so that gpg-agent was able to re-protected them using its own scheme. With many secret keys this is quite some usability hurdle. In particular if a passphrase is not instantly available. To make this migration smoother, this patch implements an unattended key import/migration which delays the conversion to the gpg-agent format until the key is actually used. For example: gpg2 --batch --import mysecretkey.gpg works without any user interaction due to the use of --batch. Now if a key is used (e.g. "gpg2 -su USERID_FROM_MYSECRETKEY foo"), gpg-agent has to ask for the passphrase anyway, converts the key from the openpgp format to the internal format, signs, re-encrypts the key and tries to store it in the gpg-agent format to the disk. The next time, the internal format of the key is used. This patch has only been tested with the old demo keys, more tests with other protection formats and no protection are needed. Signed-off-by: Werner Koch <[email protected]>
2012-06-05Change all quotes in strings and comments to the new GNU standard.Werner Koch1-5/+5
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-02-06common: Add a global variable to for the default error source.Werner Koch1-0/+1
For the shared code parts it is cumbersome to pass an error sourse variable to each function. Its value is always a constant for a given binary and thus a global variable makes things a lot easier than the former macro stuff. * common/init.c (default_errsource): New global var. (init_common_subsystems): Rename to _init_common_subsystems. Set DEFAULT_ERRSOURCE. * common/init.h: Assert value of GPG_ERR_SOURCE_DEFAULT. (init_common_subsystems): New macro. * common/util.h (default_errsource): Add declaration. * kbx/keybox-defs.h: Add some GPG_ERR_SOURCE_DEFAULT trickery.
2011-06-29Added gpg-agent OPTION "s2k-count".Ben Kibbey1-1/+1
When unset or 0, the calibrated count will be used.
2011-02-04Nuked almost all trailing white space.post-nuke-of-trailing-wsWerner Koch1-33/+32
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.
2010-10-13More agent support for gpg.Werner Koch1-1/+2
2010-06-21Remove cruft.Werner Koch1-451/+0
2010-06-21Implement export of pkcs#12 objects using a direct agent connection.Werner Koch1-92/+13
2010-06-17Avoid using the protect-tool to import pkcs#12.Werner Koch1-15/+4
2010-04-14Whole lot of changes to support CE.Werner Koch1-2/+2
2010-03-22More chnages to use estream. Add a way to replace the standardWerner Koch1-1/+1
descriptors.
2010-03-10Merged jnlib into common.Werner Koch1-1/+0
2009-12-14Implement dynamic S2K count computation.Werner Koch1-0/+11
2009-07-21Make bug reporting address easier changeable.Werner Koch1-2/+2
2009-07-07Reworked passing of envars to Pinentry.Werner Koch1-1/+1
2009-06-05Fix last changeWerner Koch1-0/+1
2009-06-03Fixed an fopen problem on Windows Vista.Werner Koch1-12/+10
2009-04-01Import/export of pkcs#12 now uses the gpg-agent directly.Werner Koch1-177/+97
Removed duplicated code (percent unescaping).
2009-03-02Fix bug#1003.Werner Koch1-3/+10
2008-12-09Minor fixes.Werner Koch1-2/+1
2008-10-20Marked all unused args on non-W32 platforms.Werner Koch1-0/+2
2007-10-19Factored utf8 switching code out to i18n.c.Werner Koch1-31/+3
2007-08-28Add more passphrase policy rules.Werner Koch1-4/+12
(--max-passphrase-days).
2007-08-22Updated estream.Werner Koch1-2/+17
More changes for Windows.
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-2/+12
See the ChangeLogs for details.
2007-06-06First steps towards supporting W32.Werner Koch1-16/+0
This is mainly source code reorganization. Update gnulib. g10/ does currently not build.
2007-05-18agent/Marcus Brinkmann1-1/+4
2007-05-19 Marcus Brinkmann <[email protected]> * protect-tool.c (get_passphrase): Free ORIG_CODESET on error. g10/ 2007-05-19 Marcus Brinkmann <[email protected]> * passphrase.c (passphrase_get): Free ORIG_CODESET on error. sm/ 2007-05-18 Marcus Brinkmann <[email protected]> * qualified.c (gpgsm_qualified_consent, gpgsm_not_qualified_warning): Free ORIG_CODESET on error. * certdump.c (gpgsm_format_keydesc): Likewise. tools/ 2007-05-19 Marcus Brinkmann <[email protected]> * symcryptrun.c (confucius_get_pass): Free ORIG_CODESET on error.
2007-04-20Improved logging for error orginating from libgcrypt.Werner Koch1-22/+2
2007-03-20Allow setting of the passphrase encoding of pkcs#12 files.Werner Koch1-3/+9
New option --p12-charset.
2007-01-25agent/Werner Koch1-12/+13
* protect-tool.c (get_passphrase): New arg OPT_CHECK. (get_new_passphrase): Enable OTP_CHECK on the first call. * command.c (cmd_get_passphrase): Implement option --check. * gpg-agent.c (MIN_PASSPHRASE_LEN): New (parse_rereadable_options): New option --min-passphrase-len. * genkey.c (check_passphrase_constraints): New. (agent_genkey, agent_protect_and_store): Call new function. Fix memory leak. * call-pinentry.c (agent_askpin): Allow translation of the displayed error message. (agent_popup_message_start): Remove arg CANCEL_BTN. (popup_message_thread): Use --one-button option. * command.c (cmd_passwd): Now that we don't distinguish between assuan and regular error codes we can jump to the end on error. common/ * simple-pwquery.c (simple_pwquery): New arg OPT_CHECK.
2006-11-09gpg-agent.c (main): In detached mode connect standard descriptors to /dev/null.Werner Koch1-1/+1
Other minor fixes
2006-10-16Allow to cancel marktrusted.Werner Koch1-1/+1
2006-06-20Updated FSF's address.Werner Koch1-1/+2
2005-07-27Removed directories which are only used by the 1.9 branchWerner Koch1-977/+0
2005-06-16gcc-4 defaults forced me to edit many many files to get rid of theWerner Koch1-10/+11
char * vs. unsigned char * warnings. The GNU coding standards used to say that these mismatches are okay and better than a bunch of casts. Obviously this has changed now.