Do not overallocate for tmp.ciphers_raw
authorBenjamin Kaduk <bkaduk@akamai.com>
Tue, 24 Jan 2017 16:50:21 +0000 (10:50 -0600)
committerMatt Caswell <matt@openssl.org>
Tue, 24 Jan 2017 17:05:45 +0000 (17:05 +0000)
commit722d42e1ea710ba036563a68dc7c4e987bf4991b
tree753f87472e499d5041d22d9147376816aeb31bf3
parentc088325b42cee1236f7b4996dd71f93ecc95bd5d
Do not overallocate for tmp.ciphers_raw

Well, not as much, at least.

Commit 07afdf3c3ac97af4f2b4eec22a97f7230f8227e0 changed things so
that for SSLv2 format ClientHellos we store the cipher list in the
TLS format, i.e., with two bytes per cipher, to be consistent with
historical behavior.

However, the space allocated for the array still performed the computation
with three bytes per cipher, a needless over-allocation (though a relatively
small one, all things considered).

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2281)
(cherry picked from commit f1429b85c5821e55224e5878da9d0fa420a41f71)
ssl/statem/statem_srvr.c