summaryrefslogtreecommitdiffstats
path: root/ssl
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@google.com>2017-09-07 18:53:05 -0400
committerBenjamin Kaduk <kaduk@mit.edu>2017-09-08 13:58:59 -0500
commitf1b97da1fd90cf3935eafedc8df0d0165cb75f2f (patch)
tree6db3aa66ae0837c2e2a0dec5c065ef021962e384 /ssl
parentf90486f4def6c20e3021405068b69533d164244f (diff)
Introduce named constants for the ClientHello callback.
It is otherwise unclear what all the magic numbers mean. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Ben Kaduk <kaduk@mit.edu> (Merged from https://github.com/openssl/openssl/pull/4349)
Diffstat (limited to 'ssl')
-rw-r--r--ssl/statem/statem_srvr.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/ssl/statem/statem_srvr.c b/ssl/statem/statem_srvr.c
index 360cd1c20b..81c8ee4f21 100644
--- a/ssl/statem/statem_srvr.c
+++ b/ssl/statem/statem_srvr.c
@@ -1432,14 +1432,16 @@ static int tls_early_post_process_client_hello(SSL *s, int *pal)
/* Finished parsing the ClientHello, now we can start processing it */
/* Give the ClientHello callback a crack at things */
if (s->ctx->client_hello_cb != NULL) {
- int code;
/* A failure in the ClientHello callback terminates the connection. */
- code = s->ctx->client_hello_cb(s, &al, s->ctx->client_hello_cb_arg);
- if (code == 0)
- goto err;
- if (code < 0) {
+ switch (s->ctx->client_hello_cb(s, &al, s->ctx->client_hello_cb_arg)) {
+ case SSL_CLIENT_HELLO_SUCCESS:
+ break;
+ case SSL_CLIENT_HELLO_RETRY:
s->rwstate = SSL_CLIENT_HELLO_CB;
- return code;
+ return -1;
+ case SSL_CLIENT_HELLO_ERROR:
+ default:
+ goto err;
}
}