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

Side by Side Diff: extensions/common/cast/cast_cert_validator.cc

Issue 1888913005: Add a hook to inject trusted Cast roots for testing purposes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed nit 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
« no previous file with comments | « extensions/common/cast/cast_cert_validator.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/common/cast/cast_cert_validator.h" 5 #include "extensions/common/cast/cast_cert_validator.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 } 285 }
286 286
287 std::unique_ptr<CertVerificationContext> CertVerificationContextImplForTest( 287 std::unique_ptr<CertVerificationContext> CertVerificationContextImplForTest(
288 const base::StringPiece& spki) { 288 const base::StringPiece& spki) {
289 // Use a bogus CommonName, since this is just exposed for testing signature 289 // Use a bogus CommonName, since this is just exposed for testing signature
290 // verification by unittests. 290 // verification by unittests.
291 return base::WrapUnique( 291 return base::WrapUnique(
292 new CertVerificationContextImpl(net::der::Input(spki), "CommonName")); 292 new CertVerificationContextImpl(net::der::Input(spki), "CommonName"));
293 } 293 }
294 294
295 bool AddTrustAnchorForTest(const uint8_t* data, size_t length) {
296 return CastTrustStore::Get().AddTrustedCertificateWithoutCopying(data,
297 length);
298 }
299
295 } // namespace cast_crypto 300 } // namespace cast_crypto
296 } // namespace api 301 } // namespace api
297 } // namespace extensions 302 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/common/cast/cast_cert_validator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698