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

Unified Diff: net/data/verify_certificate_chain_unittest/generate-unconstrained-root-basic-constraints-ca-false.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-unconstrained-root-basic-constraints-ca-false.py
diff --git a/net/data/verify_certificate_chain_unittest/generate-intermediate-basic-constraints-ca-false.py b/net/data/verify_certificate_chain_unittest/generate-unconstrained-root-basic-constraints-ca-false.py
similarity index 63%
copy from net/data/verify_certificate_chain_unittest/generate-intermediate-basic-constraints-ca-false.py
copy to net/data/verify_certificate_chain_unittest/generate-unconstrained-root-basic-constraints-ca-false.py
index 41bfe0a1ba3a0e2589370fb002d75f9ffddd6b9c..93c101a96302ab080ceaf974dc31c396277c8e6c 100755
--- a/net/data/verify_certificate_chain_unittest/generate-intermediate-basic-constraints-ca-false.py
+++ b/net/data/verify_certificate_chain_unittest/generate-unconstrained-root-basic-constraints-ca-false.py
@@ -3,19 +3,20 @@
# 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. The intermediate
+"""Certificate chain with 1 intermediate and a trust anchor. The trust anchor
has a basic constraints extension that indicates it is NOT a CA. Verification
-is expected to fail."""
+is expected to succeed as constraints on the root certificate are not applied
+to the trust anchor."""
import common
-# Self-signed root certificate (used as trust anchor).
+# Self-signed root certificate (used as trust anchor) with non-CA basic
+# constraints.
root = common.create_self_signed_root_certificate('Root')
+root.get_extensions().set_property('basicConstraints', 'critical,CA:false')
-# Intermediate with incorrect basic constraints.
+# Intermediate certificate.
intermediate = common.create_intermediate_certificate('Intermediate', root)
-intermediate.get_extensions().set_property('basicConstraints',
- 'critical,CA:false')
# Target certificate.
target = common.create_end_entity_certificate('Target', intermediate)
@@ -23,6 +24,7 @@ target = common.create_end_entity_certificate('Target', intermediate)
chain = [target, intermediate]
trusted = common.TrustAnchor(root, constrained=False)
time = common.DEFAULT_TIME
-verify_result = False
+verify_result = True
common.write_test_file(__doc__, chain, trusted, time, verify_result)
+

Powered by Google App Engine
This is Rietveld 408576698