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

Unified Diff: net/data/verify_certificate_chain_unittest/generate-violates-pathlen-1-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-violates-pathlen-1-root.py
diff --git a/net/data/verify_certificate_chain_unittest/generate-violates-pathlen-1-root.py b/net/data/verify_certificate_chain_unittest/generate-violates-pathlen-1-root.py
index b762d594b75d3921732bbf22b7ee535a35eb67f2..8f32f0a1331873c0874768a5f9324fb72511e1ea 100755
--- a/net/data/verify_certificate_chain_unittest/generate-violates-pathlen-1-root.py
+++ b/net/data/verify_certificate_chain_unittest/generate-violates-pathlen-1-root.py
@@ -9,7 +9,7 @@ invalid chain, however constraints on trust anchors are not validated."""
import common
-# Self-signed root certificate (part of trust store).
+# Self-signed root certificate (used as trust anchor).
root = common.create_self_signed_root_certificate('Root')
root.get_extensions().set_property('basicConstraints',
'critical,CA:true,pathlen:1')
@@ -24,9 +24,12 @@ intermediate2 = common.create_intermediate_certificate('Intermediate2',
# Target certificate.
target = common.create_end_entity_certificate('Target', intermediate2)
-chain = [target, intermediate2, intermediate1]
-trusted = [root]
-time = common.DEFAULT_TIME
-verify_result = True
+# Write the test chain to a file.
+test = common.TestData()
+test.description = __doc__
+test.chain = [target, intermediate2, intermediate1]
+test.trust_anchor = common.TrustAnchor(root, constrained=False)
+test.utc_time = common.DEFAULT_TIME
+test.verify_result = True
-common.write_test_file(__doc__, chain, trusted, time, verify_result)
+test.write_to_file(common.get_default_pem_path())

Powered by Google App Engine
This is Rietveld 408576698