Lines Matching refs:data
89 #define SSLSESSION_SHARED(data) (data->share && \
90 (data->share->specifier & \
104 Curl_ssl_config_matches(struct ssl_config_data* data,
107 if((data->version == needle->version) &&
108 (data->verifypeer == needle->verifypeer) &&
109 (data->verifyhost == needle->verifyhost) &&
110 safe_strequal(data->CApath, needle->CApath) &&
111 safe_strequal(data->CAfile, needle->CAfile) &&
112 safe_strequal(data->random_file, needle->random_file) &&
113 safe_strequal(data->egdsocket, needle->egdsocket) &&
114 safe_strequal(data->cipher_list, needle->cipher_list))
189 * NOTE: 'data' may be passed in as NULL when coming from external API without
194 unsigned int Curl_rand(struct SessionHandle *data)
201 (void)data;
203 if(data) {
204 Curl_ssl_random(data, (unsigned char *)&r, sizeof(r));
214 /* read random data into the randseed variable */
280 Curl_pgrsTime(conn->data, TIMER_APPCONNECT); /* SSL is connected */
299 Curl_pgrsTime(conn->data, TIMER_APPCONNECT); /* SSL is connected */
312 struct SessionHandle *data = conn->data;
324 if(SSLSESSION_SHARED(data)) {
325 Curl_share_lock(data, CURL_LOCK_DATA_SSL_SESSION, CURL_LOCK_ACCESS_SINGLE);
326 general_age = &data->share->sessionage;
329 general_age = &data->state.sessionage;
331 for(i = 0; i < data->set.ssl.max_ssl_sessions; i++) {
332 check = &data->state.session[i];
351 if(SSLSESSION_SHARED(data))
352 Curl_share_unlock(data, CURL_LOCK_DATA_SSL_SESSION);
383 struct SessionHandle *data=conn->data;
385 if(SSLSESSION_SHARED(data))
386 Curl_share_lock(data, CURL_LOCK_DATA_SSL_SESSION, CURL_LOCK_ACCESS_SINGLE);
388 for(i = 0; i < data->set.ssl.max_ssl_sessions; i++) {
389 struct curl_ssl_session *check = &data->state.session[i];
397 if(SSLSESSION_SHARED(data))
398 Curl_share_unlock(data, CURL_LOCK_DATA_SSL_SESSION);
412 struct SessionHandle *data=conn->data; /* the mother of all structs */
413 struct curl_ssl_session *store = &data->state.session[0];
414 long oldest_age=data->state.session[0].age; /* zero if unused */
430 if(SSLSESSION_SHARED(data)) {
431 Curl_share_lock(data, CURL_LOCK_DATA_SSL_SESSION, CURL_LOCK_ACCESS_SINGLE);
432 general_age = &data->share->sessionage;
435 general_age = &data->state.sessionage;
439 for(i = 1; (i < data->set.ssl.max_ssl_sessions) &&
440 data->state.session[i].sessionid; i++) {
441 if(data->state.session[i].age < oldest_age) {
442 oldest_age = data->state.session[i].age;
443 store = &data->state.session[i];
446 if(i == data->set.ssl.max_ssl_sessions)
450 store = &data->state.session[i]; /* use this slot */
464 if(SSLSESSION_SHARED(data))
465 Curl_share_unlock(data, CURL_LOCK_DATA_SSL_SESSION);
477 void Curl_ssl_close_all(struct SessionHandle *data)
481 if(data->state.session && !SSLSESSION_SHARED(data)) {
482 for(i = 0; i < data->set.ssl.max_ssl_sessions; i++)
484 Curl_ssl_kill_session(&data->state.session[i]);
486 /* free the cache data */
487 Curl_safefree(data->state.session);
490 curlssl_close_all(data);
515 CURLcode Curl_ssl_set_engine(struct SessionHandle *data, const char *engine)
517 return curlssl_set_engine(data, engine);
522 CURLcode Curl_ssl_set_engine_default(struct SessionHandle *data)
524 return curlssl_set_engine_default(data);
528 struct curl_slist *Curl_ssl_engines_list(struct SessionHandle *data)
530 return curlssl_engines_list(data);
537 CURLcode Curl_ssl_initsessions(struct SessionHandle *data, size_t amount)
541 if(data->state.session)
550 data->set.ssl.max_ssl_sessions = amount;
551 data->state.session = session;
552 data->state.sessionage = 1; /* this is brand new */
580 void Curl_ssl_free_certinfo(struct SessionHandle *data)
583 struct curl_certinfo *ci = &data->info.certs;
596 int Curl_ssl_init_certinfo(struct SessionHandle * data,
599 struct curl_certinfo * ci = &data->info.certs;
604 Curl_ssl_free_certinfo(data);
617 CURLcode Curl_ssl_push_certinfo_len(struct SessionHandle *data,
623 struct curl_certinfo * ci = &data->info.certs;
658 CURLcode Curl_ssl_push_certinfo(struct SessionHandle *data,
665 return Curl_ssl_push_certinfo_len(data, certnum, label, value, valuelen);
671 void Curl_ssl_random(struct SessionHandle *data,
675 curlssl_random(data, entropy, length);