mirror of
https://github.com/curl/curl.git
synced 2026-05-30 11:37:28 +03:00
mbedtls.c hex casts
This commit is contained in:
parent
d005d0b643
commit
a98bfa374a
1 changed files with 21 additions and 18 deletions
|
|
@ -425,7 +425,7 @@ static void mbed_extract_certinfo(struct Curl_easy *data,
|
|||
cert_count++;
|
||||
|
||||
if(cert_count > MAX_ALLOWED_CERT_AMOUNT) {
|
||||
infof(data, "Certificates is more than allowed (%u), skipping certinfo",
|
||||
infof(data, "Certificates is more than allowed (%d), skipping certinfo",
|
||||
MAX_ALLOWED_CERT_AMOUNT);
|
||||
return;
|
||||
}
|
||||
|
|
@ -464,7 +464,8 @@ static int mbed_verify_cb(void *ptr, mbedtls_x509_crt *crt,
|
|||
mbedtls_x509_crt_verify_info(buf, sizeof(buf), "", *flags);
|
||||
failf(data, "mbedTLS: %s", buf);
|
||||
#else
|
||||
failf(data, "mbedTLS: certificate verification error 0x%08x", *flags);
|
||||
failf(data, "mbedTLS: certificate verification error 0x%08x",
|
||||
(unsigned int)*flags);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -529,7 +530,7 @@ static CURLcode mbed_load_cacert(struct Curl_cfilter *cf,
|
|||
if(ret < 0) {
|
||||
mbedtls_strerror(ret, errorbuf, sizeof(errorbuf));
|
||||
failf(data, "mbedTLS: error importing CA cert blob: (-0x%04X) %s",
|
||||
-ret, errorbuf);
|
||||
(unsigned int)-ret, errorbuf);
|
||||
return CURLE_SSL_CERTPROBLEM;
|
||||
}
|
||||
}
|
||||
|
|
@ -541,7 +542,7 @@ static CURLcode mbed_load_cacert(struct Curl_cfilter *cf,
|
|||
if(ret < 0) {
|
||||
mbedtls_strerror(ret, errorbuf, sizeof(errorbuf));
|
||||
failf(data, "mbedTLS: error reading CA cert file %s: (-0x%04X) %s",
|
||||
ssl_cafile, -ret, errorbuf);
|
||||
ssl_cafile, (unsigned int)-ret, errorbuf);
|
||||
return CURLE_SSL_CACERT_BADFILE;
|
||||
}
|
||||
#else
|
||||
|
|
@ -557,7 +558,7 @@ static CURLcode mbed_load_cacert(struct Curl_cfilter *cf,
|
|||
if(ret < 0) {
|
||||
mbedtls_strerror(ret, errorbuf, sizeof(errorbuf));
|
||||
failf(data, "mbedTLS: error reading CA cert path %s: (-0x%04X) %s",
|
||||
ssl_capath, -ret, errorbuf);
|
||||
ssl_capath, (unsigned int)-ret, errorbuf);
|
||||
|
||||
if(verifypeer)
|
||||
return CURLE_SSL_CACERT_BADFILE;
|
||||
|
|
@ -595,7 +596,7 @@ static CURLcode mbed_load_clicert(struct Curl_cfilter *cf,
|
|||
if(ret) {
|
||||
mbedtls_strerror(ret, errorbuf, sizeof(errorbuf));
|
||||
failf(data, "mbedTLS: error reading client cert file %s: (-0x%04X) %s",
|
||||
ssl_cert, -ret, errorbuf);
|
||||
ssl_cert, (unsigned int)-ret, errorbuf);
|
||||
|
||||
return CURLE_SSL_CERTPROBLEM;
|
||||
}
|
||||
|
|
@ -642,7 +643,7 @@ static CURLcode mbed_load_clicert(struct Curl_cfilter *cf,
|
|||
if(ret) {
|
||||
mbedtls_strerror(ret, errorbuf, sizeof(errorbuf));
|
||||
failf(data, "mbedTLS: error reading client cert blob: (-0x%04X) %s",
|
||||
-ret, errorbuf);
|
||||
(unsigned int)-ret, errorbuf);
|
||||
return CURLE_SSL_CERTPROBLEM;
|
||||
}
|
||||
}
|
||||
|
|
@ -689,7 +690,7 @@ static CURLcode mbed_load_privkey(struct Curl_cfilter *cf,
|
|||
if(ret) {
|
||||
mbedtls_strerror(ret, errorbuf, sizeof(errorbuf));
|
||||
failf(data, "mbedTLS: error reading private key %s: (-0x%04X) %s",
|
||||
ssl_config->key, -ret, errorbuf);
|
||||
ssl_config->key, (unsigned int)-ret, errorbuf);
|
||||
return CURLE_SSL_CERTPROBLEM;
|
||||
}
|
||||
#else
|
||||
|
|
@ -728,7 +729,7 @@ static CURLcode mbed_load_privkey(struct Curl_cfilter *cf,
|
|||
if(ret) {
|
||||
mbedtls_strerror(ret, errorbuf, sizeof(errorbuf));
|
||||
failf(data, "mbedTLS: error parsing private key: (-0x%04X) %s",
|
||||
-ret, errorbuf);
|
||||
(unsigned int)-ret, errorbuf);
|
||||
return CURLE_SSL_CERTPROBLEM;
|
||||
}
|
||||
}
|
||||
|
|
@ -757,7 +758,7 @@ static CURLcode mbed_load_crl(struct Curl_cfilter *cf,
|
|||
if(ret) {
|
||||
mbedtls_strerror(ret, errorbuf, sizeof(errorbuf));
|
||||
failf(data, "mbedTLS: error reading CRL file %s: (-0x%04X) %s",
|
||||
ssl_crlfile, -ret, errorbuf);
|
||||
ssl_crlfile, (unsigned int)-ret, errorbuf);
|
||||
|
||||
return CURLE_SSL_CRL_BADFILE;
|
||||
}
|
||||
|
|
@ -852,7 +853,7 @@ static CURLcode mbed_configure_ssl(struct Curl_cfilter *cf,
|
|||
if(ret) {
|
||||
mbedtls_strerror(ret, errorbuf, sizeof(errorbuf));
|
||||
failf(data, "mbedTLS: ssl_setup failed: "
|
||||
"(-0x%04X) %s", -ret, errorbuf);
|
||||
"(-0x%04X) %s", (unsigned int)-ret, errorbuf);
|
||||
return CURLE_SSL_CONNECT_ERROR;
|
||||
}
|
||||
|
||||
|
|
@ -903,12 +904,12 @@ static CURLcode mbed_configure_ssl(struct Curl_cfilter *cf,
|
|||
ret = mbedtls_ssl_session_load(&session, sc_session->sdata,
|
||||
sc_session->sdata_len);
|
||||
if(ret) {
|
||||
failf(data, "SSL session error loading: -0x%x", -ret);
|
||||
failf(data, "SSL session error loading: -0x%x", (unsigned int)-ret);
|
||||
}
|
||||
else {
|
||||
ret = mbedtls_ssl_set_session(&backend->ssl, &session);
|
||||
if(ret)
|
||||
failf(data, "SSL session error setting: -0x%x", -ret);
|
||||
failf(data, "SSL session error setting: -0x%x", (unsigned int)-ret);
|
||||
else
|
||||
infof(data, "SSL reusing session ID");
|
||||
}
|
||||
|
|
@ -1046,7 +1047,7 @@ static CURLcode mbed_connect_step2(struct Curl_cfilter *cf,
|
|||
mbedtls_ssl_get_version_number(&backend->ssl));
|
||||
mbedtls_strerror(ret, errorbuf, sizeof(errorbuf));
|
||||
failf(data, "ssl_handshake returned: (-0x%04X) %s",
|
||||
-ret, errorbuf);
|
||||
(unsigned int)-ret, errorbuf);
|
||||
return CURLE_SSL_CONNECT_ERROR;
|
||||
}
|
||||
|
||||
|
|
@ -1158,7 +1159,7 @@ static CURLcode mbed_new_session(struct Curl_cfilter *cf,
|
|||
ret = mbedtls_ssl_get_session(&backend->ssl, &session);
|
||||
msession_alloced = (ret != MBEDTLS_ERR_SSL_ALLOC_FAILED);
|
||||
if(ret) {
|
||||
failf(data, "mbedtls_ssl_get_session returned -0x%x", -ret);
|
||||
failf(data, "mbedtls_ssl_get_session returned -0x%x", (unsigned int)-ret);
|
||||
result = CURLE_SSL_CONNECT_ERROR;
|
||||
goto out;
|
||||
}
|
||||
|
|
@ -1177,7 +1178,7 @@ static CURLcode mbed_new_session(struct Curl_cfilter *cf,
|
|||
|
||||
ret = mbedtls_ssl_session_save(&session, sdata, slen, &slen);
|
||||
if(ret) {
|
||||
failf(data, "failed to serialize session: -0x%x", -ret);
|
||||
failf(data, "failed to serialize session: -0x%x", (unsigned int)-ret);
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
|
@ -1297,7 +1298,8 @@ static CURLcode mbedtls_shutdown(struct Curl_cfilter *cf,
|
|||
connssl->io_need = CURL_SSL_IO_NEED_SEND;
|
||||
goto out;
|
||||
default:
|
||||
CURL_TRC_CF(data, cf, "mbedtls_shutdown error -0x%04X", -ret);
|
||||
CURL_TRC_CF(data, cf, "mbedtls_shutdown error -0x%04X",
|
||||
(unsigned int)-ret);
|
||||
result = CURLE_RECV_ERROR;
|
||||
goto out;
|
||||
}
|
||||
|
|
@ -1338,7 +1340,8 @@ static CURLcode mbedtls_shutdown(struct Curl_cfilter *cf,
|
|||
connssl->io_need = CURL_SSL_IO_NEED_SEND;
|
||||
}
|
||||
else {
|
||||
CURL_TRC_CF(data, cf, "mbedtls_shutdown error -0x%04X", -ret);
|
||||
CURL_TRC_CF(data, cf, "mbedtls_shutdown error -0x%04X",
|
||||
(unsigned int)-ret);
|
||||
result = CURLE_RECV_ERROR;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue