OLD | NEW |
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 Loading... |
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 |
OLD | NEW |