summaryrefslogtreecommitdiff
path: root/usr.sbin/pppd
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-01-03 20:32:12 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-01-03 20:32:12 +0000
commit8aecba2d190d5b7146ff4ab97900c55b9e5283a2 (patch)
tree1cd957f0ef72c57d359a96430ab1df31817a3b7c /usr.sbin/pppd
parent5d09ca99824b44bb38508dd4df8e618b6962a84f (diff)
Use correct md5 API for libc md5 routines. Pointed out by niklas.
Diffstat (limited to 'usr.sbin/pppd')
-rw-r--r--usr.sbin/pppd/chap.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.sbin/pppd/chap.c b/usr.sbin/pppd/chap.c
index 8715b87d29b..bc22d59d169 100644
--- a/usr.sbin/pppd/chap.c
+++ b/usr.sbin/pppd/chap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: chap.c,v 1.4 1996/12/23 13:22:39 mickey Exp $ */
+/* $OpenBSD: chap.c,v 1.5 1997/01/03 20:32:11 millert Exp $ */
/*
* chap.c - Challenge Handshake Authentication Protocol.
@@ -36,7 +36,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: chap.c,v 1.4 1996/12/23 13:22:39 mickey Exp $";
+static char rcsid[] = "$OpenBSD: chap.c,v 1.5 1997/01/03 20:32:11 millert Exp $";
#endif
/*
@@ -48,10 +48,10 @@ static char rcsid[] = "$OpenBSD: chap.c,v 1.4 1996/12/23 13:22:39 mickey Exp $";
#include <sys/types.h>
#include <sys/time.h>
#include <syslog.h>
+#include <md5.h>
#include "pppd.h"
#include "chap.h"
-#include "md5.h"
#ifdef CHAPMS
#include "chap_ms.h"
@@ -454,8 +454,7 @@ ChapReceiveChallenge(cstate, inp, id, len)
MD5Update(&mdContext, &cstate->resp_id, 1);
MD5Update(&mdContext, secret, secret_len);
MD5Update(&mdContext, rchallenge, rchallenge_len);
- MD5Final(&mdContext);
- BCOPY(mdContext.digest, cstate->response, MD5_SIGNATURE_SIZE);
+ MD5Final(cstate->response, &mdContext);
cstate->resp_length = MD5_SIGNATURE_SIZE;
break;
@@ -491,6 +490,7 @@ ChapReceiveResponse(cstate, inp, id, len)
char rhostname[256];
MD5_CTX mdContext;
char secret[MAXSECRETLEN];
+ unsigned char digest[MD5_SIGNATURE_SIZE];
CHAPDEBUG((LOG_INFO, "ChapReceiveResponse: Rcvd id %d.", id));
@@ -563,10 +563,10 @@ ChapReceiveResponse(cstate, inp, id, len)
MD5Update(&mdContext, &cstate->chal_id, 1);
MD5Update(&mdContext, secret, secret_len);
MD5Update(&mdContext, cstate->challenge, cstate->chal_len);
- MD5Final(&mdContext);
+ MD5Final(digest, &mdContext);
/* compare local and remote MDs and send the appropriate status */
- if (memcmp (mdContext.digest, remmd, MD5_SIGNATURE_SIZE) == 0)
+ if (memcmp (digest, remmd, MD5_SIGNATURE_SIZE) == 0)
code = CHAP_SUCCESS; /* they are the same! */
break;