Fix TLS message processing if Flags field is not present
authorJouni Malinen <jouni.malinen@atheros.com>
Tue, 30 Dec 2008 10:28:02 +0000 (12:28 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 30 Dec 2008 10:28:02 +0000 (12:28 +0200)
commit3f732d1fc3beadb6f85750804ce821bc99e92af1
treef184d325fde51568cee9e137ca8b631b91cfcc54
parent805e6dc66326764b3d20c5113fb538b2be6aa662
Fix TLS message processing if Flags field is not present

Previous version assumed that the Flags field is always present and
ended up reading one octet past the end of the buffer should the Flags
field be missing. The message length would also be set incorrectly
(size_t)-1 or (size_t)-5, but it looks like reassembly code ended up
failing in malloc before actually using this huge length to read data.

RFC 2716 uses a somewhat unclear description on what exactly is included
in the TLS Ack message ("no data" can refer to either Data field in 4.1
or TLS Data field in 4.2), so in theory, it would be possible for some
implementations to not include Flags field. However,
EAP-{PEAP,TTLS,FAST} need the Flags field in Ack messages, too, for
indicating the used version.

The EAP peer code will now accept the no-Flags case as an Ack message if
EAP workarounds are enabled (which is the default behavior). If
workarounds are disabled, the message without Flags field will be
rejected.

[Bug 292]
src/eap_peer/eap_tls_common.c