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

Unified Diff: net/data/verify_certificate_chain_unittest/target-has-pathlen-but-not-ca/generate-chains.py

Issue 2805213004: Refactor how net/data/verify_certificate_chain_unittest/* (Closed)
Patch Set: fix android Created 3 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
Index: net/data/verify_certificate_chain_unittest/target-has-pathlen-but-not-ca/generate-chains.py
diff --git a/net/data/verify_certificate_chain_unittest/generate-target-has-pathlen-but-not-ca.py b/net/data/verify_certificate_chain_unittest/target-has-pathlen-but-not-ca/generate-chains.py
similarity index 67%
rename from net/data/verify_certificate_chain_unittest/generate-target-has-pathlen-but-not-ca.py
rename to net/data/verify_certificate_chain_unittest/target-has-pathlen-but-not-ca/generate-chains.py
index b8e767350f5e21371e6bc508ddde7d207eeac54b..44405c93a3c752849f56358fc9c759d995366644 100755
--- a/net/data/verify_certificate_chain_unittest/generate-target-has-pathlen-but-not-ca.py
+++ b/net/data/verify_certificate_chain_unittest/target-has-pathlen-but-not-ca/generate-chains.py
@@ -7,6 +7,9 @@
certificate that is not a CA, and yet has a pathlen set. Verification is
expected to fail, since pathlen should only be set for CAs."""
+import sys
+sys.path += ['..']
+
import common
# Self-signed root certificate (used as trust anchor).
@@ -20,16 +23,5 @@ target = common.create_end_entity_certificate('Target', intermediate)
target.get_extensions().set_property('basicConstraints',
'critical,CA:false,pathlen:1')
-
-chain = [target, intermediate]
-trusted = common.TrustAnchor(root, constrained=False)
-time = common.DEFAULT_TIME
-key_purpose = common.DEFAULT_KEY_PURPOSE
-verify_result = False
-errors = """----- Certificate i=0 (CN=Target) -----
-ERROR: Target certificate looks like a CA but does not set all CA properties
-
-"""
-
-common.write_test_file(__doc__, chain, trusted, time, key_purpose,
- verify_result, errors)
+chain = [target, intermediate, root]
+common.write_chain(__doc__, chain, 'chain.pem')

Powered by Google App Engine
This is Rietveld 408576698