91static option_t chap_option_list[] = {
93 "Set timeout for CHAP" },
95 "Set max #xmits for challenge" },
97 "Set interval for rechallenge" },
99 {
"ms-lanman", o_bool, &ms_lanman,
100 "Use LanMan passwd when using MS-CHAP", 1 },
109static void ChapInit (
int);
110static void ChapLowerUp (
int);
111static void ChapLowerDown (
int);
112static void ChapInput (
int,
u_char *,
int);
113static void ChapProtocolReject (
int);
114#if PPP_ADDITIONAL_CALLBACKS
115static int ChapPrintPkt (
u_char *,
int,
void (*) (
void *,
char *, ...),
void *);
127#if PPP_ADDITIONAL_CALLBACKS
133#if PPP_ADDITIONAL_CALLBACKS
142static void ChapChallengeTimeout (
void *);
143static void ChapResponseTimeout (
void *);
145static void ChapRechallenge (
void *);
149static void ChapSendStatus (
chap_state *,
int);
166 cstate->timeouttime = CHAP_DEFTIMEOUT;
167 cstate->max_transmits = CHAP_DEFTRANSMITS;
181 cstate->resp_name = our_name;
182 cstate->resp_type = digest;
208 cstate->chal_name = our_name;
209 cstate->chal_type = digest;
219 ChapSendChallenge(
cstate);
228ChapChallengeTimeout(
void *
arg)
247 ChapSendChallenge(
cstate);
255ChapResponseTimeout(
void *
arg)
272ChapRechallenge(
void *
arg)
282 ChapSendChallenge(
cstate);
307 ChapSendChallenge(
cstate);
319ChapLowerDown(
int unit)
326 UNTIMEOUT(ChapChallengeTimeout,
cstate);
328 &&
cstate->chal_interval != 0) {
329 UNTIMEOUT(ChapRechallenge,
cstate);
332 UNTIMEOUT(ChapResponseTimeout,
cstate);
343ChapProtocolReject(
int unit)
363ChapInput(
int unit,
u_char *inpacket,
int packet_len)
386 if (
len > packet_len) {
397 ChapReceiveChallenge(
cstate, inp,
id,
len);
401 ChapReceiveResponse(
cstate, inp,
id,
len);
405 ChapReceiveFailure(
cstate, inp,
id,
len);
409 ChapReceiveSuccess(
cstate, inp,
id,
len);
428 char secret[MAXSECRETLEN];
446 GETCHAR(rchallenge_len, inp);
453 INCPTR(rchallenge_len, inp);
455 if (
len >= (
int)
sizeof(rhostname)) {
456 len =
sizeof(rhostname) - 1;
458 BCOPY(inp, rhostname,
len);
459 rhostname[
len] =
'\000';
465 if (ppp_settings.remote_name[0] != 0 && (ppp_settings.explicit_remote || rhostname[0] == 0)) {
466 strncpy(rhostname, ppp_settings.remote_name,
sizeof(rhostname));
467 rhostname[
sizeof(rhostname) - 1] = 0;
474 secret, &secret_len, 0)) {
482 UNTIMEOUT(ChapResponseTimeout,
cstate);
486 cstate->resp_transmits = 0;
489 switch (
cstate->resp_type) {
495 MD5Update(&mdContext, rchallenge, rchallenge_len);
524 int secret_len, old_state;
528 char secret[MAXSECRETLEN];
540 if (
id !=
cstate->chal_id) {
562 GETCHAR(remmd_len, inp);
564 INCPTR(remmd_len, inp);
572 UNTIMEOUT(ChapChallengeTimeout,
cstate);
574 if (
len >= (
int)
sizeof(rhostname)) {
575 len =
sizeof(rhostname) - 1;
577 BCOPY(inp, rhostname,
len);
578 rhostname[
len] =
'\000';
589 secret, &secret_len, 1)) {
594 switch (
cstate->chal_type) {
621 old_state =
cstate->serverstate;
626 if (
cstate->chal_interval != 0) {
659 UNTIMEOUT(ChapResponseTimeout,
cstate);
692 UNTIMEOUT(ChapResponseTimeout,
cstate);
713 int chal_len, name_len;
716 chal_len =
cstate->chal_len;
719 outp = outpacket_buf[
cstate->unit];
721 MAKEHEADER(outp, PPP_CHAP);
724 PUTCHAR(
cstate->chal_id, outp);
725 PUTSHORT(outlen, outp);
727 PUTCHAR(chal_len, outp);
728 BCOPY(
cstate->challenge, outp, chal_len);
729 INCPTR(chal_len, outp);
731 BCOPY(
cstate->chal_name, outp, name_len);
733 pppWrite(
cstate->unit, outpacket_buf[
cstate->unit], outlen + PPP_HDRLEN);
755 strcpy(
msg,
"I don't like you. Go 'way.");
760 outp = outpacket_buf[
cstate->unit];
762 MAKEHEADER(outp, PPP_CHAP);
765 PUTCHAR(
cstate->chal_id, outp);
766 PUTSHORT(outlen, outp);
767 BCOPY(
msg, outp, msglen);
768 pppWrite(
cstate->unit, outpacket_buf[
cstate->unit], outlen + PPP_HDRLEN);
794 LWIP_ASSERT(
"chal_len <= 0xff", chal_len <= 0xffff);
797 cstate->chal_transmits = 0;
800 for (
i = 0;
i < chal_len;
i++ ) {
814 int outlen, md_len, name_len;
816 md_len =
cstate->resp_length;
819 outp = outpacket_buf[
cstate->unit];
821 MAKEHEADER(outp, PPP_CHAP);
824 PUTCHAR(
cstate->resp_id, outp);
825 PUTSHORT(outlen, outp);
827 PUTCHAR(md_len, outp);
828 BCOPY(
cstate->response, outp, md_len);
829 INCPTR(md_len, outp);
831 BCOPY(
cstate->resp_name, outp, name_len);
834 pppWrite(
cstate->unit, outpacket_buf[
cstate->unit], outlen + PPP_HDRLEN);
841#if PPP_ADDITIONAL_CALLBACKS
842static char *ChapCodenames[] = {
843 "Challenge",
"Response",
"Success",
"Failure"
849ChapPrintPkt(
u_char *
p,
int plen,
void (*printer) (
void *,
char *, ...),
void *
arg)
861 if (len < CHAP_HEADERLEN || len > plen) {
865 if (
code >= 1 &&
code <=
sizeof(ChapCodenames) /
sizeof(
char *)) {
866 printer(
arg,
" %s", ChapCodenames[
code-1]);
868 printer(
arg,
" code=0x%x",
code);
870 printer(
arg,
" id=0x%x",
id);
879 if (
len < clen + 1) {
883 nlen =
len - clen - 1;
885 for (; clen > 0; --clen) {
887 printer(
arg,
"%.2x",
x);
889 printer(
arg,
">, name = %.*Z", nlen,
p);
896 for (clen =
len; clen > 0; --clen) {
898 printer(
arg,
" %.2x",
x);
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
char * strcpy(char *DstString, const char *SrcString)
char * strncpy(char *DstString, const char *SrcString, ACPI_SIZE Count)
#define LWIP_UNUSED_ARG(x)
struct protent chap_protent
void ChapAuthPeer(int, char *, u_char)
#define MIN_CHALLENGE_LENGTH
#define CHAPSS_INITIAL_CHAL
#define MD5_SIGNATURE_SIZE
#define CHAPSS_RECHALLENGE
void ChapAuthWithPeer(int, char *, u_char)
#define MAX_CHALLENGE_LENGTH
void ChapMS(chap_state *, char *, int, char *, int)
VOID WINAPI MD5Final(MD5_CTX *)
VOID WINAPI MD5Init(MD5_CTX *)
VOID WINAPI MD5Update(MD5_CTX *, const unsigned char *, unsigned int)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
#define LWIP_ASSERT(message, assertion)
void auth_peer_success(int, u16_t, char *, int)
void auth_peer_fail(int, u16_t)
void auth_withpeer_fail(int, u16_t)
int get_secret(int, char *, char *, char *, int *, int)
void auth_withpeer_success(int, u16_t)
GLint GLint GLint GLint GLint x
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
static DATA_BLOB CRYPTPROTECT_PROMPTSTRUCT DATA_BLOB *static LPWSTR DATA_BLOB CRYPTPROTECT_PROMPTSTRUCT DATA_BLOB *static char secret[]
static unsigned(__cdecl *hash_bstr)(bstr_t s)
png_const_structrp png_const_inforp int * unit