Fix SSL_get0_raw_cipherlist()
authorMatt Caswell <matt@openssl.org>
Tue, 24 Jan 2017 11:12:03 +0000 (11:12 +0000)
committerMatt Caswell <matt@openssl.org>
Tue, 24 Jan 2017 14:26:34 +0000 (14:26 +0000)
commit07afdf3c3ac97af4f2b4eec22a97f7230f8227e0
treea1119b8deb90260f19db4e36e3e71e3ecc9e9f02
parentc83680a04aac7a15e6ac48ed732b8322c4c9d49a
Fix SSL_get0_raw_cipherlist()

SSL_get0_raw_cipherlist() was a little too "raw" in the case of an SSLv2
compat ClientHello. In 1.0.2 and below, during version negotiation, if
we received an SSLv2 compat ClientHello but actually wanted to do SSLv3+
then we would construct a "fake" SSLv3+ ClientHello. This "fake" ClientHello
would have its ciphersuite list converted to the SSLv3+ format. It was
this "fake" raw list that got saved away to later be returned by a call to
SSL_get0_raw_cipherlist().

In 1.1.0+ version negotiation works differently and we process an SSLv2
compat ClientHello directly without the need for an intermediary "fake"
ClientHello. This meant that the raw ciphersuite list being saved was in
the SSLv2 format. Any caller of this function would not expect that and
potentially overread the returned buffer by one byte.

Fixes #2189

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2280)
ssl/statem/statem_srvr.c