to makefile.
Repaired support for use of gcc on Solaris x86 -- 32 bit modules also
need -fno-builtin.
MPPE changes broke plain MS-CHAP; repaired errors and cleaned up
compilation warnings due to char/unsigned char differences with non-gcc
compilers.
#
# Makefile for pppd under Solaris 2.
#
# Makefile for pppd under Solaris 2.
-# $Id: Makefile.sol2,v 1.25 2004/01/17 05:47:55 carlsonj Exp $
+# $Id: Makefile.sol2,v 1.26 2004/04/14 02:39:39 carlsonj Exp $
#
include ../Makedefs.com
#
include ../Makedefs.com
#CFLAGS += -DINET6
#OBJS += ipv6cp.o eui64.o
#CFLAGS += -DINET6
#OBJS += ipv6cp.o eui64.o
+# Uncomment to enable MS-CHAP
+#CFLAGS += -DUSE_CRYPT -DCHAPMS -DHAVE_CRYPT_H
+#OBJS += chap_ms.o pppcrypt.o md4.o sha1.o
+
+# Uncomment for CBCP
+#CFLAGS += -DCBCP_SUPPORT
+#OBJS += cbcp.o
+
-#define RCSID "$Id: chap_ms.c,v 1.30 2003/07/10 17:59:33 fcusack Exp $"
+#define RCSID "$Id: chap_ms.c,v 1.31 2004/04/14 02:39:39 carlsonj Exp $"
chapms_generate_challenge(unsigned char *challenge)
{
*challenge++ = 8;
chapms_generate_challenge(unsigned char *challenge)
{
*challenge++ = 8;
if (mschap_challenge && strlen(mschap_challenge) == 8)
memcpy(challenge, mschap_challenge, 8);
else
if (mschap_challenge && strlen(mschap_challenge) == 8)
memcpy(challenge, mschap_challenge, 8);
else
random_bytes(challenge, 8);
}
random_bytes(challenge, 8);
}
chapms2_generate_challenge(unsigned char *challenge)
{
*challenge++ = 16;
chapms2_generate_challenge(unsigned char *challenge)
{
*challenge++ = 16;
if (mschap_challenge && strlen(mschap_challenge) == 16)
memcpy(challenge, mschap_challenge, 16);
else
if (mschap_challenge && strlen(mschap_challenge) == 16)
memcpy(challenge, mschap_challenge, 16);
else
random_bytes(challenge, 16);
}
random_bytes(challenge, 16);
}
#endif
/* Generate the expected response. */
#endif
/* Generate the expected response. */
- ChapMS(challenge, secret, secret_len, &md);
+ ChapMS(challenge, (char *)secret, secret_len, &md);
#ifdef MSLANMAN
/* Determine which part of response to verify against */
#ifdef MSLANMAN
/* Determine which part of response to verify against */
/* Generate the expected response and our mutual auth. */
ChapMS2(challenge, rmd->PeerChallenge, name,
/* Generate the expected response and our mutual auth. */
ChapMS2(challenge, rmd->PeerChallenge, name,
- secret, secret_len, &md,
- saresponse, MS_CHAP2_AUTHENTICATOR);
+ (char *)secret, secret_len, &md,
+ (unsigned char *)saresponse, MS_CHAP2_AUTHENTICATOR);
/* compare MDs and send the appropriate status */
/*
/* compare MDs and send the appropriate status */
/*
{
challenge++; /* skip length, should be 16 */
*response++ = MS_CHAP2_RESPONSE_LEN;
{
challenge++; /* skip length, should be 16 */
*response++ = MS_CHAP2_RESPONSE_LEN;
- ChapMS2(challenge, mschap2_peer_challenge, our_name,
- secret, secret_len,
+ ChapMS2(challenge,
+#ifdef DEBUGMPPEKEY
+ mschap2_peer_challenge,
+#else
+ NULL,
+#endif
+ our_name, secret, secret_len,
(MS_Chap2Response *) response, private,
MS_CHAP2_AUTHENTICATEE);
}
(MS_Chap2Response *) response, private,
MS_CHAP2_AUTHENTICATEE);
}
static int
chapms2_check_success(unsigned char *msg, int len, unsigned char *private)
{
static int
chapms2_check_success(unsigned char *msg, int len, unsigned char *private)
{
- if ((len < MS_AUTH_RESPONSE_LENGTH + 2) || strncmp(msg, "S=", 2)) {
+ if ((len < MS_AUTH_RESPONSE_LENGTH + 2) ||
+ strncmp((char *)msg, "S=", 2) != 0) {
/* Packet does not start with "S=" */
error("MS-CHAPv2 Success packet is badly formed.");
return 0;
/* Packet does not start with "S=" */
error("MS-CHAPv2 Success packet is badly formed.");
return 0;
/* Authenticator Response matches. */
msg += MS_AUTH_RESPONSE_LENGTH; /* Eat it */
len -= MS_AUTH_RESPONSE_LENGTH;
/* Authenticator Response matches. */
msg += MS_AUTH_RESPONSE_LENGTH; /* Eat it */
len -= MS_AUTH_RESPONSE_LENGTH;
- if ((len >= 3) && !strncmp(msg, " M=", 3)) {
+ if ((len >= 3) && !strncmp((char *)msg, " M=", 3)) {
msg += 3; /* Eat the delimiter */
} else if (len) {
/* Packet has extra text which does not begin " M=" */
msg += 3; /* Eat the delimiter */
} else if (len) {
/* Packet has extra text which does not begin " M=" */
SHA1_Init(&sha1Context);
SHA1_Update(&sha1Context, PeerChallenge, 16);
SHA1_Update(&sha1Context, rchallenge, 16);
SHA1_Init(&sha1Context);
SHA1_Update(&sha1Context, PeerChallenge, 16);
SHA1_Update(&sha1Context, rchallenge, 16);
- SHA1_Update(&sha1Context, user, strlen(user));
+ SHA1_Update(&sha1Context, (unsigned char *)user, strlen(user));
SHA1_Final(sha1Hash, &sha1Context);
BCOPY(sha1Hash, Challenge, 8);
SHA1_Final(sha1Hash, &sha1Context);
BCOPY(sha1Hash, Challenge, 8);
MD4_CTX md4Context;
MD4Init(&md4Context);
MD4_CTX md4Context;
MD4Init(&md4Context);
- MD4Update(&md4Context, secret, mdlen);
+ MD4Update(&md4Context, (unsigned char *)secret, mdlen);
MD4Final(hash, &md4Context);
}
MD4Final(hash, &md4Context);
}
/* Hash the Unicode version of the secret (== password). */
ascii2unicode(secret, secret_len, unicodePassword);
/* Hash the Unicode version of the secret (== password). */
ascii2unicode(secret, secret_len, unicodePassword);
- NTPasswordHash(unicodePassword, secret_len * 2, PasswordHash);
+ NTPasswordHash((char *)unicodePassword, secret_len * 2, PasswordHash);
ChallengeResponse(rchallenge, PasswordHash, NTResponse);
}
ChallengeResponse(rchallenge, PasswordHash, NTResponse);
}
u_char PasswordHash[MD4_SIGNATURE_SIZE];
u_char Challenge[8];
u_char PasswordHash[MD4_SIGNATURE_SIZE];
u_char Challenge[8];
- ChallengeHash(PeerChallenge, rchallenge, username, Challenge);
+ ChallengeHash(PeerChallenge, (unsigned char *)rchallenge, username,
+ Challenge);
/* Hash the Unicode version of the secret (== password). */
ascii2unicode(secret, secret_len, unicodePassword);
/* Hash the Unicode version of the secret (== password). */
ascii2unicode(secret, secret_len, unicodePassword);
- NTPasswordHash(unicodePassword, secret_len * 2, PasswordHash);
+ NTPasswordHash((char *)unicodePassword, secret_len * 2, PasswordHash);
ChallengeResponse(Challenge, PasswordHash, NTResponse);
}
ChallengeResponse(Challenge, PasswordHash, NTResponse);
}
/* Hash (x2) the Unicode version of the secret (== password). */
ascii2unicode(secret, secret_len, unicodePassword);
/* Hash (x2) the Unicode version of the secret (== password). */
ascii2unicode(secret, secret_len, unicodePassword);
- NTPasswordHash(unicodePassword, secret_len * 2, PasswordHash);
- NTPasswordHash(PasswordHash, sizeof(PasswordHash), PasswordHashHash);
+ NTPasswordHash((char *)unicodePassword, secret_len * 2, PasswordHash);
+ NTPasswordHash((char *)PasswordHash, sizeof(PasswordHash),
+ PasswordHashHash);
SHA1_Init(&sha1Context);
SHA1_Update(&sha1Context, PasswordHashHash, sizeof(PasswordHashHash));
SHA1_Init(&sha1Context);
SHA1_Update(&sha1Context, PasswordHashHash, sizeof(PasswordHashHash));
/* Convert to ASCII hex string. */
for (i = 0; i < MAX((MS_AUTH_RESPONSE_LENGTH / 2), sizeof(Digest)); i++)
/* Convert to ASCII hex string. */
for (i = 0; i < MAX((MS_AUTH_RESPONSE_LENGTH / 2), sizeof(Digest)); i++)
- sprintf(&authResponse[i * 2], "%02X", Digest[i]);
+ sprintf((char *)&authResponse[i * 2], "%02X", Digest[i]);
sizeof(response->PeerChallenge));
/* Generate the NT-Response */
sizeof(response->PeerChallenge));
/* Generate the NT-Response */
- ChapMS2_NT(rchallenge, response->PeerChallenge, user,
+ ChapMS2_NT((char *)rchallenge, response->PeerChallenge, user,
secret, secret_len, response->NTResp);
/* Generate the Authenticator Response. */
secret, secret_len, response->NTResp);
/* Generate the Authenticator Response. */
#
# Makefile for STREAMS modules for Solaris 2.
#
#
# Makefile for STREAMS modules for Solaris 2.
#
-# $Id: Makefile.sol2gcc,v 1.2 2003/03/31 12:07:28 carlsonj Exp $
+# $Id: Makefile.sol2gcc,v 1.3 2004/04/14 02:39:39 carlsonj Exp $
COMP_OBJS = ppp_comp.o bsd-comp.o deflate.o zlib.o vjcompress.o \
ppp_comp_mod.o
COMP_OBJS = ppp_comp.o bsd-comp.o deflate.o zlib.o vjcompress.o \
ppp_comp_mod.o