Remove cookie validation return value trick
authorMatt Caswell <matt@openssl.org>
Mon, 30 Nov 2015 10:38:54 +0000 (10:38 +0000)
committerMatt Caswell <matt@openssl.org>
Tue, 1 Dec 2015 15:23:42 +0000 (15:23 +0000)
commit94f98a9019e1c0a3be4ca904b2c27c7af3d937c0
tree56d75df4511a365c659c17cfd6592091f43bf83c
parent301a6dcd4590fb2f69d08259577e215b4cc3caa3
Remove cookie validation return value trick

In the DTLS ClientHello processing the return value is stored in |ret| which
by default is -1. |ret| is only updated to a positive value once we are past
all points where we could hit an error. We wish to return 1 on success or 2
on success *and* we have validated the DTLS cookie. Previously on successful
validation of the cookie we were setting |ret| to -2, and then once we were
past all error points we set |ret = -ret|. This is non-obvious behaviour and
could be error prone. This commit tries to make this a bit more intuitive.

Reviewed-by: Andy Polyakov <appro@openssl.org>
ssl/s3_srvr.c