Make sure we check an incoming reneg ClientHello in DTLS
authorMatt Caswell <matt@openssl.org>
Mon, 29 Jan 2018 14:55:44 +0000 (14:55 +0000)
committerMatt Caswell <matt@openssl.org>
Tue, 30 Jan 2018 16:07:30 +0000 (16:07 +0000)
commitd498e526832bd6c50238f3dc0bcac9375179926e
tree92889edd231a764b562efef3ba079cc164ed6e96
parentfe8199badfce9ffccd0e1d9c245c4cdd8d412ef1
Make sure we check an incoming reneg ClientHello in DTLS

In TLS we have a check to make sure an incoming reneg ClientHello is
acceptable. The equivalent check is missing in the DTLS code. This means
that if a client does not signal the ability to handle secure reneg in the
initial handshake, then a subsequent reneg handshake should be rejected by
the server. In the DTLS case the reneg was being allowed if the the 2nd
ClientHello had a renegotiation_info extension. This is incorrect.

While incorrect, this does not represent a security issue because if
the renegotiation_info extension is present in the second ClientHello it
also has to be *correct*. Therefore this will only work if both the client
and server believe they are renegotiating, and both know the previous
Finished result. This is not the case in an insecure rengotiation attack.

I have also tidied up the check in the TLS code and given a better check
for determining whether we are renegotiating or not.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5192)
ssl/d1_pkt.c
ssl/s3_pkt.c