Lines Matching refs:ret

154   int ret;  in entropy_func_mutex()  local
157 ret = mbedtls_entropy_func(data, output, len); in entropy_func_mutex()
160 return ret; in entropy_func_mutex()
576 int ret = -1; local
591 ret = mbedtls_ctr_drbg_seed(&backend->ctr_drbg, entropy_func_mutex,
593 if(ret) {
594 mbedtls_strerror(ret, errorbuf, sizeof(errorbuf));
596 -ret, errorbuf);
603 ret = mbedtls_ctr_drbg_seed(&backend->ctr_drbg, mbedtls_entropy_func,
605 if(ret) {
606 mbedtls_strerror(ret, errorbuf, sizeof(errorbuf));
608 -ret, errorbuf);
624 ret = mbedtls_x509_crt_parse(&backend->cacert, newblob,
627 if(ret < 0) {
628 mbedtls_strerror(ret, errorbuf, sizeof(errorbuf));
630 -ret, errorbuf);
637 ret = mbedtls_x509_crt_parse_file(&backend->cacert, ssl_cafile);
639 if(ret < 0) {
640 mbedtls_strerror(ret, errorbuf, sizeof(errorbuf));
642 ssl_cafile, -ret, errorbuf);
653 ret = mbedtls_x509_crt_parse_path(&backend->cacert, ssl_capath);
655 if(ret < 0) {
656 mbedtls_strerror(ret, errorbuf, sizeof(errorbuf));
658 ssl_capath, -ret, errorbuf);
674 ret = mbedtls_x509_crt_parse_file(&backend->clicert, ssl_cert);
676 if(ret) {
677 mbedtls_strerror(ret, errorbuf, sizeof(errorbuf));
679 ssl_cert, -ret, errorbuf);
697 ret = mbedtls_x509_crt_parse(&backend->clicert, newblob,
701 if(ret) {
702 mbedtls_strerror(ret, errorbuf, sizeof(errorbuf));
704 ssl_config->key, -ret, errorbuf);
716 ret = mbedtls_pk_parse_keyfile(&backend->pk, ssl_config->key,
721 ret = mbedtls_pk_parse_keyfile(&backend->pk, ssl_config->key,
725 if(ret) {
726 mbedtls_strerror(ret, errorbuf, sizeof(errorbuf));
728 ssl_config->key, -ret, errorbuf);
742 ret = mbedtls_pk_parse_key(&backend->pk, key_data, ssl_key_blob->len,
748 ret = mbedtls_pk_parse_key(&backend->pk, key_data, ssl_key_blob->len,
753 if(ret) {
754 mbedtls_strerror(ret, errorbuf, sizeof(errorbuf));
756 -ret, errorbuf);
761 if(ret == 0 && !(mbedtls_pk_can_do(&backend->pk, MBEDTLS_PK_RSA) ||
763 ret = MBEDTLS_ERR_PK_TYPE_MISMATCH;
772 ret = mbedtls_x509_crl_parse_file(&backend->crl, ssl_crlfile);
774 if(ret) {
775 mbedtls_strerror(ret, errorbuf, sizeof(errorbuf));
777 ssl_crlfile, -ret, errorbuf);
796 ret = mbedtls_ssl_config_defaults(&backend->config,
800 if(ret) {
824 ret = mbed_set_ssl_version_min_max(data, backend, conn_config);
825 if(ret != CURLE_OK)
826 return ret;
831 ret = mbedtls_ssl_setup(&backend->ssl, &backend->config);
832 if(ret) {
833 mbedtls_strerror(ret, errorbuf, sizeof(errorbuf));
835 -ret, errorbuf);
887 ret = mbedtls_ssl_session_load(&session, sdata, slen);
888 if(ret) {
889 failf(data, "error loading cached session: -0x%x", -ret);
892 ret = mbedtls_ssl_set_session(&backend->ssl, &session);
893 if(ret)
894 failf(data, "error setting session: -0x%x", -ret);
975 int ret; local
989 ret = mbedtls_ssl_handshake(&backend->ssl);
991 if(ret == MBEDTLS_ERR_SSL_WANT_READ) {
995 else if(ret == MBEDTLS_ERR_SSL_WANT_WRITE) {
999 else if(ret == MBEDTLS_ERR_X509_CERT_VERIFY_FAILED) {
1003 else if(ret) {
1009 mbedtls_strerror(ret, errorbuf, sizeof(errorbuf));
1011 -ret, errorbuf);
1135 int ret; local
1141 ret = mbedtls_ssl_get_session(&backend->ssl, &session);
1142 if(ret) {
1143 if(ret != MBEDTLS_ERR_SSL_ALLOC_FAILED)
1145 failf(data, "mbedtls_ssl_get_session returned -0x%x", -ret);
1156 ret = mbedtls_ssl_session_save(&session, sdata, slen, &slen);
1157 if(ret) {
1158 failf(data, "failed to serialize session: -0x%x", -ret);
1183 int ret = -1; local
1187 ret = mbedtls_ssl_write(&backend->ssl, (unsigned char *)mem, len);
1189 if(ret < 0) {
1191 len, -ret);
1192 *curlcode = ((ret == MBEDTLS_ERR_SSL_WANT_WRITE)
1194 || (ret == MBEDTLS_ERR_SSL_RECEIVED_NEW_SESSION_TICKET)
1197 ret = -1;
1200 return ret;
1217 int ret; local
1234 ret = mbedtls_ssl_close_notify(&backend->ssl);
1235 switch(ret) {
1248 CURL_TRC_CF(data, cf, "mbedtls_shutdown error -0x%04X", -ret);
1258 ret = mbedtls_ssl_read(&backend->ssl, buf, sizeof(buf));
1261 if(ret == MBEDTLS_ERR_SSL_WANT_READ)
1262 ret = mbedtls_ssl_read(&backend->ssl, buf, sizeof(buf));
1264 if(ret == MBEDTLS_ERR_SSL_RECEIVED_NEW_SESSION_TICKET)
1267 if(ret <= 0)
1271 if(ret > 0) {
1275 else if(ret == 0 || (ret == MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY)) {
1280 else if(ret == MBEDTLS_ERR_SSL_WANT_READ) {
1284 else if(ret == MBEDTLS_ERR_SSL_WANT_WRITE) {
1289 CURL_TRC_CF(data, cf, "mbedtls_shutdown error -0x%04X", -ret);
1331 int ret = -1; local
1336 ret = mbedtls_ssl_read(&backend->ssl, (unsigned char *)buf,
1338 if(ret <= 0) {
1340 buffersize, -ret);
1341 switch(ret) {
1349 ret = -1;
1353 ret = 0;
1357 mbedtls_strerror(ret, errorbuf, sizeof(errorbuf));
1358 failf(data, "ssl_read returned: (-0x%04X) %s", -ret, errorbuf);
1360 ret = -1;
1365 return (ssize_t)ret;
1385 int ret; local
1392 ret = mbedtls_ctr_drbg_seed(&ctr_drbg, mbedtls_entropy_func,
1395 if(!ret)
1396 ret = mbedtls_ctr_drbg_random(&ctr_drbg, entropy, length);
1401 return ret == 0 ? CURLE_OK : CURLE_FAILED_INIT;
1566 int ret; local
1570 ret = psa_crypto_init();
1574 if(ret != PSA_SUCCESS)