version 1.1, 2012/02/21 23:32:47
|
version 1.1.1.3, 2021/03/17 00:39:23
|
Line 138 ChapSendChallenge(Link l)
|
Line 138 ChapSendChallenge(Link l)
|
default: |
default: |
assert(0); |
assert(0); |
} |
} |
assert(cp->chal_len <= sizeof(cp->chal_data)); | assert(cp->chal_len <= (int)sizeof(cp->chal_data)); |
|
|
send_pkt: |
send_pkt: |
/* Build a challenge packet */ |
/* Build a challenge packet */ |
Line 287 ChapInput(Link l, AuthData auth, const u_char *pkt, u_
|
Line 287 ChapInput(Link l, AuthData auth, const u_char *pkt, u_
|
int chalOrig; |
int chalOrig; |
|
|
/* Check challenge length */ |
/* Check challenge length */ |
if (value_len < sizeof(buf)) | if (value_len < (int)sizeof(buf)) |
break; |
break; |
|
|
/* Copy challenge bits and extract origination value */ |
/* Copy challenge bits and extract origination value */ |
Line 448 ChapInput(Link l, AuthData auth, const u_char *pkt, u_
|
Line 448 ChapInput(Link l, AuthData auth, const u_char *pkt, u_
|
} |
} |
|
|
/* Log message */ |
/* Log message */ |
ShowMesg(LG_AUTH, l->name, (char *) pkt, len); | ShowMesg(LG_AUTH, l->name, (const char*)pkt, len); |
AuthFinish(l, AUTH_SELF_TO_PEER, auth->code == CHAP_SUCCESS); |
AuthFinish(l, AUTH_SELF_TO_PEER, auth->code == CHAP_SUCCESS); |
break; |
break; |
|
|
Line 644 ChapGenRandom(Link l, u_char *buf, int len)
|
Line 644 ChapGenRandom(Link l, u_char *buf, int len)
|
int k; |
int k; |
|
|
/* Prefix with our unique ID plus origination value */ |
/* Prefix with our unique ID plus origination value */ |
for (k = 0; k < sizeof(gIdBytes) && k < len; k++) | for (k = 0; k < (int)sizeof(gIdBytes) && k < len; k++) |
buf[k] = gIdBytes[k]; |
buf[k] = gIdBytes[k]; |
buf[0] |= (l->originate & 0x03) << 6; |
buf[0] |= (l->originate & 0x03) << 6; |
|
|
Line 698 ChapHash(Link l, int alg, u_char *hash_value, u_char i
|
Line 698 ChapHash(Link l, int alg, u_char *hash_value, u_char i
|
if (local) { /* generate reverse 'peer challenge' */ |
if (local) { /* generate reverse 'peer challenge' */ |
ChapGenRandom(l, val->peerChal, sizeof(val->peerChal)); |
ChapGenRandom(l, val->peerChal, sizeof(val->peerChal)); |
memset(val->reserved, 0, sizeof(val->reserved)); |
memset(val->reserved, 0, sizeof(val->reserved)); |
|
val->flags = 0; /* rfc2759, paragraph 4 says that flags MUST be zero */ |
} |
} |
GenerateNTResponse(challenge, |
GenerateNTResponse(challenge, |
val->peerChal, username, secret, val->ntHash); |
val->peerChal, username, secret, val->ntHash); |
Line 729 ChapHashAgree(int alg, const u_char *self, int slen,
|
Line 730 ChapHashAgree(int alg, const u_char *self, int slen,
|
|
|
case CHAP_ALG_MSOFT: |
case CHAP_ALG_MSOFT: |
{ |
{ |
struct mschapvalue *const sv = (struct mschapvalue *) self; | const struct mschapvalue *const sv = (const struct mschapvalue *) self; |
struct mschapvalue *const pv = (struct mschapvalue *) peer; | const struct mschapvalue *const pv = (const struct mschapvalue *) peer; |
|
|
if (slen != 49 || plen != 49) |
if (slen != 49 || plen != 49) |
return(0); |
return(0); |
Line 740 ChapHashAgree(int alg, const u_char *self, int slen,
|
Line 741 ChapHashAgree(int alg, const u_char *self, int slen,
|
} |
} |
case CHAP_ALG_MSOFTv2: |
case CHAP_ALG_MSOFTv2: |
{ |
{ |
struct mschapv2value *const sv =(struct mschapv2value *) self; | const struct mschapv2value *const sv =(const struct mschapv2value *) self; |
struct mschapv2value *const pv =(struct mschapv2value *) peer; | const struct mschapv2value *const pv =(const struct mschapv2value *) peer; |
|
|
if (slen != 49 || plen != 49) |
if (slen != 49 || plen != 49) |
return(0); |
return(0); |