diff options
Diffstat (limited to 'agent')
-rw-r--r-- | agent/ChangeLog | 7 | ||||
-rw-r--r-- | agent/call-scd.c | 2 | ||||
-rw-r--r-- | agent/command-ssh.c | 13 | ||||
-rw-r--r-- | agent/learncard.c | 28 |
4 files changed, 33 insertions, 17 deletions
diff --git a/agent/ChangeLog b/agent/ChangeLog index f9064e46b..420dc6368 100644 --- a/agent/ChangeLog +++ b/agent/ChangeLog @@ -1,3 +1,10 @@ +2005-02-22 Werner Koch <[email protected]> + + * command-ssh.c (stream_read_string): Removed call to abort on + memory error because the CVS version of libgcrypt makes sure + that ERRNO gets always set on error even with a faulty user + supplied function. + 2005-02-19 Moritz Schulte <[email protected]> * command-ssh.c (ssh_receive_mpint_list): Slightly rewritten, do diff --git a/agent/call-scd.c b/agent/call-scd.c index 619a549f9..bffdbcbad 100644 --- a/agent/call-scd.c +++ b/agent/call-scd.c @@ -296,7 +296,7 @@ learn_status_cb (void *opaque, const char *line) return 0; } -/* Perform the learn command and return a list of all private keys +/* Perform the LEARN command and return a list of all private keys stored on the card. */ int agent_card_learn (ctrl_t ctrl, diff --git a/agent/command-ssh.c b/agent/command-ssh.c index fbd296ea6..1719602f2 100644 --- a/agent/command-ssh.c +++ b/agent/command-ssh.c @@ -215,15 +215,12 @@ static ssh_key_type_spec_t ssh_key_types[] = - - - /* General utility functions. */ /* A secure realloc, i.e. it makes sure to allocate secure memory if A - is NULL. This is required becuase the standard gcry_realloc does + is NULL. This is required because the standard gcry_realloc does not know whether to allocate secure or normal if NULL is passed as existing buffer. */ static void * @@ -419,9 +416,7 @@ stream_read_string (estream_t stream, unsigned int secure, buffer = xtrymalloc (length + 1); if (! buffer) { - /* FIXME: xtrymalloc_secure does not set errno, does it? */ err = gpg_error_from_errno (errno); - abort (); goto out; } @@ -1530,6 +1525,8 @@ ssh_handler_request_identities (ctrl_t ctrl, free (key_directory); xfree (key_path); xfree (buffer); + /* FIXME: Ist is for sure is a Bad Thing to use the const qualifier + and later cast it away. You can't do that!!! */ xfree ((void *) key_type); /* FIXME? */ return ret_err; @@ -2159,7 +2156,7 @@ ssh_lock (void) gpg_error_t err; /* FIXME */ - log_error (_("lock command is not implemented\n")); + log_error ("ssh-agent's lock command is not implemented\n"); err = 0; return err; @@ -2170,7 +2167,7 @@ ssh_unlock (void) { gpg_error_t err; - log_error (_("unlock command is not implemented\n")); + log_error ("ssh-agent's unlock command is not implemented\n"); err = 0; return err; diff --git a/agent/learncard.c b/agent/learncard.c index 76e8986f8..7dcacee28 100644 --- a/agent/learncard.c +++ b/agent/learncard.c @@ -31,11 +31,16 @@ #include "agent.h" #include <assuan.h> +/* Structures used by the callback mechanism to convey information + pertaining to key pairs. */ struct keypair_info_s { struct keypair_info_s *next; int no_cert; - char *id; /* points into grip */ - char hexgrip[1]; + char *id; /* points into grip */ + char hexgrip[1]; /* The keygrip (i.e. a hash over the public key + parameters) formatted as a hex string. + Allocated somewhat large to also act as + memeory for the above ID field. */ }; typedef struct keypair_info_s *KEYPAIR_INFO; @@ -45,6 +50,9 @@ struct kpinfo_cb_parm_s { }; + +/* Structures used by the callback mechanism to convey information + pertaining to certificates. */ struct certinfo_s { struct certinfo_s *next; int type; @@ -59,6 +67,8 @@ struct certinfo_cb_parm_s { }; +/* Structures used by the callback mechanism to convey assuan status + lines. */ struct sinfo_s { struct sinfo_s *next; char *data; /* Points into keyword. */ @@ -72,7 +82,7 @@ struct sinfo_cb_parm_s { }; - +/* Destructor for key information objects. */ static void release_keypair_info (KEYPAIR_INFO info) { @@ -84,6 +94,7 @@ release_keypair_info (KEYPAIR_INFO info) } } +/* Destructor for certificate information objects. */ static void release_certinfo (CERTINFO info) { @@ -95,6 +106,7 @@ release_certinfo (CERTINFO info) } } +/* Destructor for status information objects. */ static void release_sinfo (SINFO info) { @@ -285,7 +297,7 @@ send_cert_back (ctrl_t ctrl, const char *id, void *assuan_context) } /* Perform the learn operation. If ASSUAN_CONTEXT is not NULL all new - certificates are send via Assuan */ + certificates are send back via Assuan. */ int agent_handle_learn (ctrl_t ctrl, void *assuan_context) { @@ -317,7 +329,7 @@ agent_handle_learn (ctrl_t ctrl, void *assuan_context) if (rc) goto leave; - /* now gather all the available info */ + /* Now gather all the available info. */ rc = agent_card_learn (ctrl, kpinfo_cb, &parm, certinfo_cb, &cparm, sinfo_cb, &sparm); if (!rc && (parm.error || cparm.error || sparm.error)) @@ -371,15 +383,15 @@ agent_handle_learn (ctrl_t ctrl, void *assuan_context) log_info (" id: %s (grip=%s)\n", item->id, item->hexgrip); if (item->no_cert) - continue; /* no public key yet available */ + continue; /* No public key yet available. */ for (p=item->hexgrip, i=0; i < 20; p += 2, i++) grip[i] = xtoi_2 (p); if (!agent_key_available (grip)) - continue; + continue; /* The key is already available. */ - /* unknown - store it */ + /* Unknown key - store it. */ rc = agent_card_readkey (ctrl, item->id, &pubkey); if (rc) { |