Lines Matching refs:ss
190 SSL_SESSION *ss;
192 ss=(SSL_SESSION *)OPENSSL_malloc(sizeof(SSL_SESSION));
193 if (ss == NULL)
198 memset(ss,0,sizeof(SSL_SESSION));
200 ss->verify_result = 1; /* avoid 0 (= X509_V_OK) just in case */
201 ss->references=1;
202 ss->timeout=60*5+4; /* 5 minute timeout by default */
203 ss->time=(unsigned long)time(NULL);
204 ss->prev=NULL;
205 ss->next=NULL;
206 ss->compress_meth=0;
208 ss->tlsext_hostname = NULL;
210 ss->tlsext_ecpointformatlist_length = 0;
211 ss->tlsext_ecpointformatlist = NULL;
212 ss->tlsext_ellipticcurvelist_length = 0;
213 ss->tlsext_ellipticcurvelist = NULL;
216 CRYPTO_new_ex_data(CRYPTO_EX_INDEX_SSL_SESSION, ss, &ss->ex_data);
218 ss->psk_identity_hint=NULL;
219 ss->psk_identity=NULL;
221 return(ss);
274 SSL_SESSION *ss=NULL;
279 if ((ss=SSL_SESSION_new()) == NULL) return(0);
283 ss->timeout=SSL_get_default_timeout(s);
285 ss->timeout=s->session_ctx->session_timeout;
297 ss->ssl_version=SSL2_VERSION;
298 ss->session_id_length=SSL2_SSL_SESSION_ID_LENGTH;
302 ss->ssl_version=SSL3_VERSION;
303 ss->session_id_length=SSL3_SSL_SESSION_ID_LENGTH;
307 ss->ssl_version=TLS1_VERSION;
308 ss->session_id_length=SSL3_SSL_SESSION_ID_LENGTH;
312 ss->ssl_version=DTLS1_BAD_VER;
313 ss->session_id_length=SSL3_SSL_SESSION_ID_LENGTH;
317 ss->ssl_version=DTLS1_VERSION;
318 ss->session_id_length=SSL3_SSL_SESSION_ID_LENGTH;
323 SSL_SESSION_free(ss);
330 ss->session_id_length = 0;
342 tmp = ss->session_id_length;
343 if(!cb(s, ss->session_id, &tmp))
348 SSL_SESSION_free(ss);
353 if(!tmp || (tmp > ss->session_id_length))
358 SSL_SESSION_free(ss);
362 if((tmp < ss->session_id_length) && (s->version == SSL2_VERSION))
363 memset(ss->session_id + tmp, 0, ss->session_id_length - tmp);
365 ss->session_id_length = tmp;
367 if(SSL_has_matching_session_id(s, ss->session_id,
368 ss->session_id_length))
372 SSL_SESSION_free(ss);
378 ss->tlsext_hostname = BUF_strdup(s->tlsext_hostname);
379 if (ss->tlsext_hostname == NULL) {
381 SSL_SESSION_free(ss);
388 if (ss->tlsext_ecpointformatlist != NULL) OPENSSL_free(ss->tlsext_ecpointformatlist);
389 if ((ss->tlsext_ecpointformatlist = OPENSSL_malloc(s->tlsext_ecpointformatlist_length)) == NULL)
392 SSL_SESSION_free(ss);
395 ss->tlsext_ecpointformatlist_length = s->tlsext_ecpointformatlist_length;
396 memcpy(ss->tlsext_ecpointformatlist, s->tlsext_ecpointformatlist, s->tlsext_ecpointformatlist_length);
400 if (ss->tlsext_ellipticcurvelist != NULL) OPENSSL_free(ss->tlsext_ellipticcurvelist);
401 if ((ss->tlsext_ellipticcurvelist = OPENSSL_malloc(s->tlsext_ellipticcurvelist_length)) == NULL)
404 SSL_SESSION_free(ss);
407 ss->tlsext_ellipticcurvelist_length = s->tlsext_ellipticcurvelist_length;
408 memcpy(ss->tlsext_ellipticcurvelist, s->tlsext_ellipticcurvelist, s->tlsext_ellipticcurvelist_length);
415 ss->session_id_length=0;
418 if (s->sid_ctx_length > sizeof ss->sid_ctx)
421 SSL_SESSION_free(ss);
424 memcpy(ss->sid_ctx,s->sid_ctx,s->sid_ctx_length);
425 ss->sid_ctx_length=s->sid_ctx_length;
426 s->session=ss;
427 ss->ssl_version=s->version;
428 ss->verify_result = X509_V_OK;
695 void SSL_SESSION_free(SSL_SESSION *ss)
699 if(ss == NULL)
702 i=CRYPTO_add(&ss->references,-1,CRYPTO_LOCK_SSL_SESSION);
704 REF_PRINT("SSL_SESSION",ss);
715 CRYPTO_free_ex_data(CRYPTO_EX_INDEX_SSL_SESSION, ss, &ss->ex_data);
717 OPENSSL_cleanse(ss->key_arg,sizeof ss->key_arg);
718 OPENSSL_cleanse(ss->master_key,sizeof ss->master_key);
719 OPENSSL_cleanse(ss->session_id,sizeof ss->session_id);
720 if (ss->sess_cert != NULL) ssl_sess_cert_free(ss->sess_cert);
721 if (ss->peer != NULL) X509_free(ss->peer);
722 if (ss->ciphers != NULL) sk_SSL_CIPHER_free(ss->ciphers);
724 if (ss->tlsext_hostname != NULL) OPENSSL_free(ss->tlsext_hostname);
725 if (ss->tlsext_tick != NULL) OPENSSL_free(ss->tlsext_tick);
727 ss->tlsext_ecpointformatlist_length = 0;
728 if (ss->tlsext_ecpointformatlist != NULL) OPENSSL_free(ss->tlsext_ecpointformatlist);
729 ss->tlsext_ellipticcurvelist_length = 0;
730 if (ss->tlsext_ellipticcurvelist != NULL) OPENSSL_free(ss->tlsext_ellipticcurvelist);
734 if (ss->psk_identity_hint != NULL)
735 OPENSSL_free(ss->psk_identity_hint);
736 if (ss->psk_identity != NULL)
737 OPENSSL_free(ss->psk_identity);
739 OPENSSL_cleanse(ss,sizeof(*ss));
740 OPENSSL_free(ss);