aboutsummaryrefslogtreecommitdiffstats
path: root/agent (unfollow)
Commit message (Collapse)AuthorFilesLines
2012-06-05Change all quotes in strings and comments to the new GNU standard.Werner Koch11-71/+71
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-03-27Print warning for arguments not considered an option.Werner Koch1-0/+10
GnuPG requires that options are given before other arguments. This can sometimes be confusing. We now print a warning if we found an argument looking alike a long option without being preceded by the stop option. This is bug#1343. * common/argparse.h (ARGPARSE_FLAG_STOP_SEEN): New. * common/argparse.c (arg_parse): Set new flag. * g10/gpg.c (main): Print the warning. * agent/gpg-agent.c (main): Ditto. * dirmngr/dirmngr.c (main): Ditto. * g13/g13.c (main): Ditto. * scd/scdaemon.c (main): Ditto. * sm/gpgsm.c (main): Ditto. * tools/gpg-connect-agent.c (main): Ditto. * tools/gpgconf.c (main): Ditto.
2012-02-07agent: Add pin length field to the shadowed private key format.Werner Koch5-5/+41
This is not yet fully implemented. It will eventually allow to support pinpad equipped readers which do not support variable length pin lengths. * agent/protect.c (parse_shadow_info): Add optional arg R_PINLEN and parse pinlen info. Change all callers to pass NULL for it.
2012-02-07Use new status printing functions.Werner Koch1-12/+4
* agent/command.c (cmd_geteventcounter): Get rid of static buffers. * scd/command.c (cmd_serialno, cmd_learn): Simplify by using print_assuan_status.
2012-02-07agent: New function agent_print_status.Werner Koch2-0/+19
* common/asshelp2.c (vprint_assuan_status): New. (print_assuan_status): Re-implement using above func. * agent/command.c (agent_print_status): New.
2012-02-06agent: Simplify printing of INQUIRE_MAXLEN.Werner Koch1-12/+5
* agent/command.c: Include asshelp.h. (cmd_pkdecrypt, cmd_genkey, cmd_preset_passphrase) (pinentry_loopback): Use print_assuan_status for INQUIRE_MAXLEN.
2012-02-06common: Add a global variable to for the default error source.Werner Koch3-0/+4
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.
2012-02-03Also let GENKEY and PKDECRYPT send the INQUIRE_MAXLEN status message.Ben Kibbey1-3/+11
* agent/command.c (cmd_pkdecrypt): Send the INQUIRE_MAXLEN status message before doing the inquire. (cmd_genkey): Ditto.
2012-02-02Inform the client of the preset passphrase length.Ben Kibbey1-1/+7
* agent/command.c (cmd_preset_passphrase): Send the INQUIRE_MAXLEN status message before inquiring the passphrase.
2012-01-26Return GPG_ERR_CARD_NOT_PRESENT when pinentry-mode=loopback.Ben Kibbey1-0/+4
Since there isn't a way to prompt the user to insert the smartcard when pinentry-mode=loopback, return GPG_ERR_CARD_NOT_PRESENT instead of GPG_ERR_NO_PIN_ENTRY. * agent/divert-scd.c (ask_for_card): Return GPG_ERR_CARD_NOT_PRESENT when pinentry-mode=loopback.
2012-01-26Also check for GPG_ERR_ASS_CANCELED during an inquire.Ben Kibbey1-2/+4
Fix pinentry-mode=loopback when cancelling an inquire from scdaemon. This is similar to commit 4f21f8d but for both protocol command cancellation and pinentry cancellation. * agent/call-scd.c (agent_card_pkdecrypt): Check for GPG_ERR_ASS_CANCELED. (agent_card_pksign): Ditto.
2012-01-25Fix strerror vs. gpg_strerror usage.Werner Koch1-1/+1
This bug was introduced by the migration to npth. * agent/gpg-agent.c (handle_connections): Use strerror.
2012-01-25Re-indent overlong lines.Werner Koch1-4/+8
--
2012-01-25Add missing variable.Werner Koch1-2/+5
* agent/gpg-agent.c (handle_connections) [!W32]: Add missing variable.
2012-01-25Port LDAP wrapper to NPTH.Marcus Brinkmann1-1/+3
* agent/gpg-agent.c (handle_connections): Handle error. * dirmngr/dirmngr_ldap.c, dirmngr/ldap-wrapper-ce.c: Port to NPTH.
2012-01-25Port Windows code to NPTH.Marcus Brinkmann1-12/+18
* agent/gpg-agent.c (get_agent_ssh_socket_name): Use INVALID_HANDLE_VALUE instead of 0. (handle_signal) [!HAVE_W32_SYSTEM]: Don't define. (handle_connections): Port Windows code to NPTH. * dirmngr/dirmngr.c (handle_connections): Port Windows code to NPTH. * g13/g13.c (handle_connections): Port Windows code to NPTH. * scd/scdaemon.c (handle_connections): Port Windows code to NPTH.
2012-01-25Port to npth.Marcus Brinkmann7-318/+217
* 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.
2012-01-18Add the INQUIRE_MAXLEN status message.Ben Kibbey1-0/+6
This status message is used to inform the client of the maximum length of an inquired passphrase and is used in pinentry-mode=loopback. * agent/command.c (pinentry_loopback): Send the INQUIRE_MAXLEN status message before doing the inquire.
2012-01-16gpg-agent: fix lc-messages handling not to change Xauthority settingJim Meyering1-0/+1
* agent/gpg-agent.c (main): Supply omitted "break" statement for lc-messages option. Otherwise, control would fall through to the following oXauthority case and use the same value there.
2012-01-15Fix indentation.Werner Koch1-1/+2
2012-01-14Fix scdaemon pinentry inquire cancelation.Ben Kibbey1-16/+29
Similar to commit 29af488 but also fixes PKDECRYPT and PKSIGN. * agent/call-scd.c (agent_card_pkdecrypt): Check for GPG_ERR_CANCELED when returning from the PKDECRYPT operation of scdaemon and cancel the inquire. (agent_card_pksign): Ditto. (cancel_inquire): New.
2012-01-03Terminate csh commands with a semicolon.Werner Koch1-2/+2
Fixes bug#1386. * agent/gpg-agent.c (main): Terminate csh style output with a semicolon. * scd/scdaemon.c: Ditto.
2012-01-02Only set gcrypt thread callback for older version of gcrypt.Marcus Brinkmann1-0/+9
* agent/gpg-agent.c, dirmngr/dirmngr.c, g13/g13.c, scd/scdaemon.c (USE_GCRY_THREAD_CBS): New macro, defined if GCRY_THREAD_OPTION_VERSION is 0. (fixed_gcry_pth_init) [!USE_GCRY_THREAD_CBS]: Don't define. (main) [!USE_GCRY_THREAD_CBS]: Do not install thread callbacks.
2011-12-20Require Libassuan 2.0.3Werner Koch2-13/+0
* configure.ac: Require Libassuan 2.0.3. * agent/call-scd.c (ASSUAN_CONVEY_COMMENTS): Remove macro replacement. * agent/command.c (cmd_killagent) [ASSUAN_FORCE_CLOSE]: Remove dependency. (cmd_killagent) [ASSUAN_FORCE_CLOSE]: Ditto. * scd/command.c (cmd_killscd) [ASSUAN_FORCE_CLOSE]: Ditto.
2011-12-16Don't kill pinentry by SIGKILL but let it quit by SIGINT.NIIBE Yutaka1-2/+1
* agent/call-pinentry.c (agent_popup_message_stop): To pinentry, send SIGINT (was: SIGKILL).
2011-12-14agent: Pass comment lines from scd verbatim thru gpg-agent.Werner Koch1-10/+23
* agent/call-scd.c (pass_status_thru): Pass comment lines verbatim. * tools/gpg-connect-agent.c (help_cmd_p): New. (main): Treat an "SCD HELP" the same as "HELP".
2011-12-05Fix last change.Werner Koch1-1/+0
* agent/command.c (start_command_handler): Remove use of removed var.
2011-12-05Amend the agent code with more comments.Werner Koch3-46/+161
* agent/command.c (server_local_s): Remove unused field MESSAGE_FD.
2011-12-01Generate the ChangeLog from commit logs.Werner Koch2-2/+14
* scripts/gitlog-to-changelog: New script. Taken from gnulib. * scripts/git-log-fix: New file. * scripts/git-log-footer: New file. * doc/HACKING: Describe the ChangeLog policy * ChangeLog: New file. * Makefile.am (EXTRA_DIST): Add new files. (gen-ChangeLog): New. (dist-hook): Run gen-ChangeLog. Rename all ChangeLog files to ChangeLog-2011.
2011-11-28Improve ssh card key diagnostic message.Werner Koch2-2/+10
* command-ssh.c (card_key_available): Change wording of no key diagnostic. (ssh_handler_request_identities): Do not call card_key_available if the scdaemon is disabled.
2011-09-13Allow no protection in pinentry-mode=loopback.Ben Kibbey2-2/+12
When the inquired passphrase has a 0 length then treat it as no protection.
2011-09-13Fixed invalid free.Ben Kibbey1-3/+1
2011-09-12Handle pinentry-mode=loopback.Ben Kibbey5-2/+83
When this mode is set an inquire will be sent to the client to retrieve the passphrase. This adds a new inquire keyword "NEW_PASSPHRASE" that the GENKEY and PASSWD commands use when generating a new key.
2011-08-10Fixed set but unused variable bugsWerner Koch4-6/+11
2011-08-10Update option s2k-count to match the documentation.Ben Kibbey2-3/+8
The option would previously return an error if its value was < 65536.
2011-08-10Made the KILLAGENT and KILLSCD commands working again.Werner Koch1-0/+5
This requires that GnuPG is build with a newer version of Libassuan (2.0.3).
2011-07-27Make the inquire cancel fix a little bit more robust.Werner Koch2-1/+18
2011-07-27Fixed gpg-agent SCD inquire command cancellation.Ben Kibbey2-0/+18
Need to send the CANCEL command back to scdaemon otherwise the next SCD command will fail.
2011-07-22Fix crash while reading unsupported ssh keys.Werner Koch2-12/+11
This bug was found by n-roeser at gmx.net (gnupg-devel@, msgid [email protected]).
2011-07-20Allow listing of ssh fingerprint with the agent's KEYINFO command.Werner Koch2-8/+32
2011-07-20Support a confirm flag for ssh.Werner Koch4-57/+206
This implements the suggestion from bug#1349. With this change the fingerprint of the ssh key is also displayed in the pinentry prompts.
2011-06-29Added gpg-agent OPTION "s2k-count".Ben Kibbey8-15/+41
When unset or 0, the calibrated count will be used.
2011-06-01Fix size_t vs int issues.Marcus Brinkmann2-1/+6
2011-04-29Add fixme note regarding pth_killWerner Koch1-0/+1
2011-04-26Fixed regression in OpenPGP secret key export.Werner Koch4-2/+43
The protection used in the exported key used a different iteration count than given in the S2K field. Thus all OpenPGP keys exported from GnuPG 2.1-beta can't be imported again. Given that the actual secret key material is kept in private-keys-v1.d/ the can be re-exported with this fixed version.
2011-04-21Add OPTION:cache-ttl-opt-preset to gpg-agent.Werner Koch5-7/+25
This option may be used to change the default ttl values use with the --preset option of GENKEY and PASSWD.
2011-04-20Fix gpg-agent secure memory leak in OpenPGP private key import.Marcus Brinkmann2-0/+8
2011-04-20 Marcus Brinkmann <[email protected]> * command.c (cmd_import_key): Release key from failed import before converting openpgp private key in the openpgp-private-key case.
2011-04-18Another PASSWD --preset fix.Ben Kibbey2-1/+5
Check for an error before presetting the passphrase.
2011-04-13Fixed PASSWD --preset.Ben Kibbey2-7/+11
The previous patch required that the keygrip be cached before adding the new passphrase to the cache. No more.