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

Side by Side Diff: net/android/http_auth_negotiate_android.cc

Issue 1408433006: Support tls-server-end-point channel bindings for HTTP authentication. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Narrower dependencies, update comments, address review comments. Created 4 years, 9 months 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "net/android/http_auth_negotiate_android.h" 5 #include "net/android/http_auth_negotiate_android.h"
6 6
7 #include "base/android/jni_string.h" 7 #include "base/android/jni_string.h"
8 #include "base/android/scoped_java_ref.h" 8 #include "base/android/scoped_java_ref.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 return net::ParseFirstRoundChallenge("negotiate", tok); 94 return net::ParseFirstRoundChallenge("negotiate", tok);
95 } 95 }
96 std::string decoded_auth_token; 96 std::string decoded_auth_token;
97 return net::ParseLaterRoundChallenge("negotiate", tok, &server_auth_token_, 97 return net::ParseLaterRoundChallenge("negotiate", tok, &server_auth_token_,
98 &decoded_auth_token); 98 &decoded_auth_token);
99 } 99 }
100 100
101 int HttpAuthNegotiateAndroid::GenerateAuthToken( 101 int HttpAuthNegotiateAndroid::GenerateAuthToken(
102 const AuthCredentials* credentials, 102 const AuthCredentials* credentials,
103 const std::string& spn, 103 const std::string& spn,
104 const std::string& channel_bindings,
104 std::string* auth_token, 105 std::string* auth_token,
105 const net::CompletionCallback& callback) { 106 const net::CompletionCallback& callback) {
106 if (prefs_->AuthAndroidNegotiateAccountType().empty()) { 107 if (prefs_->AuthAndroidNegotiateAccountType().empty()) {
107 // This can happen if there is a policy change, removing the account type, 108 // This can happen if there is a policy change, removing the account type,
108 // in the middle of a negotiation. 109 // in the middle of a negotiation.
109 return ERR_UNSUPPORTED_AUTH_SCHEME; 110 return ERR_UNSUPPORTED_AUTH_SCHEME;
110 } 111 }
111 DCHECK(auth_token); 112 DCHECK(auth_token);
112 DCHECK(completion_callback_.is_null()); 113 DCHECK(completion_callback_.is_null());
113 DCHECK(!callback.is_null()); 114 DCHECK(!callback.is_null());
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 const std::string& raw_token) { 153 const std::string& raw_token) {
153 DCHECK(auth_token_); 154 DCHECK(auth_token_);
154 DCHECK(!completion_callback_.is_null()); 155 DCHECK(!completion_callback_.is_null());
155 if (result == OK) 156 if (result == OK)
156 *auth_token_ = "Negotiate " + raw_token; 157 *auth_token_ = "Negotiate " + raw_token;
157 base::ResetAndReturn(&completion_callback_).Run(result); 158 base::ResetAndReturn(&completion_callback_).Run(result);
158 } 159 }
159 160
160 } // namespace android 161 } // namespace android
161 } // namespace net 162 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698