summaryrefslogtreecommitdiffstats
path: root/ssl/ssl_sess.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2017-01-20 16:01:27 +0000
committerMatt Caswell <matt@openssl.org>2017-01-30 10:18:23 +0000
commitddf6ec006963d49e8b0dce55fe22fb8e844c3fbf (patch)
tree469a67467728eb8622cef61936521b2eadb707b7 /ssl/ssl_sess.c
parent1f5b44e943d911c3d0bf1445a6dab60798a66408 (diff)
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.c18
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();
}
}