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

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: Added note to comment 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/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 #include <algorithm> 9 #include <algorithm>
10 #include <utility> 10 #include <utility>
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 } 282 }
283 283
284 scoped_ptr<CertVerificationContext> CertVerificationContextImplForTest( 284 scoped_ptr<CertVerificationContext> CertVerificationContextImplForTest(
285 const base::StringPiece& spki) { 285 const base::StringPiece& spki) {
286 // Use a bogus CommonName, since this is just exposed for testing signature 286 // Use a bogus CommonName, since this is just exposed for testing signature
287 // verification by unittests. 287 // verification by unittests.
288 return make_scoped_ptr( 288 return make_scoped_ptr(
289 new CertVerificationContextImpl(net::der::Input(spki), "CommonName")); 289 new CertVerificationContextImpl(net::der::Input(spki), "CommonName"));
290 } 290 }
291 291
292 bool AddTrustAnchorForTest(const uint8_t* data, size_t length) {
293 return CastTrustStore::Get().AddTrustedCertificateWithoutCopying(data,
294 length);
295 }
296
292 } // namespace cast_crypto 297 } // namespace cast_crypto
293 } // namespace api 298 } // namespace api
294 } // namespace extensions 299 } // namespace extensions
OLDNEW
« extensions/common/cast/cast_cert_validator.h ('K') | « 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