diff options
author | Damien Miller <djm@mindrot.org> | 2014-02-04 11:03:36 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2014-02-04 11:03:36 +1100 |
commit | 4a1c7aa640fb97d3472d51b215b6a0ec0fd025c7 (patch) | |
tree | 6fb1bfba860987b5d9042c478ae218d848850b64 /sshconnect1.c | |
parent | 4e8d937af79ce4e253f77ec93489d098b25becc3 (diff) |
- markus@cvs.openbsd.org 2014/01/27 19:18:54
[auth-rsa.c cipher.c ssh-agent.c sshconnect1.c sshd.c]
replace openssl MD5 with our ssh_digest_*; ok djm@
Diffstat (limited to 'sshconnect1.c')
-rw-r--r-- | sshconnect1.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sshconnect1.c b/sshconnect1.c index 7bd6cb018..57713d24d 100644 --- a/sshconnect1.c +++ b/sshconnect1.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sshconnect1.c,v 1.72 2013/09/02 22:00:34 deraadt Exp $ */ | 1 | /* $OpenBSD: sshconnect1.c,v 1.73 2014/01/27 19:18:54 markus Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -19,7 +19,6 @@ | |||
19 | #include <sys/socket.h> | 19 | #include <sys/socket.h> |
20 | 20 | ||
21 | #include <openssl/bn.h> | 21 | #include <openssl/bn.h> |
22 | #include <openssl/md5.h> | ||
23 | 22 | ||
24 | #include <stdarg.h> | 23 | #include <stdarg.h> |
25 | #include <stdio.h> | 24 | #include <stdio.h> |
@@ -47,6 +46,7 @@ | |||
47 | #include "canohost.h" | 46 | #include "canohost.h" |
48 | #include "hostfile.h" | 47 | #include "hostfile.h" |
49 | #include "auth.h" | 48 | #include "auth.h" |
49 | #include "digest.h" | ||
50 | 50 | ||
51 | /* Session id for the current session. */ | 51 | /* Session id for the current session. */ |
52 | u_char session_id[16]; | 52 | u_char session_id[16]; |
@@ -161,7 +161,7 @@ static void | |||
161 | respond_to_rsa_challenge(BIGNUM * challenge, RSA * prv) | 161 | respond_to_rsa_challenge(BIGNUM * challenge, RSA * prv) |
162 | { | 162 | { |
163 | u_char buf[32], response[16]; | 163 | u_char buf[32], response[16]; |
164 | MD5_CTX md; | 164 | struct ssh_digest_ctx *md; |
165 | int i, len; | 165 | int i, len; |
166 | 166 | ||
167 | /* Decrypt the challenge using the private key. */ | 167 | /* Decrypt the challenge using the private key. */ |
@@ -179,10 +179,12 @@ respond_to_rsa_challenge(BIGNUM * challenge, RSA * prv) | |||
179 | 179 | ||
180 | memset(buf, 0, sizeof(buf)); | 180 | memset(buf, 0, sizeof(buf)); |
181 | BN_bn2bin(challenge, buf + sizeof(buf) - len); | 181 | BN_bn2bin(challenge, buf + sizeof(buf) - len); |
182 | MD5_Init(&md); | 182 | if ((md = ssh_digest_start(SSH_DIGEST_MD5)) == NULL || |
183 | MD5_Update(&md, buf, 32); | 183 | ssh_digest_update(md, buf, 32) < 0 || |
184 | MD5_Update(&md, session_id, 16); | 184 | ssh_digest_update(md, session_id, 16) < 0 || |
185 | MD5_Final(response, &md); | 185 | ssh_digest_final(md, response, sizeof(response)) < 0) |
186 | fatal("%s: md5 failed", __func__); | ||
187 | ssh_digest_free(md); | ||
186 | 188 | ||
187 | debug("Sending response to host key RSA challenge."); | 189 | debug("Sending response to host key RSA challenge."); |
188 | 190 | ||