summaryrefslogtreecommitdiff
path: root/sshconnect1.c
diff options
context:
space:
mode:
Diffstat (limited to 'sshconnect1.c')
-rw-r--r--sshconnect1.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sshconnect1.c b/sshconnect1.c
index d6230529f..09d0210a9 100644
--- a/sshconnect1.c
+++ b/sshconnect1.c
@@ -13,7 +13,7 @@
13 */ 13 */
14 14
15#include "includes.h" 15#include "includes.h"
16RCSID("$OpenBSD: sshconnect1.c,v 1.13 2000/12/19 23:17:58 markus Exp $"); 16RCSID("$OpenBSD: sshconnect1.c,v 1.14 2001/01/08 21:55:41 markus Exp $");
17 17
18#include <openssl/bn.h> 18#include <openssl/bn.h>
19#include <openssl/dsa.h> 19#include <openssl/dsa.h>
@@ -62,7 +62,6 @@ try_agent_authentication()
62 return 0; 62 return 0;
63 63
64 challenge = BN_new(); 64 challenge = BN_new();
65 key = key_new(KEY_RSA1);
66 65
67 /* Loop through identities served by the agent. */ 66 /* Loop through identities served by the agent. */
68 for (key = ssh_get_first_identity(auth, &comment, 1); 67 for (key = ssh_get_first_identity(auth, &comment, 1);
@@ -125,6 +124,7 @@ try_agent_authentication()
125 124
126 /* The server returns success if it accepted the authentication. */ 125 /* The server returns success if it accepted the authentication. */
127 if (type == SSH_SMSG_SUCCESS) { 126 if (type == SSH_SMSG_SUCCESS) {
127 ssh_close_authentication_connection(auth);
128 BN_clear_free(challenge); 128 BN_clear_free(challenge);
129 debug("RSA authentication accepted by server."); 129 debug("RSA authentication accepted by server.");
130 return 1; 130 return 1;
@@ -134,6 +134,7 @@ try_agent_authentication()
134 packet_disconnect("Protocol error waiting RSA auth response: %d", 134 packet_disconnect("Protocol error waiting RSA auth response: %d",
135 type); 135 type);
136 } 136 }
137 ssh_close_authentication_connection(auth);
137 BN_clear_free(challenge); 138 BN_clear_free(challenge);
138 debug("RSA authentication using agent refused."); 139 debug("RSA authentication using agent refused.");
139 return 0; 140 return 0;
@@ -270,6 +271,8 @@ try_rsa_authentication(const char *authfile)
270 /* Expect the server to reject it... */ 271 /* Expect the server to reject it... */
271 packet_read_expect(&plen, SSH_SMSG_FAILURE); 272 packet_read_expect(&plen, SSH_SMSG_FAILURE);
272 xfree(comment); 273 xfree(comment);
274 key_free(private);
275 BN_clear_free(challenge);
273 return 0; 276 return 0;
274 } 277 }
275 /* Destroy the passphrase. */ 278 /* Destroy the passphrase. */