Lines Matching refs:rc

259     int rc;  in handshake()  local
300 rc = gnutls_handshake(session); in handshake()
310 if((rc == GNUTLS_E_AGAIN) || (rc == GNUTLS_E_INTERRUPTED)) { in handshake()
316 else if((rc < 0) && !gnutls_error_is_fatal(rc)) { in handshake()
319 if(rc == GNUTLS_E_WARNING_ALERT_RECEIVED) { in handshake()
325 strerr = gnutls_strerror(rc); in handshake()
330 else if((rc < 0) && backend->gtls.io_result) { in handshake()
333 else if(rc < 0) { in handshake()
336 if(rc == GNUTLS_E_FATAL_ALERT_RECEIVED) { in handshake()
342 strerr = gnutls_strerror(rc); in handshake()
460 int rc; in Curl_gtls_shared_creds_create() local
467 rc = gnutls_certificate_allocate_credentials(&shared->creds); in Curl_gtls_shared_creds_create()
468 if(rc != GNUTLS_E_SUCCESS) { in Curl_gtls_shared_creds_create()
469 failf(data, "gnutls_cert_all_cred() failed: %s", gnutls_strerror(rc)); in Curl_gtls_shared_creds_create()
510 int rc; in gtls_populate_creds() local
516 rc = gnutls_certificate_set_x509_system_trust(creds); in gtls_populate_creds()
517 if(rc < 0) in gtls_populate_creds()
519 gnutls_strerror(rc)); in gtls_populate_creds()
521 infof(data, "found %d certificates in native ca store", rc); in gtls_populate_creds()
522 if(rc > 0) in gtls_populate_creds()
532 rc = gnutls_certificate_set_x509_trust_file(creds, in gtls_populate_creds()
535 if(rc < 0) { in gtls_populate_creds()
537 config->CAfile, gnutls_strerror(rc), in gtls_populate_creds()
540 ssl_config->certverifyresult = rc; in gtls_populate_creds()
545 infof(data, "found %d certificates in %s", rc, config->CAfile); in gtls_populate_creds()
550 rc = gnutls_certificate_set_x509_trust_dir(creds, config->CApath, in gtls_populate_creds()
552 if(rc < 0) { in gtls_populate_creds()
554 config->CApath, gnutls_strerror(rc), in gtls_populate_creds()
557 ssl_config->certverifyresult = rc; in gtls_populate_creds()
562 infof(data, "found %d certificates in %s", rc, config->CApath); in gtls_populate_creds()
568 rc = gnutls_certificate_set_x509_crl_file(creds, config->CRLfile, in gtls_populate_creds()
570 if(rc < 0) { in gtls_populate_creds()
572 config->CRLfile, gnutls_strerror(rc)); in gtls_populate_creds()
576 infof(data, "found %d CRL in %s", rc, config->CRLfile); in gtls_populate_creds()
677 int rc; in Curl_gtls_client_trust_setup() local
698 rc = gnutls_credentials_set(gtls->session, GNUTLS_CRD_CERTIFICATE, in Curl_gtls_client_trust_setup()
700 if(rc != GNUTLS_E_SUCCESS) { in Curl_gtls_client_trust_setup()
701 failf(data, "gnutls_credentials_set() failed: %s", gnutls_strerror(rc)); in Curl_gtls_client_trust_setup()
808 int rc; in gtls_client_init() local
834 rc = gnutls_srp_allocate_client_credentials(&gtls->srp_client_cred); in gtls_client_init()
835 if(rc != GNUTLS_E_SUCCESS) { in gtls_client_init()
837 gnutls_strerror(rc)); in gtls_client_init()
841 rc = gnutls_srp_set_client_credentials(gtls->srp_client_cred, in gtls_client_init()
844 if(rc != GNUTLS_E_SUCCESS) { in gtls_client_init()
846 gnutls_strerror(rc)); in gtls_client_init()
877 rc = gnutls_init(&gtls->session, init_flags); in gtls_client_init()
878 if(rc != GNUTLS_E_SUCCESS) { in gtls_client_init()
879 failf(data, "gnutls_init() failed: %d", rc); in gtls_client_init()
892 rc = gnutls_set_default_priority(gtls->session); in gtls_client_init()
893 if(rc != GNUTLS_E_SUCCESS) in gtls_client_init()
929 rc = gnutls_priority_set_direct(gtls->session, prioritysrp, &err); in gtls_client_init()
932 if((rc == GNUTLS_E_INVALID_REQUEST) && err) { in gtls_client_init()
939 rc = gnutls_priority_set_direct(gtls->session, prioritylist, &err); in gtls_client_init()
944 if(rc != GNUTLS_E_SUCCESS) { in gtls_client_init()
946 rc, err); in gtls_client_init()
957 rc = gnutls_certificate_set_x509_simple_pkcs12_file( in gtls_client_init()
960 if(rc != GNUTLS_E_SUCCESS) { in gtls_client_init()
964 gnutls_strerror(rc)); in gtls_client_init()
974 rc = gnutls_certificate_set_x509_key_file2( in gtls_client_init()
981 if(rc != GNUTLS_E_SUCCESS) { in gtls_client_init()
984 gnutls_strerror(rc)); in gtls_client_init()
1004 rc = gnutls_credentials_set(gtls->session, GNUTLS_CRD_SRP, in gtls_client_init()
1006 if(rc != GNUTLS_E_SUCCESS) { in gtls_client_init()
1007 failf(data, "gnutls_credentials_set() failed: %s", gnutls_strerror(rc)); in gtls_client_init()
1014 rc = gnutls_credentials_set(gtls->session, GNUTLS_CRD_CERTIFICATE, in gtls_client_init()
1016 if(rc != GNUTLS_E_SUCCESS) { in gtls_client_init()
1017 failf(data, "gnutls_credentials_set() failed: %s", gnutls_strerror(rc)); in gtls_client_init()
1023 rc = gnutls_ocsp_status_request_enable_client(gtls->session, in gtls_client_init()
1025 if(rc != GNUTLS_E_SUCCESS) { in gtls_client_init()
1026 failf(data, "gnutls_ocsp_status_request_enable_client() failed: %d", rc); in gtls_client_init()
1095 int rc; in Curl_gtls_ctx_init() local
1097 rc = gnutls_session_set_data(gctx->session, ssl_sessionid, ssl_idsize); in Curl_gtls_ctx_init()
1098 if(rc < 0) in Curl_gtls_ctx_init()
1296 int rc; in Curl_gtls_verifyserver() local
1370 rc = gnutls_certificate_verify_peers2(session, &verify_status); in Curl_gtls_verifyserver()
1371 if(rc < 0) { in Curl_gtls_verifyserver()
1372 failf(data, "server cert verify failed: %d", rc); in Curl_gtls_verifyserver()
1373 *certverifyresult = rc; in Curl_gtls_verifyserver()
1413 rc = gnutls_ocsp_status_request_get(session, &status_request); in Curl_gtls_verifyserver()
1415 if(rc == GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE) { in Curl_gtls_verifyserver()
1420 if(rc < 0) { in Curl_gtls_verifyserver()
1427 rc = gnutls_ocsp_resp_import(ocsp_resp, &status_request); in Curl_gtls_verifyserver()
1428 if(rc < 0) { in Curl_gtls_verifyserver()
1515 rc = (int)gnutls_x509_crt_check_issuer(x509_cert, x509_issuer); in Curl_gtls_verifyserver()
1518 if(rc <= 0) { in Curl_gtls_verifyserver()
1529 rc = gnutls_x509_crt_get_dn_by_oid(x509_cert, GNUTLS_OID_X520_COMMON_NAME, in Curl_gtls_verifyserver()
1534 if(rc) { in Curl_gtls_verifyserver()
1536 gnutls_strerror(rc)); in Curl_gtls_verifyserver()
1548 rc = (int)gnutls_x509_crt_check_hostname(x509_cert, in Curl_gtls_verifyserver()
1554 if(!rc) { in Curl_gtls_verifyserver()
1586 rc = 1; in Curl_gtls_verifyserver()
1593 if(!rc) { in Curl_gtls_verifyserver()
1692 rc = gnutls_x509_crt_get_dn2(x509_cert, &certfields); in Curl_gtls_verifyserver()
1693 if(rc) in Curl_gtls_verifyserver()
1707 rc = gnutls_x509_crt_get_issuer_dn2(x509_cert, &certfields); in Curl_gtls_verifyserver()
1708 if(rc) in Curl_gtls_verifyserver()
1869 int rc; in gtls_connect_common() local
1877 rc = gnutls_alpn_get_selected_protocol(backend->gtls.session, &proto); in gtls_connect_common()
1878 if(rc) { /* No ALPN from server */ in gtls_connect_common()
1987 ssize_t rc; in gtls_send() local
1996 rc = -1; in gtls_send()
2001 rc = -1; in gtls_send()
2011 rc = (ssize_t)blen; in gtls_send()
2024 rc = gnutls_record_send(backend->gtls.session, buf, blen); in gtls_send()
2026 if(rc < 0) { in gtls_send()
2027 if(total_written && (rc == GNUTLS_E_AGAIN)) { in gtls_send()
2029 rc = (ssize_t)total_written; in gtls_send()
2032 *curlcode = (rc == GNUTLS_E_AGAIN) ? in gtls_send()
2036 rc = -1; in gtls_send()
2039 nwritten = (size_t)rc; in gtls_send()
2045 rc = total_written; in gtls_send()
2048 return rc; in gtls_send()
2225 int rc; in gtls_random() local
2227 rc = gnutls_rnd(GNUTLS_RND_RANDOM, entropy, length); in gtls_random()
2228 return rc ? CURLE_FAILED_INIT : CURLE_OK; in gtls_random()