diff options
author | Brad King <brad.king@kitware.com> | 2021-02-03 16:55:06 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-02-03 16:55:06 (GMT) |
commit | 426ef61cc8d850ad6877d0598a9917ce9a4f2b20 (patch) | |
tree | 139e0e0af11012c1cd5e9c89d90305bf6d68e916 /Utilities/cmcurl/lib/vtls/schannel_verify.c | |
parent | 0341888c006c19d0057017231ed43279d53e6034 (diff) | |
parent | 076b3219f58ca16afa52fe095019a05537ade0f3 (diff) | |
download | CMake-426ef61cc8d850ad6877d0598a9917ce9a4f2b20.zip CMake-426ef61cc8d850ad6877d0598a9917ce9a4f2b20.tar.gz CMake-426ef61cc8d850ad6877d0598a9917ce9a4f2b20.tar.bz2 |
Merge branch 'upstream-curl' into update-curl
* upstream-curl:
curl 2021-02-03 (2f33be81)
Diffstat (limited to 'Utilities/cmcurl/lib/vtls/schannel_verify.c')
-rw-r--r-- | Utilities/cmcurl/lib/vtls/schannel_verify.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/Utilities/cmcurl/lib/vtls/schannel_verify.c b/Utilities/cmcurl/lib/vtls/schannel_verify.c index 31b3b2f..2ef39cc 100644 --- a/Utilities/cmcurl/lib/vtls/schannel_verify.c +++ b/Utilities/cmcurl/lib/vtls/schannel_verify.c @@ -7,7 +7,7 @@ * * Copyright (C) 2012 - 2016, Marc Hoersken, <info@marc-hoersken.de> * Copyright (C) 2012, Mark Salisbury, <mark.salisbury@hp.com> - * Copyright (C) 2012 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 2012 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -79,10 +79,9 @@ static int is_cr_or_lf(char c) static CURLcode add_certs_to_store(HCERTSTORE trust_store, const char *ca_file, - struct connectdata *conn) + struct Curl_easy *data) { CURLcode result; - struct Curl_easy *data = conn->data; HANDLE ca_file_handle = INVALID_HANDLE_VALUE; LARGE_INTEGER file_size; char *ca_file_buffer = NULL; @@ -477,7 +476,7 @@ static CURLcode verify_host(struct Curl_easy *data, * (or some equivalent) encoding */ cert_hostname = curlx_convert_tchar_to_UTF8( - &cert_hostname_buff[cert_hostname_buff_index]); + &cert_hostname_buff[cert_hostname_buff_index]); if(!cert_hostname) { result = CURLE_OUT_OF_MEMORY; } @@ -500,8 +499,8 @@ static CURLcode verify_host(struct Curl_easy *data, "against certificate name (%s)\n", conn_hostname, cert_hostname); - cert_hostname_len = _tcslen( - &cert_hostname_buff[cert_hostname_buff_index]); + cert_hostname_len = + _tcslen(&cert_hostname_buff[cert_hostname_buff_index]); /* Move on to next cert name */ cert_hostname_buff_index += cert_hostname_len + 1; @@ -522,15 +521,15 @@ static CURLcode verify_host(struct Curl_easy *data, failf(data, "schannel: server certificate name verification failed"); cleanup: - curlx_unicodefree(cert_hostname_buff); + Curl_safefree(cert_hostname_buff); return result; } -CURLcode Curl_verify_certificate(struct connectdata *conn, int sockindex) +CURLcode Curl_verify_certificate(struct Curl_easy *data, + struct connectdata *conn, int sockindex) { SECURITY_STATUS sspi_status; - struct Curl_easy *data = conn->data; struct ssl_connect_data *connssl = &conn->ssl[sockindex]; CURLcode result = CURLE_OK; CERT_CONTEXT *pCertContextServer = NULL; @@ -584,7 +583,7 @@ CURLcode Curl_verify_certificate(struct connectdata *conn, int sockindex) } else { result = add_certs_to_store(trust_store, SSL_CONN_CONFIG(CAfile), - conn); + data); } } @@ -675,7 +674,7 @@ CURLcode Curl_verify_certificate(struct connectdata *conn, int sockindex) if(result == CURLE_OK) { if(SSL_CONN_CONFIG(verifyhost)) { - result = verify_host(conn->data, pCertContextServer, conn_hostname); + result = verify_host(data, pCertContextServer, conn_hostname); } } |