2005-01-26 Moritz Schulte <moritz@g10code.com>
authorMoritz Schulte <mo@g10code.com>
Wed, 26 Jan 2005 22:33:11 +0000 (22:33 +0000)
committerMoritz Schulte <mo@g10code.com>
Wed, 26 Jan 2005 22:33:11 +0000 (22:33 +0000)
* command-ssh.c (ssh_handler_sign_request): Confirm to agent
protocol in case of failure.

agent/ChangeLog
agent/command-ssh.c

index 051ed91..8c6444b 100644 (file)
@@ -1,6 +1,10 @@
 2005-01-26  Moritz Schulte  <moritz@g10code.com>
 
+       * command-ssh.c (ssh_handler_sign_request): Confirm to agent
+       protocol in case of failure.
+
        * command-ssh.c: New file.
+
        * Makefile.am (gpg_agent_SOURCES): New source file: command-ssh.c.
 
        * findkey.c (modify_description): New function.
index a76bbff..4c13f50 100644 (file)
@@ -1706,14 +1706,14 @@ ssh_handler_sign_request (ctrl_t ctrl, estream_t request, estream_t response)
   if (! bad)
     {
       /* Done.  */
-      es_write_byte (response, SSH_RESPONSE_SIGN_RESPONSE);
-      if (! es_ferror (response))
+      if (! err)
        {
-         if (! err)
+         es_write_byte (response, SSH_RESPONSE_SIGN_RESPONSE);
+         if (! es_ferror (response))
            es_write_string (response, sig, sig_n);
-         else
-           es_write_byte (response, SSH_RESPONSE_FAILURE);
        }
+      else
+       es_write_byte (response, SSH_RESPONSE_FAILURE);
     }
   
   gcry_sexp_release (key);