Don't set peer_tmp until we have finished constructing it
authorMatt Caswell <matt@openssl.org>
Tue, 19 Apr 2016 22:33:35 +0000 (23:33 +0100)
committerMatt Caswell <matt@openssl.org>
Fri, 22 Apr 2016 14:37:17 +0000 (15:37 +0100)
commitee85fc1dd67faebdeecb8fe8834facaee0566324
tree08073541b84babf37402a56844132bb40d37132d
parent48c1e15ceb2252e65ba63f93a7bf39c1d368f38f
Don't set peer_tmp until we have finished constructing it

If we fail halfway through constructing the peer_tmp EVP_PKEY but we have
already stored it in s->s3->peer_tmp then if anything tries to use it then
it will likely fail. This was causing s_client to core dump in the
sslskewith0p test. s_client was trying to print out the connection
parameters that it had negotiated so far. Arguably s_client should not do
that if the connection has failed...but given it is existing functionality
it's easier to fix libssl.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
ssl/statem/statem_clnt.c