Fix a bug caused by the return value being set early to signal successful
authorjsing <jsing@openbsd.org>
Sat, 29 Apr 2017 23:38:49 +0000 (23:38 +0000)
committerjsing <jsing@openbsd.org>
Sat, 29 Apr 2017 23:38:49 +0000 (23:38 +0000)
commit6f1892dc3e84e016a8722cb62152ff86f788c027
tree2a7e47e20917b291ed3356facaf1ff81b599bc03
parentcb6231d9534ff0badffba5f22a8b3abb18dbf1db
Fix a bug caused by the return value being set early to signal successful
DTLS cookie validation. This can mask a later failure and result in a
positive return value being returned from ssl3_get_client_hello(), when
it should return a negative value to propagate the error.

Ironically this was introduced in OpenSSL 2e9802b7a7b with the commit
message "Fix DTLS cookie management bugs".

Fix based on OpenSSL.

Issue reported by Nicolas Bouliane <nbouliane at jive dot com>.

ok beck@
lib/libssl/ssl_srvr.c