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

Side by Side Diff: extensions/browser/api/cast_channel/cast_auth_util.cc

Issue 1902873002: Convert //extensions/browser/api from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/api/cast_channel/cast_auth_util.h" 5 #include "extensions/browser/api/cast_channel/cast_auth_util.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 // * Verifies that the certificate chain |response.client_auth_certificate| + 131 // * Verifies that the certificate chain |response.client_auth_certificate| +
132 // |response.intermediate_certificate| is valid and chains to a trusted 132 // |response.intermediate_certificate| is valid and chains to a trusted
133 // Cast root. 133 // Cast root.
134 // 134 //
135 // * Verifies that |response.signature| matches the signature 135 // * Verifies that |response.signature| matches the signature
136 // of |signature_input| by |response.client_auth_certificate|'s public 136 // of |signature_input| by |response.client_auth_certificate|'s public
137 // key. 137 // key.
138 AuthResult VerifyCredentials(const AuthResponse& response, 138 AuthResult VerifyCredentials(const AuthResponse& response,
139 const std::string& signature_input) { 139 const std::string& signature_input) {
140 // Verify the certificate 140 // Verify the certificate
141 scoped_ptr<cast_crypto::CertVerificationContext> verification_context; 141 std::unique_ptr<cast_crypto::CertVerificationContext> verification_context;
142 142
143 // Build a single vector containing the certificate chain. 143 // Build a single vector containing the certificate chain.
144 std::vector<std::string> cert_chain; 144 std::vector<std::string> cert_chain;
145 cert_chain.push_back(response.client_auth_certificate()); 145 cert_chain.push_back(response.client_auth_certificate());
146 cert_chain.insert(cert_chain.end(), 146 cert_chain.insert(cert_chain.end(),
147 response.intermediate_certificate().begin(), 147 response.intermediate_certificate().begin(),
148 response.intermediate_certificate().end()); 148 response.intermediate_certificate().end());
149 149
150 // Use the current time when checking certificate validity. 150 // Use the current time when checking certificate validity.
151 base::Time::Exploded now; 151 base::Time::Exploded now;
(...skipping 24 matching lines...) Expand all
176 success.channel_policies = AuthResult::POLICY_NONE; 176 success.channel_policies = AuthResult::POLICY_NONE;
177 break; 177 break;
178 } 178 }
179 179
180 return success; 180 return success;
181 } 181 }
182 182
183 } // namespace cast_channel 183 } // namespace cast_channel
184 } // namespace api 184 } // namespace api
185 } // namespace extensions 185 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698