diff --git a/talk/base/httpcommon.cc b/talk/base/httpcommon.cc index 05af9c2a4..ec7ffd288 100644 --- a/talk/base/httpcommon.cc +++ b/talk/base/httpcommon.cc @@ -60,9 +60,9 @@ extern const ConstantLabel SECURITY_ERRORS[]; bool find_string(size_t& index, const std::string& needle, const char* const haystack[], size_t max_index) { for (index=0; indexsecond.append(","); it->second.append(value); - } + } return; - } + } } headers_.insert(HeaderMap::value_type(name, value)); } @@ -1007,9 +1007,7 @@ HttpAuthResult HttpAuthenticate( } CredHandle cred; - ret = AcquireCredentialsHandleA( - 0, const_cast(want_negotiate ? NEGOSSP_NAME_A : NTLMSP_NAME_A), - SECPKG_CRED_OUTBOUND, 0, pauth_id, 0, 0, &cred, &lifetime); + ret = AcquireCredentialsHandleA(0, want_negotiate ? NEGOSSP_NAME_A : NTLMSP_NAME_A, SECPKG_CRED_OUTBOUND, 0, pauth_id, 0, 0, &cred, &lifetime); //LOG(INFO) << "$$$ AcquireCredentialsHandle @ " << TimeSince(now); if (ret != SEC_E_OK) { LOG(LS_ERROR) << "AcquireCredentialsHandle error: " diff --git a/talk/base/schanneladapter.cc b/talk/base/schanneladapter.cc index 1a71f5d53..a376328e2 100644 --- a/talk/base/schanneladapter.cc +++ b/talk/base/schanneladapter.cc @@ -149,9 +149,8 @@ SChannelAdapter::BeginSSL() { //sc_cred.dwMinimumCipherStrength = 128; // Note: use system default sc_cred.dwFlags = SCH_CRED_NO_DEFAULT_CREDS | SCH_CRED_AUTO_CRED_VALIDATION; - ret = AcquireCredentialsHandle(NULL, const_cast(UNISP_NAME), - SECPKG_CRED_OUTBOUND, NULL, &sc_cred, NULL, - NULL, &impl_->cred, NULL); + ret = AcquireCredentialsHandle(NULL, UNISP_NAME, SECPKG_CRED_OUTBOUND, NULL, + &sc_cred, NULL, NULL, &impl_->cred, NULL); if (ret != SEC_E_OK) { LOG(LS_ERROR) << "AcquireCredentialsHandle error: " << ErrorName(ret, SECURITY_ERRORS); diff --git a/webrtc/base/httpcommon.cc b/webrtc/base/httpcommon.cc index 569b7b3ac..095cdafef 100644 --- a/webrtc/base/httpcommon.cc +++ b/webrtc/base/httpcommon.cc @@ -43,9 +43,9 @@ extern const ConstantLabel SECURITY_ERRORS[]; bool find_string(size_t& index, const std::string& needle, const char* const haystack[], size_t max_index) { for (index=0; index(index); - return true; + size_t index; + if (!find_string(index, name, Names, Size)) + return false; + val = static_cast(index); + return true; } E val; @@ -434,9 +434,9 @@ HttpData::changeHeader(const std::string& name, const std::string& value, if (combine == HC_YES) { it->second.append(","); it->second.append(value); - } + } return; - } + } } headers_.insert(HeaderMap::value_type(name, value)); } @@ -731,7 +731,7 @@ struct NegotiateAuthContext : public HttpAuthContext { FreeCredentialsHandle(&cred); } }; -#endif // WEBRTC_WIN +#endif // WEBRTC_WIN HttpAuthResult HttpAuthenticate( const char * challenge, size_t len, @@ -990,9 +990,7 @@ HttpAuthResult HttpAuthenticate( } CredHandle cred; - ret = AcquireCredentialsHandleA( - 0, const_cast(want_negotiate ? NEGOSSP_NAME_A : NTLMSP_NAME_A), - SECPKG_CRED_OUTBOUND, 0, pauth_id, 0, 0, &cred, &lifetime); + ret = AcquireCredentialsHandleA(0, want_negotiate ? NEGOSSP_NAME_A : NTLMSP_NAME_A, SECPKG_CRED_OUTBOUND, 0, pauth_id, 0, 0, &cred, &lifetime); //LOG(INFO) << "$$$ AcquireCredentialsHandle @ " << TimeSince(now); if (ret != SEC_E_OK) { LOG(LS_ERROR) << "AcquireCredentialsHandle error: " @@ -1037,7 +1035,7 @@ HttpAuthResult HttpAuthenticate( return HAR_RESPONSE; } #endif -#endif // WEBRTC_WIN +#endif // WEBRTC_WIN return HAR_IGNORE; } diff --git a/webrtc/base/schanneladapter.cc b/webrtc/base/schanneladapter.cc index c5071e8e2..50c0638fd 100644 --- a/webrtc/base/schanneladapter.cc +++ b/webrtc/base/schanneladapter.cc @@ -132,9 +132,8 @@ SChannelAdapter::BeginSSL() { //sc_cred.dwMinimumCipherStrength = 128; // Note: use system default sc_cred.dwFlags = SCH_CRED_NO_DEFAULT_CREDS | SCH_CRED_AUTO_CRED_VALIDATION; - ret = AcquireCredentialsHandle(NULL, const_cast(UNISP_NAME), - SECPKG_CRED_OUTBOUND, NULL, &sc_cred, NULL, - NULL, &impl_->cred, NULL); + ret = AcquireCredentialsHandle(NULL, UNISP_NAME, SECPKG_CRED_OUTBOUND, NULL, + &sc_cred, NULL, NULL, &impl_->cred, NULL); if (ret != SEC_E_OK) { LOG(LS_ERROR) << "AcquireCredentialsHandle error: " << ErrorName(ret, SECURITY_ERRORS);