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

Unified Diff: net/data/verify_certificate_chain_unittest/generate-constrained-non-self-signed-root.py

Issue 2245643004: Support trust anchor constraints, by specifying them as a certificate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update gypi 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-constrained-non-self-signed-root.py
diff --git a/net/data/verify_certificate_chain_unittest/generate-target-and-intermediate.py b/net/data/verify_certificate_chain_unittest/generate-constrained-non-self-signed-root.py
similarity index 55%
copy from net/data/verify_certificate_chain_unittest/generate-target-and-intermediate.py
copy to net/data/verify_certificate_chain_unittest/generate-constrained-non-self-signed-root.py
index c426854857967b58f5cfbe8f72e53dbe214d9775..f61c6711d1b3187908a7c5ba4f7800699025bf05 100755
--- a/net/data/verify_certificate_chain_unittest/generate-target-and-intermediate.py
+++ b/net/data/verify_certificate_chain_unittest/generate-constrained-non-self-signed-root.py
@@ -3,13 +3,16 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-"""Certificate chain with 1 intermediate and a trusted root. Verification is
-expected to succeed."""
+"""Certificate chain with 1 intermediate and a non-self-signed trust anchor.
+Verification should succeed, it doesn't matter that the root was not
+self-signed if it is designated as the trust anchor."""
import common
-# Self-signed root certificate (used as trust anchor).
-root = common.create_self_signed_root_certificate('Root')
+uber_root = common.create_self_signed_root_certificate('UberRoot')
+
+# Non-self-signed root certificate (used as trust anchor)
+root = common.create_intermediate_certificate('Root', uber_root)
# Intermediate certificate.
intermediate = common.create_intermediate_certificate('Intermediate', root)
@@ -18,8 +21,9 @@ intermediate = common.create_intermediate_certificate('Intermediate', root)
target = common.create_end_entity_certificate('Target', intermediate)
chain = [target, intermediate]
-trusted = common.TrustAnchor(root, constrained=False)
+trusted = common.TrustAnchor(root, constrained=True)
time = common.DEFAULT_TIME
verify_result = True
common.write_test_file(__doc__, chain, trusted, time, verify_result)
+

Powered by Google App Engine
This is Rietveld 408576698