l2tp: Add CHAP auth information in ICCN
To support proxy auth.
This commit is contained in:
parent
12cc3c39b0
commit
75144a546c
4 changed files with 26 additions and 4 deletions
5
ppp.c
5
ppp.c
|
|
@ -285,6 +285,9 @@ void processchap(sessionidt s, tunnelidt t, uint8_t *p, uint16_t l)
|
|||
strncpy(session[s].user, packet.username, sizeof(session[s].user) - 1);
|
||||
memcpy(radius[r].pass, packet.password, 16);
|
||||
|
||||
strncpy((char *) sess_local[s].auth_name, packet.username, sizeof(sess_local[s].auth_name) - 1);
|
||||
memcpy(sess_local[s].auth_resp, packet.password, 16);
|
||||
|
||||
free(packet.username);
|
||||
free(packet.password);
|
||||
}
|
||||
|
|
@ -432,7 +435,6 @@ void lcp_restart(sessionidt s)
|
|||
sess_local[s].lcp_last_sent_confreq_n = 0;
|
||||
sess_local[s].auth_type = 0;
|
||||
sess_local[s].auth_name[0] = 0;
|
||||
sess_local[s].auth_resp[0] = 0;
|
||||
// This-Layer-Down
|
||||
change_state(s, ipcp, Initial);
|
||||
change_state(s, ipv6cp, Initial);
|
||||
|
|
@ -2566,6 +2568,7 @@ void sendchap(sessionidt s, tunnelidt t)
|
|||
q[1] = radius[r].id; // ID
|
||||
q[4] = 16; // value size (size of challenge)
|
||||
memcpy(q + 5, radius[r].auth, 16); // challenge
|
||||
memcpy(sess_local[s].auth_chall, radius[r].auth, 16);
|
||||
strcpy((char *) q + 21, config->multi_n_hostname[tunnel[t].indexudp][0]?config->multi_n_hostname[tunnel[t].indexudp]:hostname); // our name
|
||||
*(uint16_t *) (q + 2) = htons(strlen(config->multi_n_hostname[tunnel[t].indexudp][0]?config->multi_n_hostname[tunnel[t].indexudp]:hostname) + 21); // length
|
||||
tunnelsend(b, strlen(config->multi_n_hostname[tunnel[t].indexudp][0]?config->multi_n_hostname[tunnel[t].indexudp]:hostname) + 21 + (q - b), t); // send it
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue