summaryrefslogtreecommitdiff
path: root/pppd/chap_ms.c
diff options
context:
space:
mode:
authorChung-yih Wang <cywang@google.com>2009-04-14 16:37:04 +0800
committerChung-yih Wang <cywang@google.com>2009-04-21 15:24:09 +0800
commite7f221f12403dcb4081d08e28c54d3b2a1ab05ee (patch)
treef3504ceeef3b634c8f0e4a0858435114dad11f14 /pppd/chap_ms.c
parent8ad0dd2a5c5f23cd210aedba72a43e48026e7436 (diff)
downloadppp-e7f221f12403dcb4081d08e28c54d3b2a1ab05ee.tar.gz
This change is for enabling the pppd for vpn authentication and setup.
It includes: 1. Enable the CHAPMS authentication for talking to MS vpn server. 2. Reuse the message digest/hashing functions in openssl instead of the md4, md5 and sha1 functions in the package to save the space. 3. Enable the execution the ip-up/ip-down script on Android. Update: add comment and replace tab with spaces.
Diffstat (limited to 'pppd/chap_ms.c')
-rw-r--r--pppd/chap_ms.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/pppd/chap_ms.c b/pppd/chap_ms.c
index fb65d56..5f2c0e2 100644
--- a/pppd/chap_ms.c
+++ b/pppd/chap_ms.c
@@ -89,8 +89,12 @@
#include "pppd.h"
#include "chap-new.h"
#include "chap_ms.h"
+#ifdef ANDROID_CHANGES
+#include "openssl-hash.h"
+#else
#include "md4.h"
#include "sha1.h"
+#endif
#include "pppcrypt.h"
#include "magic.h"
@@ -514,12 +518,17 @@ ascii2unicode(char ascii[], int ascii_len, u_char unicode[])
static void
NTPasswordHash(char *secret, int secret_len, u_char hash[MD4_SIGNATURE_SIZE])
{
+#ifdef ANDROID_CHANGES
+ /* We link with MD4 routines in openssl, we have to take bytes instead */
+ int mdlen = secret_len;
+#else
#ifdef __NetBSD__
/* NetBSD uses the libc md4 routines which take bytes instead of bits */
int mdlen = secret_len;
#else
int mdlen = secret_len * 8;
#endif
+#endif
MD4_CTX md4Context;
MD4Init(&md4Context);