diff options
Diffstat (limited to 'src/modules/netlib')
-rw-r--r-- | src/modules/netlib/netlib.cpp | 9 | ||||
-rw-r--r-- | src/modules/netlib/netlib.h | 5 | ||||
-rw-r--r-- | src/modules/netlib/netlibautoproxy.cpp | 6 | ||||
-rw-r--r-- | src/modules/netlib/netlibbind.cpp | 5 | ||||
-rw-r--r-- | src/modules/netlib/netlibhttp.cpp | 9 | ||||
-rw-r--r-- | src/modules/netlib/netlibhttpproxy.cpp | 5 | ||||
-rw-r--r-- | src/modules/netlib/netliblog.cpp | 29 | ||||
-rw-r--r-- | src/modules/netlib/netlibopenconn.cpp | 5 | ||||
-rw-r--r-- | src/modules/netlib/netlibopts.cpp | 5 | ||||
-rw-r--r-- | src/modules/netlib/netlibpktrecver.cpp | 5 | ||||
-rw-r--r-- | src/modules/netlib/netlibsecurity.cpp | 5 | ||||
-rw-r--r-- | src/modules/netlib/netlibsock.cpp | 7 | ||||
-rw-r--r-- | src/modules/netlib/netlibssl.cpp | 133 | ||||
-rw-r--r-- | src/modules/netlib/netlibupnp.cpp | 5 |
14 files changed, 124 insertions, 109 deletions
diff --git a/src/modules/netlib/netlib.cpp b/src/modules/netlib/netlib.cpp index 10c87ad5c0..c42b43a89f 100644 --- a/src/modules/netlib/netlib.cpp +++ b/src/modules/netlib/netlib.cpp @@ -1,8 +1,9 @@ /*
-Miranda IM: the free IM client for Microsoft* Windows*
+Miranda NG: the free IM client for Microsoft* Windows*
-Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project,
+Copyright (c) 2012-14 Miranda NG project (http://miranda-ng.org),
+Copyright (c) 2000-12 Miranda IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -59,7 +60,7 @@ int GetNetlibHandleType(void *p) }
__except(EXCEPTION_EXECUTE_HANDLER)
{}
-
+
return NLH_INVALID;
}
@@ -116,7 +117,7 @@ static INT_PTR GetNetlibUserSettingInt(const char *szUserModule, const char *szS DBVARIANT dbv;
if (db_get(NULL, szUserModule, szSetting, &dbv) && db_get(NULL, "Netlib", szSetting, &dbv))
return defValue;
-
+
if (dbv.type == DBVT_BYTE) return dbv.bVal;
if (dbv.type == DBVT_WORD) return dbv.wVal;
return dbv.dVal;
diff --git a/src/modules/netlib/netlib.h b/src/modules/netlib/netlib.h index 0108604f6b..fa887e91a3 100644 --- a/src/modules/netlib/netlib.h +++ b/src/modules/netlib/netlib.h @@ -1,8 +1,9 @@ /*
-Miranda IM: the free IM client for Microsoft* Windows*
+Miranda NG: the free IM client for Microsoft* Windows*
-Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project,
+Copyright (c) 2012-14 Miranda NG project (http://miranda-ng.org),
+Copyright (c) 2000-12 Miranda IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
diff --git a/src/modules/netlib/netlibautoproxy.cpp b/src/modules/netlib/netlibautoproxy.cpp index 68a433c6c7..f0cf323776 100644 --- a/src/modules/netlib/netlibautoproxy.cpp +++ b/src/modules/netlib/netlibautoproxy.cpp @@ -1,7 +1,9 @@ /*
-Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2010-2011 Miranda IM project,
+Miranda NG: the free IM client for Microsoft* Windows*
+
+Copyright (c) 2012-14 Miranda NG project (http://miranda-ng.org),
+Copyright (c) 2000-12 Miranda IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
diff --git a/src/modules/netlib/netlibbind.cpp b/src/modules/netlib/netlibbind.cpp index 10ac9b3725..2c2ebf1530 100644 --- a/src/modules/netlib/netlibbind.cpp +++ b/src/modules/netlib/netlibbind.cpp @@ -1,8 +1,9 @@ /*
-Miranda IM: the free IM client for Microsoft* Windows*
+Miranda NG: the free IM client for Microsoft* Windows*
-Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project,
+Copyright (c) 2012-14 Miranda NG project (http://miranda-ng.org),
+Copyright (c) 2000-12 Miranda IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
diff --git a/src/modules/netlib/netlibhttp.cpp b/src/modules/netlib/netlibhttp.cpp index 1022e63e69..d1d231d7a3 100644 --- a/src/modules/netlib/netlibhttp.cpp +++ b/src/modules/netlib/netlibhttp.cpp @@ -1,8 +1,9 @@ /*
-Miranda IM: the free IM client for Microsoft* Windows*
+Miranda NG: the free IM client for Microsoft* Windows*
-Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project,
+Copyright (c) 2012-14 Miranda NG project (http://miranda-ng.org),
+Copyright (c) 2000-12 Miranda IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -549,7 +550,7 @@ INT_PTR NetlibHttpSendRequest(WPARAM wParam, LPARAM lParam) int resultCode = nlhr->resultCode;
lastFirstLineFail = false;
- DWORD hflags = (nlhr->flags & (NLHRF_NODUMP|NLHRF_NODUMPHEADERS|NLHRF_NODUMPSEND) ?
+ DWORD hflags = (nlhr->flags & (NLHRF_NODUMP|NLHRF_NODUMPHEADERS|NLHRF_NODUMPSEND) ?
MSG_NODUMP : (nlhr->flags & NLHRF_DUMPPROXY ? MSG_DUMPPROXY : 0)) |
(nlhr->flags & NLHRF_NOPROXY ? MSG_RAW : 0);
@@ -603,7 +604,7 @@ INT_PTR NetlibHttpSendRequest(WPARAM wParam, LPARAM lParam) break;
}
}
- else if (resultCode == 401 && !doneAuthHeader) { //auth required
+ else if (resultCode == 401 && !doneAuthHeader) { //auth required
if (nlhr->requestType == REQUEST_HEAD)
nlhrReply = (NETLIBHTTPREQUEST*)NetlibHttpRecvHeaders((WPARAM)nlc, hflags);
else
diff --git a/src/modules/netlib/netlibhttpproxy.cpp b/src/modules/netlib/netlibhttpproxy.cpp index efcaca9e3b..aebf65ee55 100644 --- a/src/modules/netlib/netlibhttpproxy.cpp +++ b/src/modules/netlib/netlibhttpproxy.cpp @@ -1,8 +1,9 @@ /*
-Miranda IM: the free IM client for Microsoft* Windows*
+Miranda NG: the free IM client for Microsoft* Windows*
-Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project,
+Copyright (c) 2012-14 Miranda NG project (http://miranda-ng.org),
+Copyright (c) 2000-12 Miranda IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
diff --git a/src/modules/netlib/netliblog.cpp b/src/modules/netlib/netliblog.cpp index 878289e826..99f0aff8ba 100644 --- a/src/modules/netlib/netliblog.cpp +++ b/src/modules/netlib/netliblog.cpp @@ -1,8 +1,9 @@ /*
-Miranda IM: the free IM client for Microsoft* Windows*
+Miranda NG: the free IM client for Microsoft* Windows*
-Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project,
+Copyright (c) 2012-14 Miranda NG project (http://miranda-ng.org),
+Copyright (c) 2000-12 Miranda IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -11,7 +12,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
-This program is distributed in the hope that it will be useful,
+This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
@@ -56,11 +57,11 @@ static int bIsActive = TRUE; static HANDLE hLogEvent = NULL;
static HANDLE hLogger = NULL;
-static const TCHAR* szTimeFormats[] =
+static const TCHAR* szTimeFormats[] =
{
- LPGENT("No times"),
- LPGENT("Standard hh:mm:ss times"),
- LPGENT("Times in milliseconds"),
+ LPGENT("No times"),
+ LPGENT("Standard hh:mm:ss times"),
+ LPGENT("Times in milliseconds"),
LPGENT("Times in microseconds")
};
@@ -335,21 +336,21 @@ static INT_PTR NetlibLog(WPARAM wParam, LPARAM lParam) dwOriginalLastError = GetLastError();
switch (logOptions.timeFormat) {
case TIMEFORMAT_HHMMSS:
- GetTimeFormatA(LOCALE_USER_DEFAULT, TIME_FORCE24HOURFORMAT | TIME_NOTIMEMARKER,
+ GetTimeFormatA(LOCALE_USER_DEFAULT, TIME_FORCE24HOURFORMAT | TIME_NOTIMEMARKER,
NULL, NULL, szTime, SIZEOF(szTime));
break;
case TIMEFORMAT_MILLISECONDS:
QueryPerformanceCounter(&liTimeNow);
liTimeNow.QuadPart -= mirandaStartTime;
- mir_snprintf(szTime, SIZEOF(szTime), "%I64u.%03I64u", liTimeNow.QuadPart / perfCounterFreq,
+ mir_snprintf(szTime, SIZEOF(szTime), "%I64u.%03I64u", liTimeNow.QuadPart / perfCounterFreq,
1000 * (liTimeNow.QuadPart % perfCounterFreq) / perfCounterFreq);
break;
case TIMEFORMAT_MICROSECONDS:
QueryPerformanceCounter(&liTimeNow);
liTimeNow.QuadPart -= mirandaStartTime;
- mir_snprintf(szTime, SIZEOF(szTime), "%I64u.%06I64u", liTimeNow.QuadPart / perfCounterFreq,
+ mir_snprintf(szTime, SIZEOF(szTime), "%I64u.%06I64u", liTimeNow.QuadPart / perfCounterFreq,
1000000 * (liTimeNow.QuadPart % perfCounterFreq) / perfCounterFreq);
break;
@@ -358,8 +359,8 @@ static INT_PTR NetlibLog(WPARAM wParam, LPARAM lParam) break;
}
if (logOptions.timeFormat || logOptions.showUser)
- mir_snprintf(szHead, SIZEOF(szHead) - 1, "[%s%s%s] ", szTime,
- (logOptions.showUser && logOptions.timeFormat) ? " " : "",
+ mir_snprintf(szHead, SIZEOF(szHead) - 1, "[%s%s%s] ", szTime,
+ (logOptions.showUser && logOptions.timeFormat) ? " " : "",
logOptions.showUser ? nlu->user.szSettingsModule : "");
else
szHead[0] = 0;
@@ -437,7 +438,7 @@ void NetlibDumpData(NetlibConnection *nlc, PBYTE buf, int len, int sent, int fla WaitForSingleObject(hConnectionHeaderMutex, INFINITE);
NetlibUser *nlu = nlc ? nlc->nlu : NULL;
- int titleLineLen = mir_snprintf(szTitleLine, SIZEOF(szTitleLine), "(%p:%u) Data %s%s\r\n",
+ int titleLineLen = mir_snprintf(szTitleLine, SIZEOF(szTitleLine), "(%p:%u) Data %s%s\r\n",
nlc, nlc ? nlc->s : 0, sent ? "sent" : "received", flags & MSG_DUMPPROXY ? " (proxy)" : "");
ReleaseMutex(hConnectionHeaderMutex);
@@ -488,7 +489,7 @@ void NetlibDumpData(NetlibConnection *nlc, PBYTE buf, int len, int sent, int fla if (colsInLine == 16) {
PBYTE p = buf + line;
pszBuf += wsprintfA(
- pszBuf, "%08X: %02X %02X %02X %02X-%02X %02X %02X %02X-%02X %02X %02X %02X-%02X %02X %02X %02X ",
+ pszBuf, "%08X: %02X %02X %02X %02X-%02X %02X %02X %02X-%02X %02X %02X %02X-%02X %02X %02X %02X ",
line, p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], p[8], p[9], p[10], p[11], p[12], p[13], p[14], p[15]); //!!!!!!!!!!
}
else {
diff --git a/src/modules/netlib/netlibopenconn.cpp b/src/modules/netlib/netlibopenconn.cpp index b8d0f440e5..1f2530f8f4 100644 --- a/src/modules/netlib/netlibopenconn.cpp +++ b/src/modules/netlib/netlibopenconn.cpp @@ -1,8 +1,9 @@ /*
-Miranda IM: the free IM client for Microsoft* Windows*
+Miranda NG: the free IM client for Microsoft* Windows*
-Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project,
+Copyright (c) 2012-14 Miranda NG project (http://miranda-ng.org),
+Copyright (c) 2000-12 Miranda IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
diff --git a/src/modules/netlib/netlibopts.cpp b/src/modules/netlib/netlibopts.cpp index 67a67c5b2a..208921475d 100644 --- a/src/modules/netlib/netlibopts.cpp +++ b/src/modules/netlib/netlibopts.cpp @@ -1,8 +1,9 @@ /*
-Miranda IM: the free IM client for Microsoft* Windows*
+Miranda NG: the free IM client for Microsoft* Windows*
-Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project,
+Copyright (c) 2012-14 Miranda NG project (http://miranda-ng.org),
+Copyright (c) 2000-12 Miranda IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
diff --git a/src/modules/netlib/netlibpktrecver.cpp b/src/modules/netlib/netlibpktrecver.cpp index aa41bf6c8a..99a6dcb7c1 100644 --- a/src/modules/netlib/netlibpktrecver.cpp +++ b/src/modules/netlib/netlibpktrecver.cpp @@ -1,8 +1,9 @@ /*
-Miranda IM: the free IM client for Microsoft* Windows*
+Miranda NG: the free IM client for Microsoft* Windows*
-Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project,
+Copyright (c) 2012-14 Miranda NG project (http://miranda-ng.org),
+Copyright (c) 2000-12 Miranda IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
diff --git a/src/modules/netlib/netlibsecurity.cpp b/src/modules/netlib/netlibsecurity.cpp index 396d3a4387..5dcb11d5ab 100644 --- a/src/modules/netlib/netlibsecurity.cpp +++ b/src/modules/netlib/netlibsecurity.cpp @@ -1,8 +1,9 @@ /*
-Miranda IM: the free IM client for Microsoft* Windows*
+Miranda NG: the free IM client for Microsoft* Windows*
-Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project,
+Copyright (c) 2012-14 Miranda NG project (http://miranda-ng.org),
+Copyright (c) 2000-12 Miranda IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
diff --git a/src/modules/netlib/netlibsock.cpp b/src/modules/netlib/netlibsock.cpp index c88715da50..1bb6a2b936 100644 --- a/src/modules/netlib/netlibsock.cpp +++ b/src/modules/netlib/netlibsock.cpp @@ -1,8 +1,9 @@ /*
-Miranda IM: the free IM client for Microsoft* Windows*
+Miranda NG: the free IM client for Microsoft* Windows*
-Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project,
+Copyright (c) 2012-14 Miranda NG project (http://miranda-ng.org),
+Copyright (c) 2000-12 Miranda IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -227,7 +228,7 @@ char* NetlibAddressToString(SOCKADDR_INET_M* addr) DWORD len = sizeof(saddr);
if ( !WSAAddressToStringA((PSOCKADDR)addr, sizeof(*addr), NULL, saddr, &len))
return mir_strdup(saddr);
-
+
if (addr->si_family == AF_INET) {
char *szIp = inet_ntoa(addr->Ipv4.sin_addr);
if (addr->Ipv4.sin_port != 0) {
diff --git a/src/modules/netlib/netlibssl.cpp b/src/modules/netlib/netlibssl.cpp index 926a952bff..7f952b3ab6 100644 --- a/src/modules/netlib/netlibssl.cpp +++ b/src/modules/netlib/netlibssl.cpp @@ -1,8 +1,9 @@ /*
-Miranda IM: the free IM client for Microsoft* Windows*
+Miranda NG: the free IM client for Microsoft* Windows*
-Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project,
+Copyright (c) 2012-14 Miranda NG project (http://miranda-ng.org),
+Copyright (c) 2000-12 Miranda IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
@@ -11,7 +12,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
-This program is distributed in the hope that it will be useful,
+This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
@@ -35,7 +36,7 @@ typedef BOOL (* SSL_EMPTY_CACHE_FN_M)(VOID); static HMODULE g_hSchannel;
static PSecurityFunctionTableA g_pSSPI;
-static HANDLE g_hSslMutex;
+static HANDLE g_hSslMutex;
static SSL_EMPTY_CACHE_FN_M MySslEmptyCache;
static CredHandle hCreds;
static bool bSslInitDone;
@@ -54,8 +55,8 @@ static pfnCertVerifyCertificateChainPolicy fnCertVerifyCertificateChainPolicy; typedef enum
{
- sockOpen,
- sockClosed,
+ sockOpen,
+ sockClosed,
sockError
} SocketState;
@@ -74,7 +75,7 @@ struct SslHandle int cbIoBuffer;
int sbIoBuffer;
- SocketState state;
+ SocketState state;
};
static void ReportSslError(SECURITY_STATUS scRet, int line, bool showPopup = false)
@@ -96,7 +97,7 @@ static void ReportSslError(SECURITY_STATUS scRet, int line, bool showPopup = fal break;
default:
- FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
+ FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, scRet, LANG_USER_DEFAULT, szMsgBuf, SIZEOF(szMsgBuf), NULL);
}
@@ -126,7 +127,7 @@ static bool AcquireCredentials(void) // Create an SSPI credential.
scRet = g_pSSPI->AcquireCredentialsHandleA(
- NULL, // Name of principal
+ NULL, // Name of principal
UNISP_NAME_A, // Name of package
SECPKG_CRED_OUTBOUND, // Flags indicating use
NULL, // Pointer to logon ID
@@ -144,7 +145,7 @@ static bool SSL_library_init(void) {
if (bSslInitDone) return true;
- WaitForSingleObject(g_hSslMutex, INFINITE);
+ WaitForSingleObject(g_hSslMutex, INFINITE);
if ( !bSslInitDone)
{
@@ -205,11 +206,11 @@ static bool VerifyCertificate(SslHandle *ssl, PCSTR pszServerName, DWORD dwCertF if ( !fnCertGetCertificateChain)
return true;
- static LPSTR rgszUsages[] =
- {
- szOID_PKIX_KP_SERVER_AUTH,
- szOID_SERVER_GATED_CRYPTO,
- szOID_SGC_NETSCAPE
+ static LPSTR rgszUsages[] =
+ {
+ szOID_PKIX_KP_SERVER_AUTH,
+ szOID_SERVER_GATED_CRYPTO,
+ szOID_SGC_NETSCAPE
};
CERT_CHAIN_PARA ChainPara = {0};
@@ -222,7 +223,7 @@ static bool VerifyCertificate(SslHandle *ssl, PCSTR pszServerName, DWORD dwCertF PWSTR pwszServerName = mir_a2u(pszServerName);
- scRet = g_pSSPI->QueryContextAttributesA(&ssl->hContext,
+ scRet = g_pSSPI->QueryContextAttributesA(&ssl->hContext,
SECPKG_ATTR_REMOTE_CERT_CONTEXT, &pServerCert);
if (scRet != SEC_E_OK)
goto cleanup;
@@ -238,7 +239,7 @@ static bool VerifyCertificate(SslHandle *ssl, PCSTR pszServerName, DWORD dwCertF ChainPara.RequestedUsage.Usage.cUsageIdentifier = SIZEOF(rgszUsages);
ChainPara.RequestedUsage.Usage.rgpszUsageIdentifier = rgszUsages;
- if ( !fnCertGetCertificateChain(NULL, pServerCert, NULL, pServerCert->hCertStore,
+ if ( !fnCertGetCertificateChain(NULL, pServerCert, NULL, pServerCert->hCertStore,
&ChainPara, 0, NULL, &pChainContext))
{
scRet = GetLastError();
@@ -255,7 +256,7 @@ static bool VerifyCertificate(SslHandle *ssl, PCSTR pszServerName, DWORD dwCertF PolicyStatus.cbSize = sizeof(PolicyStatus);
- if ( !fnCertVerifyCertificateChainPolicy(CERT_CHAIN_POLICY_SSL, pChainContext,
+ if ( !fnCertVerifyCertificateChainPolicy(CERT_CHAIN_POLICY_SSL, pChainContext,
&PolicyPara, &PolicyStatus))
{
scRet = GetLastError();
@@ -281,7 +282,7 @@ cleanup: return scRet == SEC_E_OK;
}
-static SECURITY_STATUS ClientHandshakeLoop(SslHandle *ssl, BOOL fDoInitialRead)
+static SECURITY_STATUS ClientHandshakeLoop(SslHandle *ssl, BOOL fDoInitialRead)
{
SecBufferDesc InBuffer;
SecBuffer InBuffers[2];
@@ -295,7 +296,7 @@ static SECURITY_STATUS ClientHandshakeLoop(SslHandle *ssl, BOOL fDoInitialRead) BOOL fDoRead;
- dwSSPIFlags =
+ dwSSPIFlags =
ISC_REQ_SEQUENCE_DETECT |
ISC_REQ_REPLAY_DETECT |
ISC_REQ_CONFIDENTIALITY |
@@ -310,7 +311,7 @@ static SECURITY_STATUS ClientHandshakeLoop(SslHandle *ssl, BOOL fDoInitialRead) scRet = SEC_I_CONTINUE_NEEDED;
// Loop until the handshake is finished or an error occurs.
- while (scRet == SEC_I_CONTINUE_NEEDED || scRet == SEC_E_INCOMPLETE_MESSAGE || scRet == SEC_I_INCOMPLETE_CREDENTIALS)
+ while (scRet == SEC_I_CONTINUE_NEEDED || scRet == SEC_E_INCOMPLETE_MESSAGE || scRet == SEC_I_INCOMPLETE_CREDENTIALS)
{
// Read server data
if (0 == ssl->cbIoBuffer || scRet == SEC_E_INCOMPLETE_MESSAGE)
@@ -386,23 +387,23 @@ static SECURITY_STATUS ClientHandshakeLoop(SslHandle *ssl, BOOL fDoInitialRead) OutBuffer.ulVersion = SECBUFFER_VERSION;
scRet = g_pSSPI->InitializeSecurityContextA(
- &hCreds,
- &ssl->hContext,
- NULL,
- dwSSPIFlags,
- 0,
- SECURITY_NATIVE_DREP,
- &InBuffer,
- 0,
- NULL,
- &OutBuffer,
- &dwSSPIOutFlags,
+ &hCreds,
+ &ssl->hContext,
+ NULL,
+ dwSSPIFlags,
+ 0,
+ SECURITY_NATIVE_DREP,
+ &InBuffer,
+ 0,
+ NULL,
+ &OutBuffer,
+ &dwSSPIOutFlags,
&tsExpiry);
- // If success (or if the error was one of the special extended ones),
+ // If success (or if the error was one of the special extended ones),
// send the contents of the output buffer to the server.
- if (scRet == SEC_E_OK ||
- scRet == SEC_I_CONTINUE_NEEDED ||
+ if (scRet == SEC_E_OK ||
+ scRet == SEC_I_CONTINUE_NEEDED ||
(FAILED(scRet) && (dwSSPIOutFlags & ISC_RET_EXTENDED_ERROR)))
{
if (OutBuffers[0].cbBuffer != 0 && OutBuffers[0].pvBuffer != NULL)
@@ -431,8 +432,8 @@ static SECURITY_STATUS ClientHandshakeLoop(SslHandle *ssl, BOOL fDoInitialRead) // Store remaining data for further use
if (InBuffers[1].BufferType == SECBUFFER_EXTRA)
{
- memmove(ssl->pbIoBuffer,
- ssl->pbIoBuffer + (ssl->cbIoBuffer - InBuffers[1].cbBuffer),
+ memmove(ssl->pbIoBuffer,
+ ssl->pbIoBuffer + (ssl->cbIoBuffer - InBuffers[1].cbBuffer),
InBuffers[1].cbBuffer);
ssl->cbIoBuffer = InBuffers[1].cbBuffer;
}
@@ -444,7 +445,7 @@ static SECURITY_STATUS ClientHandshakeLoop(SslHandle *ssl, BOOL fDoInitialRead) // Check for fatal error.
if (FAILED(scRet)) break;
- // server just requested client authentication.
+ // server just requested client authentication.
if (scRet == SEC_I_INCOMPLETE_CREDENTIALS)
{
// Server has requested client authentication and
@@ -459,8 +460,8 @@ static SECURITY_STATUS ClientHandshakeLoop(SslHandle *ssl, BOOL fDoInitialRead) // Copy any leftover data from the buffer, and go around again.
if (InBuffers[1].BufferType == SECBUFFER_EXTRA)
{
- memmove(ssl->pbIoBuffer,
- ssl->pbIoBuffer + (ssl->cbIoBuffer - InBuffers[1].cbBuffer),
+ memmove(ssl->pbIoBuffer,
+ ssl->pbIoBuffer + (ssl->cbIoBuffer - InBuffers[1].cbBuffer),
InBuffers[1].cbBuffer);
ssl->cbIoBuffer = InBuffers[1].cbBuffer;
@@ -517,17 +518,17 @@ static bool ClientConnect(SslHandle *ssl, const char *host) OutBuffer.ulVersion = SECBUFFER_VERSION;
scRet = g_pSSPI->InitializeSecurityContextA(
- &hCreds,
- NULL,
- (SEC_CHAR*)host,
- dwSSPIFlags,
- 0,
- SECURITY_NATIVE_DREP,
- NULL,
- 0,
- &ssl->hContext,
- &OutBuffer,
- &dwSSPIOutFlags,
+ &hCreds,
+ NULL,
+ (SEC_CHAR*)host,
+ dwSSPIFlags,
+ 0,
+ SECURITY_NATIVE_DREP,
+ NULL,
+ 0,
+ &ssl->hContext,
+ &OutBuffer,
+ &dwSSPIOutFlags,
&tsExpiry);
if (scRet != SEC_I_CONTINUE_NEEDED)
@@ -541,7 +542,7 @@ static bool ClientConnect(SslHandle *ssl, const char *host) {
NetlibDumpData(NULL, (unsigned char*)(OutBuffers[0].pvBuffer), OutBuffers[0].cbBuffer, 1, MSG_DUMPSSL);
cbData = send(ssl->s, (char*)OutBuffers[0].pvBuffer, OutBuffers[0].cbBuffer, 0);
- if (cbData == SOCKET_ERROR || cbData == 0)
+ if (cbData == SOCKET_ERROR || cbData == 0)
{
NetlibLogf(NULL, "SSL failure sending connection data (%d %d)", ssl->s, WSAGetLastError());
g_pSSPI->FreeContextBuffer(OutBuffers[0].pvBuffer);
@@ -628,17 +629,17 @@ void NetlibSslShutdown(SslHandle *ssl) OutBuffer.ulVersion = SECBUFFER_VERSION;
scRet = g_pSSPI->InitializeSecurityContextA(
- &hCreds,
- &ssl->hContext,
- NULL,
- dwSSPIFlags,
- 0,
- SECURITY_NATIVE_DREP,
- NULL,
- 0,
- &ssl->hContext,
- &OutBuffer,
- &dwSSPIOutFlags,
+ &hCreds,
+ &ssl->hContext,
+ NULL,
+ dwSSPIFlags,
+ 0,
+ SECURITY_NATIVE_DREP,
+ NULL,
+ 0,
+ &ssl->hContext,
+ &OutBuffer,
+ &dwSSPIOutFlags,
&tsExpiry);
if (FAILED(scRet)) return;
@@ -858,7 +859,7 @@ int NetlibSslRead(SslHandle *ssl, char *buf, int num, int peek) // sequence.
scRet = ClientHandshakeLoop(ssl, FALSE);
- if (scRet != SEC_E_OK)
+ if (scRet != SEC_E_OK)
{
ssl->state = sockError;
return NetlibSslReadSetResult(ssl, buf, num, peek);
@@ -922,7 +923,7 @@ int NetlibSslWrite(SslHandle *ssl, const char *buf, int num) if (FAILED(scRet)) break;
- // Calculate encrypted packet size
+ // Calculate encrypted packet size
cbData = Buffers[0].cbBuffer + Buffers[1].cbBuffer + Buffers[2].cbBuffer;
// Send the encrypted data to the server.
@@ -963,7 +964,7 @@ static INT_PTR GetSslApi(WPARAM, LPARAM lParam) int LoadSslModule(void)
{
CreateServiceFunction(MS_SYSTEM_GET_SI, GetSslApi);
- g_hSslMutex = CreateMutex(NULL, FALSE, NULL);
+ g_hSslMutex = CreateMutex(NULL, FALSE, NULL);
SecInvalidateHandle(&hCreds);
return 0;
diff --git a/src/modules/netlib/netlibupnp.cpp b/src/modules/netlib/netlibupnp.cpp index d11917c9b5..c0364adbbb 100644 --- a/src/modules/netlib/netlibupnp.cpp +++ b/src/modules/netlib/netlibupnp.cpp @@ -1,8 +1,9 @@ /*
-Miranda IM: the free IM client for Microsoft* Windows*
+Miranda NG: the free IM client for Microsoft* Windows*
-Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project,
+Copyright (c) 2012-14 Miranda NG project (http://miranda-ng.org),
+Copyright (c) 2000-12 Miranda IM project,
all portions of this codebase are copyrighted to the people
listed in contributors.txt.
|