Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(231)

Side by Side Diff: net/http/http_auth_sspi_win.h

Issue 8340026: Use AuthCredentials throughout the network stack instead of username/password. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: mac compile fix Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file contains common routines used by NTLM and Negotiate authentication 5 // This file contains common routines used by NTLM and Negotiate authentication
6 // using the SSPI API on Windows. 6 // using the SSPI API on Windows.
7 7
8 #ifndef NET_HTTP_HTTP_AUTH_SSPI_WIN_H_ 8 #ifndef NET_HTTP_HTTP_AUTH_SSPI_WIN_H_
9 #define NET_HTTP_HTTP_AUTH_SSPI_WIN_H_ 9 #define NET_HTTP_HTTP_AUTH_SSPI_WIN_H_
10 #pragma once 10 #pragma once
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 HttpAuth::ChallengeTokenizer* tok); 138 HttpAuth::ChallengeTokenizer* tok);
139 139
140 // Generates an authentication token for the service specified by the 140 // Generates an authentication token for the service specified by the
141 // Service Principal Name |spn| and stores the value in |*auth_token|. 141 // Service Principal Name |spn| and stores the value in |*auth_token|.
142 // If the return value is not |OK|, then the value of |*auth_token| is 142 // If the return value is not |OK|, then the value of |*auth_token| is
143 // unspecified. ERR_IO_PENDING is not a valid return code. 143 // unspecified. ERR_IO_PENDING is not a valid return code.
144 // If this is the first round of a multiple round scheme, credentials are 144 // If this is the first round of a multiple round scheme, credentials are
145 // obtained using |*username| and |*password|. If |username| and |password| 145 // obtained using |*username| and |*password|. If |username| and |password|
146 // are both NULL, the credentials for the currently logged in user are used 146 // are both NULL, the credentials for the currently logged in user are used
147 // instead. 147 // instead.
148 int GenerateAuthToken(const string16* username, 148 int GenerateAuthToken(const AuthCredentials* credentials,
149 const string16* password,
150 const std::wstring& spn, 149 const std::wstring& spn,
151 std::string* auth_token); 150 std::string* auth_token);
152 151
153 // Delegation is allowed on the Kerberos ticket. This allows certain servers 152 // Delegation is allowed on the Kerberos ticket. This allows certain servers
154 // to act as the user, such as an IIS server retrieiving data from a 153 // to act as the user, such as an IIS server retrieiving data from a
155 // Kerberized MSSQL server. 154 // Kerberized MSSQL server.
156 void Delegate(); 155 void Delegate();
157 156
158 private: 157 private:
159 int OnFirstRound(const string16* username, const string16* password); 158 int OnFirstRound(const AuthCredentials* credentials);
160 159
161 int GetNextSecurityToken( 160 int GetNextSecurityToken(
162 const std::wstring& spn, 161 const std::wstring& spn,
163 const void* in_token, 162 const void* in_token,
164 int in_token_len, 163 int in_token_len,
165 void** out_token, 164 void** out_token,
166 int* out_token_len); 165 int* out_token_len);
167 166
168 void ResetSecurityContext(); 167 void ResetSecurityContext();
169 168
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 // If the return value is ERR_UNEXPECTED, there was an unanticipated problem 200 // If the return value is ERR_UNEXPECTED, there was an unanticipated problem
202 // in the underlying SSPI call. The details are logged, and |*max_token_length| 201 // in the underlying SSPI call. The details are logged, and |*max_token_length|
203 // is not changed. 202 // is not changed.
204 NET_EXPORT_PRIVATE int DetermineMaxTokenLength(SSPILibrary* library, 203 NET_EXPORT_PRIVATE int DetermineMaxTokenLength(SSPILibrary* library,
205 const std::wstring& package, 204 const std::wstring& package,
206 ULONG* max_token_length); 205 ULONG* max_token_length);
207 206
208 } // namespace net 207 } // namespace net
209 208
210 #endif // NET_HTTP_HTTP_AUTH_SSPI_WIN_H_ 209 #endif // NET_HTTP_HTTP_AUTH_SSPI_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698