summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/ssh-agent.c
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2014-01-27 19:18:55 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2014-01-27 19:18:55 +0000
commit3cbe6fd2f7a24e2ec071d048869252ef81545755 (patch)
tree3a55e8da479a130415e491251e66856063bb9851 /usr.bin/ssh/ssh-agent.c
parent2d6e8b0af2e1cb14e383dbaa679fdde97933d2f5 (diff)
replace openssl MD5 with our ssh_digest_*; ok djm@
Diffstat (limited to 'usr.bin/ssh/ssh-agent.c')
-rw-r--r--usr.bin/ssh/ssh-agent.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/usr.bin/ssh/ssh-agent.c b/usr.bin/ssh/ssh-agent.c
index f65aec9004e..f24369bd6a2 100644
--- a/usr.bin/ssh/ssh-agent.c
+++ b/usr.bin/ssh/ssh-agent.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-agent.c,v 1.181 2013/12/19 01:19:41 djm Exp $ */
+/* $OpenBSD: ssh-agent.c,v 1.182 2014/01/27 19:18:54 markus Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -44,7 +44,6 @@
#include <sys/param.h>
#include <openssl/evp.h>
-#include <openssl/md5.h>
#include <errno.h>
#include <fcntl.h>
@@ -65,6 +64,7 @@
#include "compat.h"
#include "log.h"
#include "misc.h"
+#include "digest.h"
#ifdef ENABLE_PKCS11
#include "ssh-pkcs11.h"
@@ -234,7 +234,7 @@ process_authentication_challenge1(SocketEntry *e)
Identity *id;
int i, len;
Buffer msg;
- MD5_CTX md;
+ struct ssh_digest_ctx *md;
Key *key;
buffer_init(&msg);
@@ -270,10 +270,12 @@ process_authentication_challenge1(SocketEntry *e)
}
memset(buf, 0, 32);
BN_bn2bin(challenge, buf + 32 - len);
- MD5_Init(&md);
- MD5_Update(&md, buf, 32);
- MD5_Update(&md, session_id, 16);
- MD5_Final(mdbuf, &md);
+ if ((md = ssh_digest_start(SSH_DIGEST_MD5)) == NULL ||
+ ssh_digest_update(md, buf, 32) < 0 ||
+ ssh_digest_update(md, session_id, 16) < 0 ||
+ ssh_digest_final(md, mdbuf, sizeof(mdbuf)) < 0)
+ fatal("%s: md5 failed", __func__);
+ ssh_digest_free(md);
/* Send the response. */
buffer_put_char(&msg, SSH_AGENT_RSA_RESPONSE);