Author: cgutman
Date: Mon Dec 20 21:25:11 2010
New Revision: 50073
URL:
http://svn.reactos.org/svn/reactos?rev=50073&view=rev
Log:
[WININET]
- Sync to Wine 1.3.9
Modified:
trunk/reactos/dll/win32/wininet/http.c
trunk/reactos/dll/win32/wininet/internet.c
trunk/reactos/dll/win32/wininet/netconnection.c
trunk/reactos/dll/win32/wininet/wininet.spec
Modified: trunk/reactos/dll/win32/wininet/http.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/http.c?r…
==============================================================================
--- trunk/reactos/dll/win32/wininet/http.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/wininet/http.c [iso-8859-1] Mon Dec 20 21:25:11 2010
@@ -5169,3 +5169,21 @@
FIXME("STUB: flags=%d host=%s length=%d\n",flags,szHost,length);
return FALSE;
}
+
+/***********************************************************************
+ * InternetShowSecurityInfoByURLA (@)
+ */
+BOOL WINAPI InternetShowSecurityInfoByURLA(LPCSTR url, HWND window)
+{
+ FIXME("stub: %s %p\n", url, window);
+ return FALSE;
+}
+
+/***********************************************************************
+ * InternetShowSecurityInfoByURLW (@)
+ */
+BOOL WINAPI InternetShowSecurityInfoByURLW(LPCWSTR url, HWND window)
+{
+ FIXME("stub: %s %p\n", debugstr_w(url), window);
+ return FALSE;
+}
Modified: trunk/reactos/dll/win32/wininet/internet.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/internet…
==============================================================================
--- trunk/reactos/dll/win32/wininet/internet.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/wininet/internet.c [iso-8859-1] Mon Dec 20 21:25:11 2010
@@ -1370,8 +1370,9 @@
InternetCrackUrlW should not include it */
if (dwUrlLength == -1) nLength--;
- lpwszUrl = HeapAlloc(GetProcessHeap(), 0, nLength * sizeof(WCHAR));
- MultiByteToWideChar(CP_ACP,0,lpszUrl,dwUrlLength,lpwszUrl,nLength);
+ lpwszUrl = HeapAlloc(GetProcessHeap(), 0, (nLength + 1) * sizeof(WCHAR));
+ MultiByteToWideChar(CP_ACP,0,lpszUrl,dwUrlLength,lpwszUrl,nLength + 1);
+ lpwszUrl[nLength] = '\0';
memset(&UCW,0,sizeof(UCW));
UCW.dwStructSize = sizeof(URL_COMPONENTSW);
@@ -1788,7 +1789,7 @@
*/
if (lpszcp != 0 && lpszcp - lpszUrl < dwUrlLength && (!lpszParam
|| lpszcp <= lpszParam))
{
- INT len;
+ DWORD len;
/* Only truncate the parameter list if it's already been saved
* in lpUC->lpszExtraInfo.
@@ -1806,8 +1807,46 @@
else
len = dwUrlLength-(lpszcp-lpszUrl);
}
- SetUrlComponentValueW(&lpUC->lpszUrlPath, &lpUC->dwUrlPathLength,
- lpszcp, len);
+ if (lpUC->dwUrlPathLength && lpUC->lpszUrlPath &&
+ lpUC->nScheme == INTERNET_SCHEME_FILE)
+ {
+ WCHAR tmppath[MAX_PATH];
+ if (*lpszcp == '/')
+ {
+ len = MAX_PATH;
+ PathCreateFromUrlW(lpszUrl_orig, tmppath, &len, 0);
+ }
+ else
+ {
+ WCHAR *iter;
+ memcpy(tmppath, lpszcp, len * sizeof(WCHAR));
+ tmppath[len] = '\0';
+
+ iter = tmppath;
+ while (*iter) {
+ if (*iter == '/')
+ *iter = '\\';
+ ++iter;
+ }
+ }
+ /* if ends in \. or \.. append a backslash */
+ if (tmppath[len - 1] == '.' &&
+ (tmppath[len - 2] == '\\' ||
+ (tmppath[len - 2] == '.' && tmppath[len - 3] ==
'\\')))
+ {
+ if (len < MAX_PATH - 1)
+ {
+ tmppath[len] = '\\';
+ tmppath[len+1] = '\0';
+ ++len;
+ }
+ }
+ SetUrlComponentValueW(&lpUC->lpszUrlPath,
&lpUC->dwUrlPathLength,
+ tmppath, len);
+ }
+ else
+ SetUrlComponentValueW(&lpUC->lpszUrlPath,
&lpUC->dwUrlPathLength,
+ lpszcp, len);
}
else
{
Modified: trunk/reactos/dll/win32/wininet/netconnection.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/netconne…
==============================================================================
--- trunk/reactos/dll/win32/wininet/netconnection.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/wininet/netconnection.c [iso-8859-1] Mon Dec 20 21:25:11 2010
@@ -114,7 +114,7 @@
static void *OpenSSL_ssl_handle;
static void *OpenSSL_crypto_handle;
-#if defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER> 0x1000000)
+#if defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER > 0x10000000)
static const SSL_METHOD *meth;
#else
static SSL_METHOD *meth;
@@ -152,7 +152,6 @@
MAKE_FUNCPTR(SSL_CTX_set_verify);
MAKE_FUNCPTR(SSL_get_current_cipher);
MAKE_FUNCPTR(SSL_CIPHER_get_bits);
-MAKE_FUNCPTR(X509_STORE_CTX_get_ex_data);
/* OpenSSL's libcrypto functions that we use */
MAKE_FUNCPTR(BIO_new_fp);
@@ -162,6 +161,7 @@
MAKE_FUNCPTR(ERR_free_strings);
MAKE_FUNCPTR(ERR_get_error);
MAKE_FUNCPTR(ERR_error_string);
+MAKE_FUNCPTR(X509_STORE_CTX_get_ex_data);
MAKE_FUNCPTR(i2d_X509);
MAKE_FUNCPTR(sk_num);
MAKE_FUNCPTR(sk_value);
@@ -228,13 +228,15 @@
PCCERT_CHAIN_CONTEXT chain;
char oid_server_auth[] = szOID_PKIX_KP_SERVER_AUTH;
char *server_auth[] = { oid_server_auth };
- DWORD err = ERROR_SUCCESS;
+ DWORD err = ERROR_SUCCESS, chainFlags = 0;
TRACE("verifying %s\n", debugstr_w(server));
chainPara.RequestedUsage.Usage.cUsageIdentifier = 1;
chainPara.RequestedUsage.Usage.rgpszUsageIdentifier = server_auth;
- if ((ret = CertGetCertificateChain(NULL, cert, NULL, store, &chainPara, 0,
- NULL, &chain)))
+ if (!(security_flags & SECURITY_FLAG_IGNORE_REVOCATION))
+ chainFlags |= CERT_CHAIN_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT;
+ if ((ret = CertGetCertificateChain(NULL, cert, NULL, store, &chainPara,
+ chainFlags, NULL, &chain)))
{
if (chain->TrustStatus.dwErrorStatus)
{
@@ -431,7 +433,6 @@
DYNSSL(SSL_CTX_set_verify);
DYNSSL(SSL_get_current_cipher);
DYNSSL(SSL_CIPHER_get_bits);
- DYNSSL(X509_STORE_CTX_get_ex_data);
#undef DYNSSL
#define DYNCRYPTO(x) \
@@ -449,6 +450,7 @@
DYNCRYPTO(ERR_free_strings);
DYNCRYPTO(ERR_get_error);
DYNCRYPTO(ERR_error_string);
+ DYNCRYPTO(X509_STORE_CTX_get_ex_data);
DYNCRYPTO(i2d_X509);
DYNCRYPTO(sk_num);
DYNCRYPTO(sk_value);
@@ -877,7 +879,11 @@
int NETCON_GetCipherStrength(WININET_NETCONNECTION *connection)
{
#ifdef SONAME_LIBSSL
+#if defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x0090707f)
+ const SSL_CIPHER *cipher;
+#else
SSL_CIPHER *cipher;
+#endif
int bits = 0;
if (!connection->useSSL)
Modified: trunk/reactos/dll/win32/wininet/wininet.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/wininet.…
==============================================================================
--- trunk/reactos/dll/win32/wininet/wininet.spec [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/wininet/wininet.spec [iso-8859-1] Mon Dec 20 21:25:11 2010
@@ -195,9 +195,9 @@
@ stdcall InternetSetStatusCallback(ptr ptr) InternetSetStatusCallbackA
@ stdcall InternetSetStatusCallbackA(ptr ptr)
@ stdcall InternetSetStatusCallbackW(ptr ptr)
-@ stub InternetShowSecurityInfoByURL
-@ stub InternetShowSecurityInfoByURLA
-@ stub InternetShowSecurityInfoByURLW
+@ stdcall InternetShowSecurityInfoByURL(str ptr) InternetShowSecurityInfoByURLA
+@ stdcall InternetShowSecurityInfoByURLA(str ptr)
+@ stdcall InternetShowSecurityInfoByURLW(wstr ptr)
@ stdcall InternetTimeFromSystemTime(ptr long ptr long) InternetTimeFromSystemTimeA
@ stdcall InternetTimeFromSystemTimeA(ptr long ptr long)
@ stdcall InternetTimeFromSystemTimeW(ptr long ptr long)