diff options
Diffstat (limited to 'ssh-agent.c')
-rw-r--r-- | ssh-agent.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/ssh-agent.c b/ssh-agent.c index 95117e076..256dff50c 100644 --- a/ssh-agent.c +++ b/ssh-agent.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssh-agent.c,v 1.181 2013/12/19 01:19:41 djm Exp $ */ | 1 | /* $OpenBSD: ssh-agent.c,v 1.182 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 |
@@ -50,7 +50,6 @@ | |||
50 | #include "openbsd-compat/sys-queue.h" | 50 | #include "openbsd-compat/sys-queue.h" |
51 | 51 | ||
52 | #include <openssl/evp.h> | 52 | #include <openssl/evp.h> |
53 | #include <openssl/md5.h> | ||
54 | #include "openbsd-compat/openssl-compat.h" | 53 | #include "openbsd-compat/openssl-compat.h" |
55 | 54 | ||
56 | #include <errno.h> | 55 | #include <errno.h> |
@@ -75,6 +74,7 @@ | |||
75 | #include "compat.h" | 74 | #include "compat.h" |
76 | #include "log.h" | 75 | #include "log.h" |
77 | #include "misc.h" | 76 | #include "misc.h" |
77 | #include "digest.h" | ||
78 | 78 | ||
79 | #ifdef ENABLE_PKCS11 | 79 | #ifdef ENABLE_PKCS11 |
80 | #include "ssh-pkcs11.h" | 80 | #include "ssh-pkcs11.h" |
@@ -248,7 +248,7 @@ process_authentication_challenge1(SocketEntry *e) | |||
248 | Identity *id; | 248 | Identity *id; |
249 | int i, len; | 249 | int i, len; |
250 | Buffer msg; | 250 | Buffer msg; |
251 | MD5_CTX md; | 251 | struct ssh_digest_ctx *md; |
252 | Key *key; | 252 | Key *key; |
253 | 253 | ||
254 | buffer_init(&msg); | 254 | buffer_init(&msg); |
@@ -284,10 +284,12 @@ process_authentication_challenge1(SocketEntry *e) | |||
284 | } | 284 | } |
285 | memset(buf, 0, 32); | 285 | memset(buf, 0, 32); |
286 | BN_bn2bin(challenge, buf + 32 - len); | 286 | BN_bn2bin(challenge, buf + 32 - len); |
287 | MD5_Init(&md); | 287 | if ((md = ssh_digest_start(SSH_DIGEST_MD5)) == NULL || |
288 | MD5_Update(&md, buf, 32); | 288 | ssh_digest_update(md, buf, 32) < 0 || |
289 | MD5_Update(&md, session_id, 16); | 289 | ssh_digest_update(md, session_id, 16) < 0 || |
290 | MD5_Final(mdbuf, &md); | 290 | ssh_digest_final(md, mdbuf, sizeof(mdbuf)) < 0) |
291 | fatal("%s: md5 failed", __func__); | ||
292 | ssh_digest_free(md); | ||
291 | 293 | ||
292 | /* Send the response. */ | 294 | /* Send the response. */ |
293 | buffer_put_char(&msg, SSH_AGENT_RSA_RESPONSE); | 295 | buffer_put_char(&msg, SSH_AGENT_RSA_RESPONSE); |