summaryrefslogtreecommitdiff
path: root/sshconnect1.c
diff options
context:
space:
mode:
Diffstat (limited to 'sshconnect1.c')
-rw-r--r--sshconnect1.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sshconnect1.c b/sshconnect1.c
index 5a5a22227..e732806f3 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.20 2001/01/22 23:06:40 markus Exp $"); 16RCSID("$OpenBSD: sshconnect1.c,v 1.21 2001/01/29 19:47:31 markus Exp $");
17 17
18#include <openssl/bn.h> 18#include <openssl/bn.h>
19#include <openssl/evp.h> 19#include <openssl/evp.h>
@@ -163,14 +163,17 @@ respond_to_rsa_challenge(BIGNUM * challenge, RSA * prv)
163 int i, len; 163 int i, len;
164 164
165 /* Decrypt the challenge using the private key. */ 165 /* Decrypt the challenge using the private key. */
166 rsa_private_decrypt(challenge, challenge, prv); 166 /* XXX think about Bleichenbacher, too */
167 if (rsa_private_decrypt(challenge, challenge, prv) <= 0)
168 packet_disconnect(
169 "respond_to_rsa_challenge: rsa_private_decrypt failed");
167 170
168 /* Compute the response. */ 171 /* Compute the response. */
169 /* The response is MD5 of decrypted challenge plus session id. */ 172 /* The response is MD5 of decrypted challenge plus session id. */
170 len = BN_num_bytes(challenge); 173 len = BN_num_bytes(challenge);
171 if (len <= 0 || len > sizeof(buf)) 174 if (len <= 0 || len > sizeof(buf))
172 packet_disconnect("respond_to_rsa_challenge: bad challenge length %d", 175 packet_disconnect(
173 len); 176 "respond_to_rsa_challenge: bad challenge length %d", len);
174 177
175 memset(buf, 0, sizeof(buf)); 178 memset(buf, 0, sizeof(buf));
176 BN_bn2bin(challenge, buf + sizeof(buf) - len); 179 BN_bn2bin(challenge, buf + sizeof(buf) - len);