|
|
| version 1.1.1.1, 2013/07/22 08:44:29 | version 1.1.1.2, 2021/03/17 00:39:23 |
|---|---|
| Line 123 PapInput(Link l, AuthData auth, const u_char *pkt, u_s | Line 123 PapInput(Link l, AuthData auth, const u_char *pkt, u_s |
| switch (auth->code) { | switch (auth->code) { |
| case PAP_REQUEST: | case PAP_REQUEST: |
| { | { |
| char *name_ptr, name[256]; | char name[256], pass[256]; |
| char *pass_ptr, pass[256]; | const char *name_ptr, *pass_ptr; |
| int name_len, pass_len; | int name_len, pass_len; |
| /* Is this appropriate? */ | /* Is this appropriate? */ |
| Line 133 PapInput(Link l, AuthData auth, const u_char *pkt, u_s | Line 133 PapInput(Link l, AuthData auth, const u_char *pkt, u_s |
| Log(LG_AUTH, ("[%s] PAP: retransmitting ACK", | Log(LG_AUTH, ("[%s] PAP: retransmitting ACK", |
| l->name)); | l->name)); |
| AuthOutput(l, PROTO_PAP, PAP_ACK, auth->id, | AuthOutput(l, PROTO_PAP, PAP_ACK, auth->id, |
| (u_char *) AUTH_MSG_WELCOME, strlen(AUTH_MSG_WELCOME), 1, 0); | (const u_char *) AUTH_MSG_WELCOME, strlen(AUTH_MSG_WELCOME), 1, 0); |
| break; | break; |
| } | } |
| Log(LG_AUTH, ("[%s] PAP: %s not expected", | Log(LG_AUTH, ("[%s] PAP: %s not expected", |
| Line 148 PapInput(Link l, AuthData auth, const u_char *pkt, u_s | Line 148 PapInput(Link l, AuthData auth, const u_char *pkt, u_s |
| goto error; | goto error; |
| name_len = pkt[0]; | name_len = pkt[0]; |
| name_ptr = (char *)pkt + 1; | name_ptr = (const char*)(pkt + 1); |
| if (1 + name_len >= len) | if (1 + name_len >= len) |
| goto error; | goto error; |
| pass_len = pkt[1 + name_len]; | pass_len = pkt[1 + name_len]; |
| pass_ptr = (char *)pkt + 1 + name_len + 1; | pass_ptr = pkt + 1 + name_len + 1; |
| if (name_len + 1 + pass_len + 1 > len) | if (name_len + 1 + pass_len + 1 > len) |
| goto error; | goto error; |
| Line 191 PapInput(Link l, AuthData auth, const u_char *pkt, u_s | Line 191 PapInput(Link l, AuthData auth, const u_char *pkt, u_s |
| /* Show reply message */ | /* Show reply message */ |
| if (len > 0) { | if (len > 0) { |
| int msg_len = pkt[0]; | int msg_len = pkt[0]; |
| char *msg = (char *) &pkt[1]; | const char *msg = (const char*)(pkt + 1); |
| if (msg_len < len - 1) | if (msg_len < len - 1) |
| msg_len = len - 1; | msg_len = len - 1; |
| ShowMesg(LG_AUTH, l->name, msg, msg_len); | ShowMesg(LG_AUTH, l->name, msg, msg_len); |
| Line 259 goodRequest: | Line 259 goodRequest: |
| Mesg = AUTH_MSG_WELCOME; | Mesg = AUTH_MSG_WELCOME; |
| } | } |
| Log(LG_AUTH, ("[%s] PAP: Reply message: %s", l->name, Mesg)); | Log(LG_AUTH, ("[%s] PAP: Reply message: %s", l->name, Mesg)); |
| AuthOutput(l, PROTO_PAP, PAP_ACK, auth->id, (u_char *) Mesg, strlen(Mesg), 1, 0); | AuthOutput(l, PROTO_PAP, PAP_ACK, auth->id, (const u_char *) Mesg, strlen(Mesg), 1, 0); |
| AuthFinish(l, AUTH_PEER_TO_SELF, TRUE); | AuthFinish(l, AUTH_PEER_TO_SELF, TRUE); |
| AuthDataDestroy(auth); | AuthDataDestroy(auth); |
| return; | return; |
| Line 270 badRequest: | Line 270 badRequest: |
| Mesg = AuthFailMsg(auth, failMesg, sizeof(failMesg)); | Mesg = AuthFailMsg(auth, failMesg, sizeof(failMesg)); |
| Log(LG_AUTH, ("[%s] PAP: Reply message: %s", l->name, Mesg)); | Log(LG_AUTH, ("[%s] PAP: Reply message: %s", l->name, Mesg)); |
| AuthOutput(l, PROTO_PAP, PAP_NAK, auth->id, (u_char *) Mesg, strlen(Mesg), 1, 0); | AuthOutput(l, PROTO_PAP, PAP_NAK, auth->id, (const u_char *) Mesg, strlen(Mesg), 1, 0); |
| AuthFinish(l, AUTH_PEER_TO_SELF, FALSE); | AuthFinish(l, AUTH_PEER_TO_SELF, FALSE); |
| AuthDataDestroy(auth); | AuthDataDestroy(auth); |
| } | } |