X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=ssl%2Fssl_sess.c;h=69e6d7fea52e3b57cd06cc6b4204d48d8541d81a;hp=9063bca415e821eab2f64b4255e641101ab1d124;hb=05f0fb9f6acc34c82a082d7668572828925694e7;hpb=36f038f1041f9f31878f75b567959ceae08eb34e diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c index 9063bca415..69e6d7fea5 100644 --- a/ssl/ssl_sess.c +++ b/ssl/ssl_sess.c @@ -266,7 +266,7 @@ SSL_SESSION *ssl_session_dup(SSL_SESSION *src, int ticket) dest->references = 1; if (src->peer != NULL) - CRYPTO_add(&src->peer->references, 1, CRYPTO_LOCK_X509); + X509_up_ref(src->peer); if (src->peer_chain != NULL) { dest->peer_chain = X509_chain_up_ref(src->peer_chain); @@ -547,8 +547,8 @@ int ssl_get_new_session(SSL *s, int session) * - Both for new and resumed sessions, s->tlsext_ticket_expected is set to 1 * if the server should issue a new session ticket (to 0 otherwise). */ -int ssl_get_prev_session(SSL *s, unsigned char *session_id, int len, - const unsigned char *limit) +int ssl_get_prev_session(SSL *s, PACKET *pkt, unsigned char *session_id, + int len) { /* This is used only by servers. */ @@ -560,16 +560,11 @@ int ssl_get_prev_session(SSL *s, unsigned char *session_id, int len, if (len < 0 || len > SSL_MAX_SSL_SESSION_ID_LENGTH) goto err; - if (session_id + len > limit) { - fatal = 1; - goto err; - } - if (len == 0) try_session_cache = 0; /* sets s->tlsext_ticket_expected */ - r = tls1_process_ticket(s, session_id, len, limit, &ret); + r = tls1_process_ticket(s, pkt, session_id, len, &ret); switch (r) { case -1: /* Error during processing */ fatal = 1;