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

Unified Diff: extensions/common/cast/cast_cert_validator.h

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | extensions/common/cast/cast_cert_validator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/cast/cast_cert_validator.h
diff --git a/extensions/common/cast/cast_cert_validator.h b/extensions/common/cast/cast_cert_validator.h
index 8f2f4def340a01456a95867f2a7e819e1db3e081..71ca34c0dddeca48dd0cab08cdf5a2280a0adbc9 100644
--- a/extensions/common/cast/cast_cert_validator.h
+++ b/extensions/common/cast/cast_cert_validator.h
@@ -86,6 +86,16 @@ bool VerifyDeviceCert(const std::vector<std::string>& certs,
std::unique_ptr<CertVerificationContext> CertVerificationContextImplForTest(
const base::StringPiece& spki);
+// Exposed only for testing, not for use in production code.
+//
+// Injects trusted root certificates into the CastTrustStore.
+// |data| must remain valid and not be mutated throughout the lifetime of
+// the program.
+// Warning: Using this function concurrently with VerifyDeviceCert()
+// is not thread safe.
+bool AddTrustAnchorForTest(const uint8_t* data,
+ size_t length) WARN_UNUSED_RESULT;
+
} // namespace cast_crypto
} // namespace api
} // namespace extensions
« no previous file with comments | « no previous file | extensions/common/cast/cast_cert_validator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698