Tighten up logic around ChangeCipherSpec.
authorDavid Benjamin <davidben@google.com>
Sun, 6 Mar 2016 03:50:44 +0000 (22:50 -0500)
committerMatt Caswell <matt@openssl.org>
Fri, 20 May 2016 13:20:11 +0000 (14:20 +0100)
commit1257adecd4afba978806b77bd5d45f32715d97d3
tree0cd15fce6e7590dff0d56530e69806a231c8474f
parent464175692f1f00a9e5a87f040d0c59184d63b53b
Tighten up logic around ChangeCipherSpec.

ChangeCipherSpec messages have a defined value. They also may not occur
in the middle of a handshake message. The current logic will accept a
ChangeCipherSpec with value 2. It also would accept up to three bytes of
handshake data before the ChangeCipherSpec which it would discard
(because s->init_num gets reset).

Instead, require that s->init_num is 0 when a ChangeCipherSpec comes in.

RT#4391

Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
ssl/statem/statem_lib.c