diff options
author | Matt Caswell <matt@openssl.org> | 2017-01-20 17:01:27 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2017-01-30 11:18:23 +0100 |
commit | ddf6ec006963d49e8b0dce55fe22fb8e844c3fbf (patch) | |
tree | 469a67467728eb8622cef61936521b2eadb707b7 /ssl/ssl_sess.c | |
parent | Miscellaneous style tweaks based on feedback received (diff) | |
download | openssl-ddf6ec006963d49e8b0dce55fe22fb8e844c3fbf.tar.xz openssl-ddf6ec006963d49e8b0dce55fe22fb8e844c3fbf.zip |
Make the "ticket" function return codes clearer
Remove "magic" return values and use an enum instead.
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2259)
Diffstat (limited to 'ssl/ssl_sess.c')
-rw-r--r-- | ssl/ssl_sess.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c index 2ef0006649..c0fc8b356c 100644 --- a/ssl/ssl_sess.c +++ b/ssl/ssl_sess.c @@ -465,7 +465,7 @@ int ssl_get_prev_session(SSL *s, CLIENTHELLO_MSG *hello) SSL_SESSION *ret = NULL; int fatal = 0; int try_session_cache = 0; - int r; + TICKET_RETURN r; if (SSL_IS_TLS13(s)) { int al; @@ -479,18 +479,18 @@ int ssl_get_prev_session(SSL *s, CLIENTHELLO_MSG *hello) /* sets s->ext.ticket_expected */ r = tls_get_ticket_from_client(s, hello, &ret); switch (r) { - case -1: /* Error during processing */ + case TICKET_FATAL_ERR_MALLOC: + case TICKET_FATAL_ERR_OTHER: /* Error during processing */ fatal = 1; goto err; - case 0: /* No ticket found */ - case 1: /* Zero length ticket found */ + case TICKET_NONE: /* No ticket found */ + case TICKET_EMPTY: /* Zero length ticket found */ try_session_cache = 1; - break; /* Ok to carry on processing session id. */ - case 2: /* Ticket found but not decrypted. */ - case 3: /* Ticket decrypted, *ret has been set. */ + break; /* Ok to carry on processing session id. */ + case TICKET_NO_DECRYPT: /* Ticket found but not decrypted. */ + case TICKET_SUCCESS: /* Ticket decrypted, *ret has been set. */ + case TICKET_SUCCESS_RENEW: break; - default: - abort(); } } |