Sylvain Rochet
b79c3aadd2
PPP, MPPE, improve dropping of unencrypted received packet
...
Improve dropping of unencrypted received packet by taking into account
all other data protocols (such as VJ packets) in a generic way.
2015-08-28 00:19:32 +02:00
Sylvain Rochet
46985bf750
PPP, explain better why we don't need protp->datainput callback
2015-08-27 22:42:42 +02:00
Sylvain Rochet
36b3878a45
PPP, PPPoS, fixed copy/paste typo in pppos_send_config() out accm debug message
2015-08-27 22:24:27 +02:00
Sylvain Rochet
97ef85c9aa
PPP, MPPE, fixed TCP over MPPE
...
We used to modify in place the packet payload during encryption, it works
well for UDP and ICMP but TCP stack requires that we don't change the
packet payload, therefore we now copy the whole packet before encryption.
2015-08-27 01:58:35 +02:00
sg
94550682d7
more cleanup prework to fix bug #45029
2015-08-24 22:46:34 +02:00
sg
177c06b1f1
- prework for fixing bug #45029 : access IPv4 configuration of struct netif via new API (netif_ip4_addr()/netif_ip4_netmask()/netif_ip4_gw()) instead of accessing the struct member directly. This way, we can change the struct member types from ip4_addr_t to ip_addr_t;
...
- fixed some bugs in calls to ip4_addr*() where the cast to u8_t* did not reveal the wrong address type
2015-08-20 22:39:48 +02:00
goldsimon
4dc3c7a6a0
Fixed warnings about NULL check not required (ip_addr_isany) and implicit conversion (~)
2015-08-03 08:35:01 +02:00
Sylvain Rochet
78e1b9b7c1
PPP, don't store the name by which the peer authenticated itself to us if multilink support is disabled
...
pcb->peer_authname is only used by multilink support (which we don't
support), don't store the useless peer authname.
2015-05-01 22:51:09 +02:00
Sylvain Rochet
fa44cef27b
PPP, L2TP, added configurable L2TP MRU using opt.h
2015-05-01 00:49:19 +02:00
Sylvain Rochet
29ba3df717
PPP, re-enabled MRU defines in opt.h
2015-05-01 00:08:34 +02:00
Sylvain Rochet
aacc222b7d
PPP, display MTU set through netif_set_mtu() if debug is enabled
2015-04-30 23:41:47 +02:00
Sylvain Rochet
341f0bf9e3
PPP, assert if ppp_fatal() is called
2015-04-30 13:48:08 +02:00
Sylvain Rochet
091c6a3bda
PPP, cleanup unused/redefined/useless limits in ppp_impl.h
2015-04-30 01:07:11 +02:00
Sylvain Rochet
fd53cad208
PPP, sifnpmode() is only useful if on demand is supported, build out if not
...
We don't support PPP on demand, don't build sifnpmode() which is only
useful for on demand if on demand is not supported.
2015-04-30 00:06:24 +02:00
Sylvain Rochet
1b6d6d0dc0
PPP, removed unnecessary memset()
...
Everything is cleared in ppp_clear(), we don't need to clear all
structures twice.
2015-04-29 23:55:23 +02:00
Sylvain Rochet
40c671b1a5
PPP, PPPoS, also clear last_xmit when resetting PPPoS control block
2015-04-29 23:41:23 +02:00
Sylvain Rochet
0a8b1c199d
PPP, added missing cast on pbuf_header()
2015-04-26 23:42:18 +02:00
Sylvain Rochet
3a3c823ddb
PPP, MPPE, try to use pbuf_header() in mppe_compress()
...
If there is enough space in front of the buffer, use it instead of
allocating a new pbuf.
2015-04-26 23:27:31 +02:00
Sylvain Rochet
900f3c9a09
PPP, MPPE, don't issue CCP reset request in stateless mode
...
This is useless, flushed bit is always true in stateless mode, we
don't need to issue a CCP reset request in this case.
2015-04-26 22:13:11 +02:00
Sylvain Rochet
8fe2f747f4
PPP, MPPE, issue CCP reset request if synchronization is lost
...
If MPPE synchronization is lost, it is advised to send a CCP reset
request in order to recover to a clean state.
2015-04-26 22:04:21 +02:00
Sylvain Rochet
adaeff5540
PPP, MPPE, discard late packet in stateless mode
...
When PPP is used over a link which does not guarantee packet ordering,
we might get late MPPE packets. This is a problem because MPPE must be
kept synchronized and the current implementation does not drop them and
rekey 4095 times instead of 0, which is wrong.
In order to prevent rekeying about a whole count space times (~ 4095
times), drop packets which are not within the forward 4096/2 window and
increase sanity error counter.
2015-04-26 20:59:09 +02:00
Sylvain Rochet
d0f91c00cb
PPP, MPPE, sanity error path rework
...
We are going to need sanity error path a little further, rework to be
able to use the sanity error path anywhere in decompressor.
2015-04-26 20:57:01 +02:00
Sylvain Rochet
737a6921c3
PPP, place print packet debug codenames in ROM
2015-04-24 00:13:25 +02:00
goldsimon
0de0942f9c
fixed pppol2tp (IP_IS_V6_L -> IP_IS_V6_VAL)
2015-04-23 07:46:06 +02:00
goldsimon
53a96f69ef
ppp_free: fixed type of local 'err'
2015-04-23 07:25:10 +02:00
goldsimon
902d190a11
Many const fixes throughout the stack (although these are not all, yet)
2015-04-22 10:29:43 +02:00
Sylvain Rochet
5e43e2d333
PPP, L2TP, minor fixes
...
Check tot_len for ZLB instead of len, it might happens we are just
between 2 pbuf, although almost impossible.
Check buffer is at least 2 byte long before checking address & flags
header.
2015-04-22 00:50:08 +02:00
Sylvain Rochet
15cc47334e
PPP, don't assert if we receive a too short packet in ppp_input(), just drop
...
We might actually receive too short packets through PPPoE or PPPoL2TP,
don't assert on unusal packets, just drop them.
2015-04-22 00:31:14 +02:00
Sylvain Rochet
632de523de
Fixed PBUF_LINK_ENCAPSULATION_HLEN support
...
PBUF_LINK_ENCAPSULATION_HLEN support was introduced by 6ef7563f and
missed the fact that header size calculation/reservation using
computation like PBUF_LINK_HLEN + PBUF_IP_HLEN + ... are used all over
the source code. Hopefully fixed all of them.
2015-04-20 23:43:33 +02:00
Sylvain Rochet
ced24f9215
PPP, MPPE, drop unencrypted input packet if MPPE is required
2015-04-20 21:13:34 +02:00
Sylvain Rochet
b302cad46d
PPP, VJ, CCP: rework to fix protocol order
...
We need to do VJ compression before CCP/MPPE compression and VJ
decompression after CCP/MPPE decompression. This leads to a massive
rewrite of how we currently handled VJ only in the PPPoS lower protocol
handler.
Moved VJ structures from pppos to ppp_pcb because we need them back in
PPP core. This is a bit unfortunate because that's not necessary for
PPPoE or PPPoL2TP, but, hey!. Fixed CCP+MPPE+VJ order.
2015-04-20 00:10:35 +02:00
Sylvain Rochet
33838b8c1c
PPP, MPPE, compile-out unused mppe_incomp() function
2015-04-19 22:06:59 +02:00
Sylvain Rochet
42fb74ce22
PPP, CCP, MPPE, handle CCP Reset-Request and Reset-Ack for MPPE
2015-04-19 22:01:58 +02:00
Sylvain Rochet
3450a78992
PPP, change ppp_write() return type from int to err_t
...
ppp_write() callback returns err_t, makes ppp_write() consistent with
the callback it is calling.
2015-04-19 16:34:34 +02:00
Sylvain Rochet
f0c25aaa60
PPP, MSCHAP, fixed compiler warnings if MPPE support is disabled
2015-04-19 16:28:11 +02:00
Sylvain Rochet
0f63c1ef8f
PPP, CORE, reworked ppp_netif_output* functions to process CCP on all protocols
...
Both IPv4 and IPv6 should be proccessed by CCP, reworked ppp_netif_output*
in a generic way for CCP.
2015-04-19 16:22:20 +02:00
Sylvain Rochet
b27966860e
PPP, CCP, MPPE: added packet plumbing in ppp.c to process MPPE packets
2015-04-19 15:52:46 +02:00
Sylvain Rochet
51566d43bd
PPP, normalized debug messages
2015-04-19 14:24:30 +02:00
Sylvain Rochet
71d085bd13
PPP, CCP, added data packet configuration in ppp_pcb
2015-04-19 14:17:34 +02:00
Sylvain Rochet
ffb10e7aac
PPP, CCP, added receive and transmit chosen protocols in ccp_flags_set() (renamed ccp_set())
...
We need to know which methods were chosen when CCP is up, this used to be done
using ccp_test() which we are in the process of removing.
Using non-existing method 0 instead of -1 in CCP for unset method, allowing
type change from s16_t to u8_t for method.
2015-04-19 13:51:35 +02:00
Sylvain Rochet
c8db96705f
PPP, MPPE, close current session using lcp_close() if something went wrong
2015-04-19 02:27:40 +02:00
Sylvain Rochet
f94efab6c3
PPP, CCP, added MPPE user configuration flags
2015-04-19 02:17:43 +02:00
Sylvain Rochet
4c0af0f79e
PPP, MPPE, reworked MPPE debug, using ppp_pcb metadata
2015-04-19 01:49:04 +02:00
Sylvain Rochet
fc7e327d19
PPP, MSCHAP, CCP, MPPE: reworked key passing from CCP to MPPE
...
Removed mutiple copies of keys by pre-setting MPPE keys during MSCHAP
negotiation.
Improved MPPE init so we don't need to pass a buffer formatted in a
special way to MPPE, this is necessary for pppd to talk to the kernel,
we don't need that here.
2015-04-19 01:20:43 +02:00
Sylvain Rochet
045f44c7f9
PPP, MSCHAP, merged mppe_set_keys() to Set_Start_Key(), merged mppe_set_keys2() to SetMasterKeys()
2015-04-19 00:26:25 +02:00
Sylvain Rochet
867d13b007
PPP, CCP, MPPE: calling mppe_init() in ccp.c instead of using ccp_test()
...
We don't need this ccp_test() stuff which is used to test if kernel have
the ability to process MPPE packets. Reworked MPPE so we don't need it.
2015-04-18 23:51:10 +02:00
Sylvain Rochet
40991b93a2
PPP, CCP, reworked ppp_pcb ccp_localstate and all_rejected fields
2015-04-18 19:47:21 +02:00
Sylvain Rochet
949d76b328
PPP, MSCHAP: ensure magic tables are not copied and initialized on stack
2015-04-18 19:14:39 +02:00
Sylvain Rochet
210a2ccfdf
PPP, MSCHAP, MPPE: shared identical mppe_sha1_pad* between MSCHAP and MPPE
2015-04-18 18:51:45 +02:00
Sylvain Rochet
3862aad2f7
PPP, MSCHAP, reworked local functions and constants
...
MSCHAP was written the old-way, with all functions declared non static in
header, independent of their local or global scope status. Same for local
constants. Reworked in a more mordern way.
2015-04-18 17:56:35 +02:00