OLD | NEW |
1 /* ssl/ssl_sess.c */ | 1 /* ssl/ssl_sess.c */ |
2 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 * All rights reserved. | 3 * All rights reserved. |
4 * | 4 * |
5 * This package is an SSL implementation written | 5 * This package is an SSL implementation written |
6 * by Eric Young (eay@cryptsoft.com). | 6 * by Eric Young (eay@cryptsoft.com). |
7 * The implementation was written so as to conform with Netscapes SSL. | 7 * The implementation was written so as to conform with Netscapes SSL. |
8 * | 8 * |
9 * This library is free for commercial and non-commercial use as long as | 9 * This library is free for commercial and non-commercial use as long as |
10 * the following conditions are aheared to. The following conditions | 10 * the following conditions are aheared to. The following conditions |
(...skipping 981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
992 void SSL_CTX_flush_sessions(SSL_CTX *s, long t) | 992 void SSL_CTX_flush_sessions(SSL_CTX *s, long t) |
993 { | 993 { |
994 unsigned long i; | 994 unsigned long i; |
995 TIMEOUT_PARAM tp; | 995 TIMEOUT_PARAM tp; |
996 | 996 |
997 tp.ctx=s; | 997 tp.ctx=s; |
998 tp.cache=s->sessions; | 998 tp.cache=s->sessions; |
999 if (tp.cache == NULL) return; | 999 if (tp.cache == NULL) return; |
1000 tp.time=t; | 1000 tp.time=t; |
1001 CRYPTO_w_lock(CRYPTO_LOCK_SSL_CTX); | 1001 CRYPTO_w_lock(CRYPTO_LOCK_SSL_CTX); |
1002 i=CHECKED_LHASH_OF(SSL_SESSION, tp.cache)->down_load; | |
1003 CHECKED_LHASH_OF(SSL_SESSION, tp.cache)->down_load=0; | |
1004 lh_SSL_SESSION_doall_arg(tp.cache, LHASH_DOALL_ARG_FN(timeout), | 1002 lh_SSL_SESSION_doall_arg(tp.cache, LHASH_DOALL_ARG_FN(timeout), |
1005 TIMEOUT_PARAM, &tp); | 1003 TIMEOUT_PARAM, &tp); |
1006 CHECKED_LHASH_OF(SSL_SESSION, tp.cache)->down_load=i; | |
1007 CRYPTO_w_unlock(CRYPTO_LOCK_SSL_CTX); | 1004 CRYPTO_w_unlock(CRYPTO_LOCK_SSL_CTX); |
1008 } | 1005 } |
1009 | 1006 |
1010 int ssl_clear_bad_session(SSL *s) | 1007 int ssl_clear_bad_session(SSL *s) |
1011 { | 1008 { |
1012 if ( (s->session != NULL) && | 1009 if ( (s->session != NULL) && |
1013 !(s->shutdown & SSL_SENT_SHUTDOWN) && | 1010 !(s->shutdown & SSL_SENT_SHUTDOWN) && |
1014 !(SSL_in_init(s) || SSL_in_before(s))) | 1011 !(SSL_in_init(s) || SSL_in_before(s))) |
1015 { | 1012 { |
1016 SSL_CTX_remove_session(s->ctx,s->session); | 1013 SSL_CTX_remove_session(s->ctx,s->session); |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1168 ctx->app_gen_cookie_cb=cb; | 1165 ctx->app_gen_cookie_cb=cb; |
1169 } | 1166 } |
1170 | 1167 |
1171 void SSL_CTX_set_cookie_verify_cb(SSL_CTX *ctx, | 1168 void SSL_CTX_set_cookie_verify_cb(SSL_CTX *ctx, |
1172 int (*cb)(SSL *ssl, unsigned char *cookie, unsigned int cookie_len)) | 1169 int (*cb)(SSL *ssl, unsigned char *cookie, unsigned int cookie_len)) |
1173 { | 1170 { |
1174 ctx->app_verify_cookie_cb=cb; | 1171 ctx->app_verify_cookie_cb=cb; |
1175 } | 1172 } |
1176 | 1173 |
1177 IMPLEMENT_PEM_rw(SSL_SESSION, SSL_SESSION, PEM_STRING_SSL_SESSION, SSL_SESSION) | 1174 IMPLEMENT_PEM_rw(SSL_SESSION, SSL_SESSION, PEM_STRING_SSL_SESSION, SSL_SESSION) |
OLD | NEW |