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

Unified Diff: net/data/verify_certificate_chain_unittest/generate-unknown-root.py

Issue 2233233002: Refactor some certificate verification tests in preparation to adding (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@trust_anchor
Patch Set: moar Created 4 years, 4 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
Index: net/data/verify_certificate_chain_unittest/generate-unknown-root.py
diff --git a/net/data/verify_certificate_chain_unittest/generate-unknown-root.py b/net/data/verify_certificate_chain_unittest/generate-unknown-root.py
index 523b590667a8a1e100df30c755711a01c536ac5d..bac251ca817100d177b99ecb310b128495fc59a9 100755
--- a/net/data/verify_certificate_chain_unittest/generate-unknown-root.py
+++ b/net/data/verify_certificate_chain_unittest/generate-unknown-root.py
@@ -18,9 +18,16 @@ intermediate = common.create_intermediate_certificate('Intermediate', root)
# Target certificate.
target = common.create_end_entity_certificate('Target', intermediate)
-chain = [target, intermediate]
-trusted = [] # Note that this lacks |root|
-time = common.DEFAULT_TIME
-verify_result = False
+# Self-signed root which is unused by the path.
+bogus_root = common.create_self_signed_root_certificate('BogusRoot')
-common.write_test_file(__doc__, chain, trusted, time, verify_result)
+# Write the test chain to a file.
+test = common.TestData()
+test.description = __doc__
+test.chain = [target, intermediate]
+# Note that this is not the root that the path chains up to.
+test.trust_anchor = common.TrustAnchor(bogus_root, constrained=False)
+test.utc_time = common.DEFAULT_TIME
+test.verify_result = False
+
+test.write_to_file(common.get_default_pem_path())

Powered by Google App Engine
This is Rietveld 408576698