aboutsummaryrefslogtreecommitdiffstats
path: root/agent (unfollow)
Commit message (Collapse)AuthorFilesLines
2017-04-17agent: More minor change.NIIBE Yutaka1-1/+0
* agent/command.c (cmd_pksign): Remove redundant assignment. Signed-off-by: NIIBE Yutaka <[email protected]>
2017-04-17agent: Minor cleanup.NIIBE Yutaka2-3/+0
* agent/command-ssh.c (ssh_key_to_protected_buffer): Not touch ERR. * agent/command.c (cmd_genkey, cmd_import_key): Clean up. Signed-off-by: NIIBE Yutaka <[email protected]>
2017-04-14agent: Clean up error initialize/return.NIIBE Yutaka4-6/+2
* agent/call-pinentry.c (start_pinentry): Return RC. * agent/command-ssh.c (ssh_handler_request_identities): Don't set ERR. * agent/findkey.c (try_unprotect_cb): Return ERR. (unprotect): Don't set RC. * agent/gpg-agent.c (handle_connections): Don't set fd. Signed-off-by: NIIBE Yutaka <[email protected]>
2017-04-12agent: Simplify stream_read_cstring.NIIBE Yutaka1-7/+1
* agent/command-ssh.c (stream_read_cstring): Just call stream_read_string. Signed-off-by: NIIBE Yutaka <[email protected]>
2017-04-10agent: Use "ll" length specifier when time_t is larger.NIIBE Yutaka1-1/+7
* agent/command.c (cmd_keytocard): Use KEYTOCARD_TIMESTAMP_FORMAT. -- On a big-endian 32-bit platform which uses 64-bit time_t, it might go wrong. Signed-off-by: NIIBE Yutaka <[email protected]>
2017-04-06agent: Serialize access to passphrase cache.NIIBE Yutaka1-36/+37
* agent/cache.c (encryption_lock): Remove. (cache_lock): New. Now, we have coarse grain lock to serialize entire cache access. (initialize_module_cache): Use CACHE_LOCK. (init_encryption, new_data): Remove ENCRYPTION_LOCK. (agent_flush_cache, agent_put_cache, agent_get_cache): Lock the cache. -- GnuPG-bug-id: 3027 Signed-off-by: NIIBE Yutaka <[email protected]>
2017-04-04agent: Minor fix for get_client_pid.NIIBE Yutaka1-4/+6
* agent/command-ssh.c (get_client_pid): Use 0 to initialize. Signed-off-by: NIIBE Yutaka <[email protected]>
2017-04-03gpgconf: Add --enable-extended-key-format for the agent.Werner Koch1-0/+2
* tools/gpgconf-conf.c: Add option. * agent/gpg-agent.c (main) <aGPGConfList>: Add option. Signed-off-by: Werner Koch <[email protected]>
2017-04-02agent: Use OCB for key protection with --enable-extended-key-format.Werner Koch1-6/+1
* agent/protect.c (PROT_DEFAULT_TO_OCB): Remove macro. (agent_protect): Make the default protection mode depend on the extend key format option. Signed-off-by: Werner Koch <[email protected]>
2017-03-24agent: New option --enable-extended-key-format.Werner Koch3-11/+43
* agent/gpg-agent.c (oEnableExtendedKeyFormat): New const. (opts): New option --enable-extended-key-format. (parse_rereadable_options): Set option * agent/findkey.c (write_extended_private_key): Add arg 'update'. (agent_write_private_key): Implement new option. Signed-off-by: Werner Koch <[email protected]>
2017-03-24agent: New option --stub-only for DELETE_KEYWerner Koch3-16/+30
* agent/findkey.c (agent_delete_key): Add arg 'only_stubs'. * agent/command.c (cmd_delete_key): Add option --stub-only. -- This option can be used to savely remove stub keys.
2017-03-16agent,g10: Remove redundant SERIALNO request.NIIBE Yutaka1-10/+11
* agent/learncard.c (agent_handle_learn): Don't call agent_card_serialno. Get the serialno in status response. * g10/call-agent.c (agent_scd_learn): Don't request "SCD SERIALNO". (agent_scd_serialno): New. (card_cardlist_cb, agent_scd_cardlist): New. Signed-off-by: NIIBE Yutaka <[email protected]>
2017-03-07agent: Resolve conflict of util.h.NIIBE Yutaka16-31/+31
* 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]>
2017-03-07agent: Add include files.NIIBE Yutaka1-0/+4
* agent/command-ssh.c: Add sys/socket.h and sys/un.h. Signed-off-by: NIIBE Yutaka <[email protected]>
2017-03-07agent: Fix get_client_pid for portability.NIIBE Yutaka1-11/+32
* configure.ac: Simply check getpeerucred and ucred.h, and structure members. * agent/command-ssh.c: Include ucred.h. (get_client_pid) [HAVE_STRUCT_SOCKPEERCRED_PID]: Use sockpeercred structure for OpenBSD. [LOCAL_PEERPID]: Use LOCAL_PEERPID for macOS. [LOCAL_PEEREID]: Use LOCAL_PEEREID for NetBSD. [HAVE_GETPEERUCRED]: Use getpeerucred for OpenSolaris. -- This change also addresses following bug. GnuPG-bug-id: 2981. Signed-off-by: NIIBE Yutaka <[email protected]>
2017-03-06agent: For SSH, robustly handling scdaemon's errors.NIIBE Yutaka1-10/+9
* agent/command-ssh.c (card_key_list): Return 0 when agent_card_serialno returns an error. (ssh_handler_request_identities): Handle errors for card listing and proceed to other cases. -- GnuPG-bug-id: 2980 Signed-off-by: NIIBE Yutaka <[email protected]>
2017-03-02agent: Improve error message for the KEYTOCARD command.Werner Koch1-12/+27
* agent/command.c (cmd_keytocard): Always use leave_cmd. Simplify timestamp checking and do an early test with an appropriate error message. Signed-off-by: Werner Koch <[email protected]>
2017-02-22scd,agent: Improve the OpenPGP PIN prompt texts.Werner Koch1-7/+66
* scd/app-openpgp.c (get_prompt_info): Change texts. * agent/call-pinentry.c (struct entry_features): New. (getinfo_features_cb): New. (start_pinentry): Set new fucntion as status callback. (build_cmd_setdesc): New. Replace all snprintf for SETDESC by this one. -- Suggested-by: Andre Heinecke Signed-off-by: Werner Koch <[email protected]>
2017-02-22scd: Improve the prompts for OpenPGP cards.Werner Koch1-15/+38
* scd/app-openpgp.c (get_disp_name): New. (get_disp_serialno): New. (get_prompt_info): New. (build_enter_admin_pin_prompt): Rework the prompt texts. Factor some code out to ... (get_remaining_tries): New. (verify_a_chv): Print a remaining counter also for the standard PIN. Rework the prompt texts. * agent/divert-scd.c (ask_for_card): Pretty format an OpenPGP serial no. Signed-off-by: Werner Koch <[email protected]>
2017-02-22agent: Prepend the description to a PIN prompt.Werner Koch4-19/+96
* agent/divert-scd.c (has_percent0A_suffix): New. (getpin_cb): Prepend DESC_TEXT to the prompt. * agent/findkey.c (modify_description): Rename to ... (agent_modify_description): this. MAke global. Add kludge to remove empty parentheses from the end. (agent_key_from_file, agent_delete_key): Adjust for above change. * agent/pksign.c (agent_pksign_do): Modify DESC_TEXT also when diverting to a card. -- Now that we have support for multiple tokens, it is important to show information on which key has been requested. Without that it may happen that the PIN for a wrong card is accidentally entered. The texts are a bit ugly, because they talk about "passphrase" but later about entering a PIN. A quick hack would be to s/passphrase/PIN/ in the description but that is complicated due to i18n. Another solution might be never to talk about PINs in the description but always about "passphrase: and only use "PIN" or "passphrase" on the left of the entry field.
2017-02-22agent: Prepare to pass an additional parameter to the getpin callback.Werner Koch5-46/+85
* agent/call-scd.c (writekey_parm_s, inq_needpin_s): Merge into ... (inq_needpin_parm_s): new struct. Add new field 'getpin_cb_desc'. Change users to set all fields. (inq_needpin): Pass GETPIN_CB_DESC to the GETPIN_CB. (agent_card_pksign): Add arg 'desc_text' and change arg 'getpin_cb' to take an additional arg 'desc_text'. (agent_card_pkdecrypt): Ditto. (agent_card_writekey): Change arg 'getpin_cb' to take an additional arg 'desc_text'. (agent_card_scd): Ditto. * agent/divert-scd.c (getpin_cb): Add new arg 'desc_text'. (divert_pksign): Add new arg 'desc_text' and pass is to agent_card_pksign. (divert_pkdecrypt): Add new arg 'desc_text' and pass is to agent_card_pkdecrypt. * agent/pkdecrypt.c (agent_pkdecrypt): Pass DESC_TEXT to divert_pkdecrypt. * agent/pksign.c (agent_pksign_do): Pass DESC_TEXT to divert_pksign. -- Signed-off-by: Werner Koch <[email protected]>
2017-02-21Fix spelling.Daniel Kahn Gillmor1-3/+3
-- Clean up several other misspellings noticed while reviewing Yuri's de-duplication patch. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
2017-02-21Clean up word replication.Yuri Chornoivan10-16/+16
-- This fixes extra word repetitions (like "the the" or "is is") in the code and docs. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
2017-02-17agent: No cards is not an error.NIIBE Yutaka1-0/+6
* agent/command-ssh.c (card_key_list): Care the case of no cards. Signed-off-by: NIIBE Yutaka <[email protected]>
2017-02-17agent: Send back all public keys for available cards.NIIBE Yutaka3-8/+135
* agent/call-scd.c (card_cardlist_cb, agent_card_cardlist): New. * agent/command-ssh.c (card_key_list): New. (ssh_handler_request_identities): Call card_key_list and loop for the list to send public keys for all available cards. Signed-off-by: NIIBE Yutaka <[email protected]>
2017-02-03agent: Tell pinentry the hostname the agent is running on.Werner Koch1-1/+11
* agent/call-pinentry.c [!W32]: Incluse utsname.h (start_pinentry): Pass nodename to OPTION/owner. Signed-off-by: Werner Koch <[email protected]>
2017-02-03agent: Tell the Pinentry the client's pid.Werner Koch4-1/+63
* configure.ac: Check for SO_PEERCRED et al. * agent/agent.h (server_control_s): Add field 'client_pid'. * agent/command.c (start_command_handler): Set CLIENT_PID. * agent/command-ssh.c (get_client_pid): New. (start_command_handler_ssh): Set CLIENT_PID. * agent/call-pinentry.c (start_pinentry): Tell Pinentry the client-pid. Signed-off-by: Werner Koch <[email protected]>
2017-02-03gpg: More diagnostics for a launched pinentry.Werner Koch1-1/+5
* agent/call-pinentry.c (start_pinentry): Call getinfo/ttyinfo. * g10/server.c (gpg_proxy_pinentry_notify): Simplify the output so that we do not change the code when adding new fields to PINENTRY_LAUNCHED. -- This patch changes the --verbose output of gpg to show for example gpg: pinentry launched (5228 gtk2 1.0.1-beta10 \ /dev/pts/4 xterm localhost:10.0) the used tty, its type, and the value of DISPLAY in addiion to the pid, flavor, and version. Signed-off-by: Werner Koch <[email protected]>
2017-02-01Fix explanation of commit e175152ef7515921635bf1e00383e812668d13fc.Werner Koch1-3/+5
--
2017-01-30Explain commit e175152ef7515921635bf1e00383e812668d13fc.Werner Koch1-1/+9
--
2017-01-25agent: Fix double free.Justus Winter1-2/+15
* agent/cache.c (agent_store_cache_hit): Make sure the update is atomic. -- Previously, the function freed the last key, and duplicated the new key after doing that. There is a chance, however, that calling the allocator surrenders control to a different thread, causing a double free if a different thread also calls this function. To make sure the update is atomic under the non-preemptive thread model, we must make sure not to surrender control to a different thread. Therefore, we avoid calling the allocator during the update. Signed-off-by: Justus Winter <[email protected]>
2017-01-23Update copyright notices for 2017.Werner Koch2-3/+3
-- Also some http:// -> https:// fixes. Signed-off-by: Werner Koch <[email protected]>
2017-01-18agent: Reduce sleep time in the progress callback.Werner Koch1-2/+10
* agent/gpg-agent.c (agent_libgcrypt_progress_cb): Reduce sleep time from 100ms to 1ms or use gpgrt_yield when build against a recent libgpg-error. -- Debian-bug-id: 851298 Signed-off-by: Werner Koch <[email protected]>
2017-01-16agent: Ask specific SERIALNO for pksign/pkdecrypt.NIIBE Yutaka5-7/+19
* agent/call-scd.c (agent_card_serialno): Add DEMAND argument. * agent/command-ssh.c (card_key_available): Follow the change. * agent/learncard.c (agent_handle_learn): Likewise. * agent/divert-scd.c (ask_for_card): Use DEMAND argument. Signed-off-by: NIIBE Yutaka <[email protected]>
2017-01-06agent,w32: Fix annoying output to DebugView.Werner Koch1-2/+6
* agent/gpg-agent.c (startup_fd_list): Do not define for W32. (main) [W32]: Do not call get_all_open_fds. -- GnuPG-bug-id: 2267 Signed-off-by: Werner Koch <[email protected]>
2016-12-19Remove unused debug flags and add "dns" and "network".Werner Koch2-6/+2
* g10/options.h (DBG_CARD_IO_VALUE, DBG_CARD_IO): Remove. * g10/gpg.c (debug_flags): Remove "cardio". * agent/agent.h (DBG_COMMAND_VALUE, DBG_COMMAND): Remove. * agent/gpg-agent.c (debug_flags): Remove "command". * scd/scdaemon.h (DBG_COMMAND_VALUE, DBG_COMMAND): Remove. * scd/scdaemon.c (debug_flags): Remove "command". * dirmngr/dirmngr.h (DBG_DNS_VALUE, DBG_DNS): New. (DBG_NETWORK_VALUE, DNG_NETWORK): New. * dirmngr/dirmngr.c (debug_flags): Add "dns" and "network". -- Note that "dns" and "network" are not yet used but will soon be added to dirmngr. Signed-off-by: Werner Koch <[email protected]>
2016-12-06agent: Respect --enable-large-secmemDaniel Kahn Gillmor1-1/+1
* agent/gpg-agent.c (main): Initialize secmem to the configured buffer size. -- This patch is a step toward addressing GnuPG-bug-id: 2857 Signed-off-by: Daniel Kahn Gillmor <[email protected]>
2016-11-29agent,dirmngr: Tiny restructuring.Werner Koch1-1/+6
* agent/gpg-agent.c (handle_connections): Add a comment. * dirmngr/dirmngr.c (main): Move assuan_sock_close of the listening socket to ... (handle_connections): here. Add a comment why we keep the listening socket open during a shutdown. Signed-off-by: Werner Koch <[email protected]>
2016-11-29agent,dirmngr: Handle corner case in shutdown mode.Werner Koch1-0/+6
* agent/gpg-agent.c (handle_connections): Keep on selecting on the inotify fd even when a shutdown is pending. * dirmngr/dirmngr.c (handle_connections): Ditto. Also simplifyy the use of the HAVE_INOTIFY_INIT cpp conditional. -- Without that patch we won't notice a removed socket when a shutdown is pending. This is somewhat related to bug report 2849. Signed-off-by: Werner Koch <[email protected]>
2016-11-29agent,w32: Initialize nPth in server mode.Werner Koch1-0/+5
* agent/gpg-agent.c (main) [W32]: Call initialize_modules in server mode. -- Fixes-commit: 9a707a223a3d45ccf245dee7989ca144e4e6bb49 Signed-off-by: Werner Koch <[email protected]>
2016-11-21agent: Fix npth + daemon mode problem.NIIBE Yutaka1-2/+0
* agent/gpg-agent.c (main): Remove duplicated initialization in daemon mode. -- The commit f57dc2b1e6f28d164f882373535dbcb0d632ca17 fixes a part of problem (for missing initialization of supervised mode). It was actually put in wrong place. Fixes-commit: 9f92b62a51d2d60f038fdbe01602865c5933fa95 Signed-off-by: NIIBE Yutaka <[email protected]>
2016-11-12agent: Improve concurrency when Libgcrypt 1.8 is used.Werner Koch1-9/+15
* agent/gpg-agent.c (thread_init_once): Tell Libgcrypt to reinit the system call clamp. (agent_libgcrypt_progress_cb): Do not sleep if Libgcrypt is recent enough. -- This patch prepares for a feature comming with Libgcrypt 1.8. Signed-off-by: Werner Koch <[email protected]>
2016-11-11agent: Kludge to mitigate blocking calls in Libgcrypt.Werner Koch1-3/+14
* agent/gpg-agent.c (agent_libgcrypt_progress_cb): Sleep for 100ms on "need_entropy". -- During key generation Libgrypt will read from /dev/random which may block. Libgcrypt is not nPth aware and thus the entire process will block. Fortunately there is also a select with a short timeout to run the progress callback. We detect this in gpg-agent and introduce a short delay to give other threads (i.e. connections) an opportunity to run. This alone is not sufficient, an updated Libgpg-error is also required to make the lock functions nPth aware. Signed-off-by: Werner Koch <[email protected]>
2016-11-11agent: Clean up comments.Daniel Kahn Gillmor1-2/+2
* agent/agent.h: Clean up comments. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
2016-11-05Change all http://www.gnu.org in license notices to https://Werner Koch24-24/+24
--
2016-11-03agent: Extend the PINENTRY_LAUNCHED inquiry and status.Werner Koch3-5/+30
* agent/call-pinentry.c (start_pinentry): Get flavor and version and pass it to agent_inq_pinentry_launched. * agent/command.c (agent_inq_pinentry_launched): Add arg EXTRA. * g10/server.c (gpg_proxy_pinentry_notify): Print a new diagnostic. Signed-off-by: Werner Koch <[email protected]>
2016-11-02Spelling: correct spelling of "passphrase".Daniel Kahn Gillmor2-3/+3
There were several different variant spellings of "passphrase". This should fix them all for all English text. I did notice that po/it.po contains multiple instances of "passhprase", which also looks suspect to me, but i do not know Italian, so i did not try to correct it. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
2016-10-27Fix typos.Justus Winter1-1/+1
-- Signed-off-by: Justus Winter <[email protected]>
2016-10-27agent,common: move get_socket_name() into common.Daniel Kahn Gillmor1-48/+2
* agent/gpg-agent.c (get_socket_name): move to ... * common/sysutils.c (gnupg_get_socket_name): ... here. -- This allows us to use the same functionality in dirmngr as well. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
2016-10-26agent: Avoid double error message.Werner Koch1-4/+3
* agent/gpg-agent.c (map_supervised_sockets): Shorten error message. Remove unneeded diagnostic. -- get_socket_name already prints error messages and thus there is not need to print another one. Signed-off-by: Werner Koch <[email protected]>