Lines Matching refs:session
58 int mbedtls_ssl_cache_get( void *data, mbedtls_ssl_session *session ) in mbedtls_ssl_cache_get() argument
86 if( session->ciphersuite != entry->session.ciphersuite || in mbedtls_ssl_cache_get()
87 session->compression != entry->session.compression || in mbedtls_ssl_cache_get()
88 session->id_len != entry->session.id_len ) in mbedtls_ssl_cache_get()
91 if( memcmp( session->id, entry->session.id, in mbedtls_ssl_cache_get()
92 entry->session.id_len ) != 0 ) in mbedtls_ssl_cache_get()
95 memcpy( session->master, entry->session.master, 48 ); in mbedtls_ssl_cache_get()
97 session->verify_result = entry->session.verify_result; in mbedtls_ssl_cache_get()
105 if( ( session->peer_cert = mbedtls_calloc( 1, in mbedtls_ssl_cache_get()
112 mbedtls_x509_crt_init( session->peer_cert ); in mbedtls_ssl_cache_get()
113 if( mbedtls_x509_crt_parse( session->peer_cert, entry->peer_cert.p, in mbedtls_ssl_cache_get()
116 mbedtls_free( session->peer_cert ); in mbedtls_ssl_cache_get()
117 session->peer_cert = NULL; in mbedtls_ssl_cache_get()
137 int mbedtls_ssl_cache_set( void *data, const mbedtls_ssl_session *session ) in mbedtls_ssl_cache_set() argument
169 if( memcmp( session->id, cur->session.id, cur->session.id_len ) == 0 ) in mbedtls_ssl_cache_set()
242 memcpy( &cur->session, session, sizeof( mbedtls_ssl_session ) ); in mbedtls_ssl_cache_set()
257 if( session->peer_cert != NULL ) in mbedtls_ssl_cache_set()
259 cur->peer_cert.p = mbedtls_calloc( 1, session->peer_cert->raw.len ); in mbedtls_ssl_cache_set()
266 memcpy( cur->peer_cert.p, session->peer_cert->raw.p, in mbedtls_ssl_cache_set()
267 session->peer_cert->raw.len ); in mbedtls_ssl_cache_set()
268 cur->peer_cert.len = session->peer_cert->raw.len; in mbedtls_ssl_cache_set()
270 cur->session.peer_cert = NULL; in mbedtls_ssl_cache_set()
312 mbedtls_ssl_session_free( &prv->session ); in mbedtls_ssl_cache_free()