Lines Matching refs:session
53 int mbedtls_ssl_cache_get( void *data, mbedtls_ssl_session *session ) in mbedtls_ssl_cache_get() argument
81 if( session->id_len != entry->session.id_len || in mbedtls_ssl_cache_get()
82 memcmp( session->id, entry->session.id, in mbedtls_ssl_cache_get()
83 entry->session.id_len ) != 0 ) in mbedtls_ssl_cache_get()
88 ret = mbedtls_ssl_session_copy( session, &entry->session ); in mbedtls_ssl_cache_get()
106 if( ( session->peer_cert = mbedtls_calloc( 1, in mbedtls_ssl_cache_get()
113 mbedtls_x509_crt_init( session->peer_cert ); in mbedtls_ssl_cache_get()
114 if( mbedtls_x509_crt_parse( session->peer_cert, entry->peer_cert.p, in mbedtls_ssl_cache_get()
117 mbedtls_free( session->peer_cert ); in mbedtls_ssl_cache_get()
118 session->peer_cert = NULL; in mbedtls_ssl_cache_get()
138 int mbedtls_ssl_cache_set( void *data, const mbedtls_ssl_session *session ) in mbedtls_ssl_cache_set() argument
170 if( memcmp( session->id, cur->session.id, cur->session.id_len ) == 0 ) in mbedtls_ssl_cache_set()
260 ret = mbedtls_ssl_session_copy( &cur->session, session ); in mbedtls_ssl_cache_set()
270 if( cur->session.peer_cert != NULL ) in mbedtls_ssl_cache_set()
273 mbedtls_calloc( 1, cur->session.peer_cert->raw.len ); in mbedtls_ssl_cache_set()
281 cur->session.peer_cert->raw.p, in mbedtls_ssl_cache_set()
282 cur->session.peer_cert->raw.len ); in mbedtls_ssl_cache_set()
283 cur->peer_cert.len = session->peer_cert->raw.len; in mbedtls_ssl_cache_set()
285 mbedtls_x509_crt_free( cur->session.peer_cert ); in mbedtls_ssl_cache_set()
286 mbedtls_free( cur->session.peer_cert ); in mbedtls_ssl_cache_set()
287 cur->session.peer_cert = NULL; in mbedtls_ssl_cache_set()
329 mbedtls_ssl_session_free( &prv->session ); in mbedtls_ssl_cache_free()