aboutsummaryrefslogtreecommitdiffstats
path: root/agent/command-ssh.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2013-02-22Remove some unused variables.Werner Koch1-0/+2
* tools/gpgconf-comp.c (gc_process_gpgconf_conf): Remove unused used_components. * agent/command-ssh.c (ssh_signature_encoder_ecdsa): Mark unused arg. * g13/g13.c (main): Comment variable of yet unimplemented options.
2012-12-12ssh: Support ECDSA keys.Werner Koch1-96/+307
* agent/command-ssh.c (SPEC_FLAG_IS_ECDSA): New. (struct ssh_key_type_spec): Add fields CURVE_NAME and HASH_ALGO. (ssh_key_types): Add types ecdsa-sha2-nistp{256,384,521}. (ssh_signature_encoder_t): Add arg spec and adjust all callers. (ssh_signature_encoder_ecdsa): New. (sexp_key_construct, sexp_key_extract, ssh_receive_key) (ssh_convert_key_to_blob): Support ecdsa. (ssh_identifier_from_curve_name): New. (ssh_send_key_public): Retrieve and pass the curve_name. (key_secret_to_public): Ditto. (data_sign): Add arg SPEC and change callers to pass it. (ssh_handler_sign_request): Get the hash algo from SPEC. * common/ssh-utils.c (get_fingerprint): Support ecdsa. * agent/protect.c (protect_info): Add flag ECC_HACK. (agent_protect): Allow the use of the "curve" parameter. * agent/t-protect.c (test_agent_protect): Add a test case for ecdsa. * agent/command-ssh.c (ssh_key_grip): Print a better error code. -- The 3 standard curves are now supported in gpg-agent's ssh-agent protocol implementation. I tested this with all 3 curves and keys generated by OpenSSH 5.9p1. Using existing non-ssh generated keys will likely fail for now. To fix this, the code should first undergo some more cleanup; then the fixes are pretty straightforward. And yes, the data structures are way too complicated.
2012-12-11ssh: Rewrite a function for better maintainabilityWerner Koch1-40/+41
* agent/command-ssh.c (ssh_signature_encoder_dsa): Rewrite. -- Using es_fopenmem instead of a preallocated buffer is safer and easier to read.
2012-12-10ssh: Improve key lookup for many keys.Werner Koch1-154/+166
* agent/command-ssh.c: Remove dirent.h. (control_file_s): Add struct item. (rewind_control_file): New. (search_control_file): Factor code out to ... (read_control_file_item): New. (ssh_handler_request_identities): Change to iterate over entries in sshcontrol. -- Formerly we scanned the private key directory for matches of entries in sshcontrol. This patch changes it to scan the sshcontrol file and thus considers only keys configured there. The rationale for this is that it is common to have only a few ssh keys but many private keys. Even if that assumption does not hold true, the scanning of the sshcontrol file is faster than reading the directory and only then scanning the ssh control for each directory entry.
2012-12-10ssh: Cleanup sshcontrol file access code.Werner Koch1-61/+104
* agent/command-ssh.c (SSH_CONTROL_FILE_NAME): New macro to replace the direct use of the string. (struct control_file_s, control_file_t): New. (open_control_file, close_control_file): New. Use them instead of using fopen/fclose directly.
2012-06-05Change all quotes in strings and comments to the new GNU standard.Werner Koch1-6/+6
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.
2011-11-28Improve ssh card key diagnostic message.Werner Koch1-2/+3
* 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-08-10Fixed set but unused variable bugsWerner Koch1-2/+0
2011-07-22Fix crash while reading unsupported ssh keys.Werner Koch1-12/+6
This bug was found by n-roeser at gmx.net (gnupg-devel@, msgid [email protected]).
2011-07-20Support a confirm flag for ssh.Werner Koch1-22/+133
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 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-62/+62
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-2/+2
2010-10-01Exporting secret keys via gpg-agent is now basically supported.Werner Koch1-2/+2
A couple of forward ported changes. Doc updates.
2010-09-01s/CACHE_MODE_IMPGEN/CACHE_MODE_NONCE/.Werner Koch1-1/+1
Prepare for more use cases of the cache nonce.
2010-08-26.Werner Koch1-7/+5
2010-04-14Whole lot of changes to support CE.Werner Koch1-1/+2
2010-03-10Merged jnlib into common.Werner Koch1-1/+0
2009-07-07Reworked passing of envars to Pinentry.Werner Koch1-16/+28
2009-05-15Fix bug #1053Werner Koch1-12/+49
Add option --qualitybar to command GET_PASSPHRASE.
2008-10-20Marked all unused args on non-W32 platforms.Werner Koch1-0/+15
2008-05-27Fixed segv in gpg-agent (command marktrusted).Werner Koch1-2/+2
Replaced almost all free by xfree. Translation fixes.
2007-11-19Started to implement the audit log feature.Werner Koch1-0/+4
Pass PINENTRY_USER_DATA and XAUTHORITY to Pinentry. Improved support for the quality bar. Minor internal restructuring. Translation fixes.
2007-10-152007-10-15 Daiki Ueno <[email protected]> (wk)Werner Koch1-3/+37
* command-ssh.c (reenter_compare_cb): New function; imported from genkey.c. (ssh_identity_register): Ask initial passphrase twice.
2007-10-01Use Assuan socket wrapper calls.Werner Koch1-5/+2
Made socket servers secure under Windows.
2007-07-04Changed to GPLv3.Werner Koch1-4/+2
Removed intl/.
2007-01-31agent/Werner Koch1-7/+15
* command-ssh.c (stream_read_string): Initialize LENGTH to zero. (start_command_handler_ssh): Use es_fgetc/es_ungetc to check if EOF has been reached before trying to process another request.
2006-11-20Made some PIN pads work.Werner Koch1-25/+15
Some cleanups for 64 bit CPUs.
2006-09-25Preparing a new releasegnupg-1.9.90Werner Koch1-2/+2
2006-09-14Take advantage of newer gpg-error features.Werner Koch1-40/+40
2006-08-29Allow for 4k ssh keys and better error reporting.Werner Koch1-0/+9
2006-06-27Various smaller changesWerner Koch1-11/+7
2006-06-20Updated FSF's address.Werner Koch1-2/+2
2006-04-092006-04-09 Moritz Schulte <[email protected]>Moritz Schulte1-5/+8
* command-ssh.c (ssh_request_process): Removed FIXME mentioning a possible DoS attack.
2006-04-012006-04-01 Moritz Schulte <[email protected]>Moritz Schulte1-3/+1
* command-ssh.c (ssh_identity_register): Make KEY_GRIP_RAW be 20 instead of 21 bytes long; do not fill KEY_GRIP_RAW[20] with NUL byte - KEY_GRIP_RAW is a raw binary string anyway.
2005-09-09Bug fixes and ssh support for the BELPIC.Werner Koch1-21/+25
2005-06-29(data_sign): Removed empty statement.Werner Koch1-1/+1
2005-06-16gcc-4 defaults forced me to edit many many files to get rid of theWerner Koch1-42/+33
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.
2005-06-07New debugging optionhs, updates to the manual.Werner Koch1-2/+3
2005-05-24* call-scd.c (inq_needpin): Skip leading spaces in of PINWerner Koch1-1/+1
description. * divert-scd.c (getpin_cb): Enhanced to cope with description flags. * query.c (agent_askpin): Add arg PROMPT_TEXT. Changed all callers.
2005-05-052005-05-05 Moritz Schulte <[email protected]>Moritz Schulte1-31/+29
* command-ssh.c: Use ssh_key_grip(), where gcry_pk_get_keygrip() has been used before. (ssh_handler_sign_request): Removed unusued variable P.
2005-05-052005-05-05 Moritz Schulte <[email protected]>Moritz Schulte1-38/+85
* command-ssh.c (ssh_key_to_buffer): Rename to ... (ssh_key_to_protected_buffer): ... this; change callers. Improved documentation.
2005-04-202005-04-20 Moritz Schulte <[email protected]>Moritz Schulte1-3/+0
* command-ssh.c (ssh_handler_request_identities): Removed debugging code (sleep call), which was commited unintenionally.
2005-04-18* configure.ac: Require libksba 0.9.11.Werner Koch1-0/+1
sm/ * call-dirmngr.c (inq_certificate): Add new inquire SENDCERT_SKI. * certlist.c (gpgsm_find_cert): Add new arg KEYID and implement this filter. Changed all callers. * certchain.c (find_up_search_by_keyid): New helper. (find_up): Also try using the AKI.keyIdentifier. (find_up_external): Ditto.
2005-04-092005-04-03 Moritz Schulte <[email protected]>Moritz Schulte1-60/+97
* command-ssh.c (ssh_request_spec): New member: secret_input. (REQUEST_SPEC_DEFINE): New argument: secret_input. (request_specs): Add secret_input flag. (request_spec_lookup): New function ... (ssh_request_process): ... use it here; depending on secret_input flag allocate secure or non-secure memory.
2005-03-03* acinclude.m4 (GNUPG_PTH_VERSION_CHECK): Accidently usedWerner Koch1-1/+1
--ldflags instead of --cflags. Reported by Kazu Yamamoto. * Makefile.am (AM_CFLAGS): Added PTH_CFLAGS. Noted by Kazu Yamamoto. * Makefile.am (gpgsm_LDADD): Added PTH_LIBS. Noted by Kazu Yamamoto.
2005-03-022005-03-02 Moritz Schulte <[email protected]>Moritz Schulte1-28/+49
* command-ssh.c (sexp_key_extract): Removed FIXME, since xtrymallos does set errno correctly by now. (sexp_extract_identifier): Remove const attribute from identifier. (ssh_handler_request_identities): Remove const attribute from key_type; removes ugly casts and FIXME. (sexp_key_extract): Remove const attribute from comment. (ssh_send_key_public): Remove const attribute from key_type/comment; removes ugly cast. (data_sign): Remove const attribute from identifier; removes ugly cast. (key_secret_to_public): Remove const attribute from comment; removes ugly cast. (ssh_handler_sign_request): Remove const attribute from p. (sexp_key_extract): Use make_cstring(). (ssh_key_extract_comment): Likewise. (ssh_key_to_buffer): Use secure memory for memory area to hold the key S-Expression. Added more comments.
2005-02-25* findkey.c (modify_description): Keep invalid % escapes, so thatWerner Koch1-28/+128
%0A may pass through. * agent.h (server_control_s): New field USE_AUTH_CALL. * call-scd.c (agent_card_pksign): Make use of it. * command-ssh.c (data_sign): Set the flag. (ssh_send_key_public): New arg OVERRIDE_COMMENT. (card_key_available): Add new arg CARDSN. (ssh_handler_request_identities): Use the card s/n as comment. (sexp_key_extract): Use GCRYMPI_FMT_STD. (data_sign): Ditto. * learncard.c (make_shadow_info): Moved to .. * protect.c (make_shadow_info): .. here. Return NULL on malloc failure. Made global. * agent.h: Add prototype. * xasprintf.c (xtryasprintf): New. * app-openpgp.c (get_public_key): Make sure not to return negative numbers. (do_sign): Allow passing of indata with algorithm prefix. (do_auth): Allow OPENPGP.3 as an alternative ID. * app.c (app_getattr): Return just the S/N but not the timestamp. * no-libgcrypt.c (gcry_strdup): New.
2005-02-24* call-scd.c (unescape_status_string): New. Actual a copy ofWerner Koch1-66/+142
../g10/call-agent.c (card_getattr_cb, agent_card_getattr): New. * command-ssh.c (card_key_available): New. (ssh_handler_request_identities): First see whether a card key is available. * app.c (app_getattr): Return APPTYPE or SERIALNO type even if the application does dot support the getattr call. * app.c (select_application): Return an error code and the application context in an new arg. * command.c (open_card): Adjusted for that. Don't use the fallback if no card is present. Return an error if the card has been removed without a reset. (do_reset, cmd_serialno): Clear that error flag. (TEST_CARD_REMOVAL): New. Use it with all command handlers. (scd_update_reader_status_file): Set the error flag on all changes.
2005-02-23* command-ssh.c (get_passphrase): Removed.Werner Koch1-76/+287
(ssh_identity_register): Partly rewritten. (open_control_file, search_control_file, add_control_entry): New. (ssh_handler_request_identities): Return only files listed in our control file. * findkey.c (unprotect): Check for allocation error. * agent.h (opt): Add fields to record the startup terminal settings. * gpg-agent.c (main): Record them and do not force keep display with --enable-ssh-support. * command-ssh.c (start_command_handler_ssh): Use them here. * gpg-agent.c: Renamed option --ssh-support to --enable-ssh-support. * command.c (cmd_readkey): New. (register_commands): Register new command "READKEY". * command-ssh.c (ssh_request_process): Improved logging. * findkey.c (agent_write_private_key): Always use plain open. Don't depend on an umask for permissions. (agent_key_from_file): Factored file reading code out to .. (read_key_file): .. new function. (agent_public_key_from_file): New.