141 #ifndef OPENSSL_NO_ENGINE
175 new_func, dup_func, free_func);
203 ss->
time=(
unsigned long)time(NULL);
207 #ifndef OPENSSL_NO_TLSEXT
209 #ifndef OPENSSL_NO_EC
217 #ifndef OPENSSL_NO_PSK
221 #ifndef OPENSSL_NO_SRP
248 #define MAX_SESS_ID_ATTEMPTS 10
249 static int def_generate_session_id(
const SSL *ssl,
unsigned char *
id,
250 unsigned int *id_len)
252 unsigned int retry = 0;
283 if (s->session_ctx->session_timeout == 0)
286 ss->
timeout=s->session_ctx->session_timeout;
337 #ifndef OPENSSL_NO_TLSEXT
386 #ifndef OPENSSL_NO_TLSEXT
396 #ifndef OPENSSL_NO_EC
464 const unsigned char *limit)
470 int try_session_cache = 1;
471 #ifndef OPENSSL_NO_TLSEXT
479 try_session_cache = 0;
481 #ifndef OPENSSL_NO_TLSEXT
493 try_session_cache = 0;
500 if (try_session_cache &&
519 s->session_ctx->stats.sess_miss++;
522 if (try_session_cache &&
524 s->session_ctx->get_session_cb != NULL)
528 if ((ret=s->session_ctx->get_session_cb(s,session_id,len,©)))
530 s->session_ctx->stats.sess_cb_hit++;
581 unsigned char buf[5],*
p;
597 s->session_ctx->stats.sess_timeout++;
598 if (try_session_cache)
606 s->session_ctx->stats.sess_hit++;
618 #ifndef OPENSSL_NO_TLSEXT
619 if (!try_session_cache)
650 if (s != NULL && s != c)
653 SSL_SESSION_list_remove(ctx,s);
665 SSL_SESSION_list_add(ctx,c);
686 if (!remove_session_lock(ctx,
700 return remove_session_lock(ctx, c, 1);
715 SSL_SESSION_list_remove(ctx,c);
742 REF_PRINT(
"SSL_SESSION",ss);
748 fprintf(stderr,
"SSL_SESSION_free, bad reference count\n");
759 if (ss->
peer != NULL) X509_free(ss->
peer);
761 #ifndef OPENSSL_NO_TLSEXT
764 #ifndef OPENSSL_NO_EC
771 #ifndef OPENSSL_NO_PSK
777 #ifndef OPENSSL_NO_SRP
807 #ifndef OPENSSL_NO_KRB5
848 if (s == NULL)
return(0);
855 if (s == NULL)
return(0);
861 if (s == NULL)
return(0);
867 if (s == NULL)
return(0);
878 unsigned int sid_ctx_len)
886 memcpy(s->
sid_ctx,sid_ctx,sid_ctx_len);
894 if (s == NULL)
return(0);
902 if (s == NULL)
return(0);
906 #ifndef OPENSSL_NO_TLSEXT
910 if (s == NULL)
return(0);
919 if (s == NULL)
return(0);
975 SSL_SESSION_list_remove(p->
ctx,s);
991 tp.cache=s->sessions;
992 if (tp.cache == NULL)
return;
1019 if ((s->
next == NULL) || (s->
prev == NULL))
return;
1052 if ((s->
next != NULL) && (s->
prev != NULL))
1053 SSL_SESSION_list_remove(ctx,s);
1095 unsigned char *
data,
int len,
int *copy))
1101 unsigned char *
data,
int len,
int *copy)
1107 void (*
cb)(
const SSL *ssl,
int type,
int val))
1128 #ifndef OPENSSL_NO_ENGINE
1148 int (*
cb)(
SSL *ssl,
unsigned char *cookie,
unsigned int *cookie_len))
1154 int (*
cb)(
SSL *ssl,
unsigned char *cookie,
unsigned int cookie_len))