Lines Matching refs:session

169 static int ssl_save_session( const mbedtls_ssl_session *session,  in ssl_save_session()  argument
182 memcpy( p, session, sizeof( mbedtls_ssl_session ) ); in ssl_save_session()
187 if( session->peer_cert == NULL ) in ssl_save_session()
190 cert_len = session->peer_cert->raw.len; in ssl_save_session()
199 if( session->peer_cert != NULL ) in ssl_save_session()
200 memcpy( p, session->peer_cert->raw.p, cert_len ); in ssl_save_session()
213 static int ssl_load_session( mbedtls_ssl_session *session, in ssl_load_session() argument
225 memcpy( session, p, sizeof( mbedtls_ssl_session ) ); in ssl_load_session()
237 session->peer_cert = NULL; in ssl_load_session()
246 session->peer_cert = mbedtls_calloc( 1, sizeof( mbedtls_x509_crt ) ); in ssl_load_session()
248 if( session->peer_cert == NULL ) in ssl_load_session()
251 mbedtls_x509_crt_init( session->peer_cert ); in ssl_load_session()
253 if( ( ret = mbedtls_x509_crt_parse_der( session->peer_cert, in ssl_load_session()
256 mbedtls_x509_crt_free( session->peer_cert ); in ssl_load_session()
257 mbedtls_free( session->peer_cert ); in ssl_load_session()
258 session->peer_cert = NULL; in ssl_load_session()
286 const mbedtls_ssl_session *session, in mbedtls_ssl_ticket_write() argument
330 if( ( ret = ssl_save_session( session, in mbedtls_ssl_ticket_write()
384 mbedtls_ssl_session *session, in mbedtls_ssl_ticket_parse() argument
448 if( ( ret = ssl_load_session( session, ticket, clear_len ) ) != 0 ) in mbedtls_ssl_ticket_parse()
456 if( current_time < session->start || in mbedtls_ssl_ticket_parse()
457 (uint32_t)( current_time - session->start ) > ctx->ticket_lifetime ) in mbedtls_ssl_ticket_parse()