[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 54/150: schannel: fix compiler warnings
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 54/150: schannel: fix compiler warnings |
Date: |
Fri, 30 Mar 2018 16:48:28 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit a64b002e3a1e2961fd52d52517a5e9c56066da6a
Author: Michael Kaufmann <address@hidden>
AuthorDate: Wed Feb 7 21:39:26 2018 +0100
schannel: fix compiler warnings
Closes #2296
---
lib/vtls/schannel.c | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c
index 2574d0ff5..76f9b22cf 100644
--- a/lib/vtls/schannel.c
+++ b/lib/vtls/schannel.c
@@ -1696,7 +1696,7 @@ static CURLcode pkp_pin_peer_pubkey(struct connectdata
*conn, int sockindex,
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
CERT_CONTEXT *pCertContextServer = NULL;
const char *x509_der;
- int x509_der_len;
+ DWORD x509_der_len;
curl_X509certificate x509_parsed;
curl_asn1Element *pubkey;
@@ -1723,7 +1723,7 @@ static CURLcode pkp_pin_peer_pubkey(struct connectdata
*conn, int sockindex,
(pCertContextServer->cbCertEncoded > 0)))
break;
- x509_der = pCertContextServer->pbCertEncoded;
+ x509_der = (const char *)pCertContextServer->pbCertEncoded;
x509_der_len = pCertContextServer->cbCertEncoded;
memset(&x509_parsed, 0, sizeof x509_parsed);
if(Curl_parseX509(&x509_parsed, x509_der, x509_der + x509_der_len))
@@ -1894,19 +1894,21 @@ static void Curl_schannel_checksum(const unsigned char
*input,
size_t inputlen,
unsigned char *checksum,
size_t checksumlen,
- const unsigned char *pszProvider,
+ DWORD provType,
const unsigned int algId)
{
HCRYPTPROV hProv = 0;
HCRYPTHASH hHash = 0;
- size_t cbHashSize = 0, dwCount = sizeof(size_t);
+ DWORD cbHashSize = 0;
+ DWORD dwHashSizeLen = (DWORD)sizeof(cbHashSize);
+ DWORD dwChecksumLen = (DWORD)checksumlen;
/* since this can fail in multiple ways, zero memory first so we never
* return old data
*/
memset(checksum, 0, checksumlen);
- if(!CryptAcquireContext(&hProv, NULL, NULL, pszProvider,
+ if(!CryptAcquireContext(&hProv, NULL, NULL, provType,
CRYPT_VERIFYCONTEXT))
return; /* failed */
@@ -1914,19 +1916,19 @@ static void Curl_schannel_checksum(const unsigned char
*input,
if(!CryptCreateHash(hProv, algId, 0, 0, &hHash))
break; /* failed */
- if(!CryptHashData(hHash, (const BYTE*) input, inputlen, 0))
+ if(!CryptHashData(hHash, (const BYTE*)input, (DWORD)inputlen, 0))
break; /* failed */
/* get hash size */
if(!CryptGetHashParam(hHash, HP_HASHSIZE, (BYTE *)&cbHashSize,
- &dwCount, 0))
+ &dwHashSizeLen, 0))
break; /* failed */
/* check hash size */
if(checksumlen < cbHashSize)
break; /* failed */
- if(CryptGetHashParam(hHash, HP_HASHVAL, checksum, &checksumlen, 0))
+ if(CryptGetHashParam(hHash, HP_HASHVAL, checksum, &dwChecksumLen, 0))
break; /* failed */
} while(0);
@@ -1937,16 +1939,17 @@ static void Curl_schannel_checksum(const unsigned char
*input,
CryptReleaseContext(hProv, 0);
}
-void Curl_schannel_md5sum(unsigned char *input,
+CURLcode Curl_schannel_md5sum(unsigned char *input,
size_t inputlen,
unsigned char *md5sum,
size_t md5len)
{
Curl_schannel_checksum(input, inputlen, md5sum, md5len,
PROV_RSA_FULL, CALG_MD5);
+ return CURLE_OK;
}
-void Curl_schannel_sha256sum(unsigned char *input,
+void Curl_schannel_sha256sum(const unsigned char *input,
size_t inputlen,
unsigned char *sha256sum,
size_t sha256len)
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 90/150: CURLOPT_HEADER.3: clarify problems with different data sizes, (continued)
- [GNUnet-SVN] [gnurl] 90/150: CURLOPT_HEADER.3: clarify problems with different data sizes, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 89/150: test1556: verify >16KB headers to the header callback, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 94/150: CURLOPT_RESOLVE: Add support for multiple IP addresses per entry, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 120/150: curl.1: mention how to add numerical IP addresses in NO_PROXY, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 35/150: http2: set DEBUG_HTTP2 to enable more HTTP/2 logging, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 65/150: tlsauthtype.d: works only if libcurl is built with TLS-SRP support, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 76/150: KNOWN_BUGS: 2.5 curl should not offer "ALPN: h2" when using https-proxy, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 96/150: hostip: fix 'potentially uninitialized variable' warning, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 115/150: unit1307: proper cleanup on OOM to fix torture tests, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 39/150: fnmatch: accept an alphanum to be followed by a non-alphanum in char set, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 54/150: schannel: fix compiler warnings,
gnunet <=
- [GNUnet-SVN] [gnurl] 103/150: os400: add curl_resolver_start_callback type to ILE/RPG binding, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 81/150: ssh: add two missing state names, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 86/150: http: fix the max header length detection logic, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 128/150: http2: verbose output new MAX_CONCURRENT_STREAMS values, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 69/150: libcurl-security.3: mention the URL standards problems too, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 77/150: TODO: 18.18 retry on network is unreachable, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 124/150: WolfSSL: adding TLSv1.3, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 137/150: FTP: reject path components with control codes, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 101/150: url: Add option CURLOPT_RESOLVER_START_FUNCTION, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 131/150: Curl_range: fix FTP-only and FILE-only builds, gnunet, 2018/03/30