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

Unified Diff: net/data/verify_certificate_chain_unittest/incorrect-trust-anchor/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/incorrect-trust-anchor/generate-chains.py
diff --git a/net/data/verify_certificate_chain_unittest/generate-incorrect-trust-anchor.py b/net/data/verify_certificate_chain_unittest/incorrect-trust-anchor/generate-chains.py
similarity index 64%
rename from net/data/verify_certificate_chain_unittest/generate-incorrect-trust-anchor.py
rename to net/data/verify_certificate_chain_unittest/incorrect-trust-anchor/generate-chains.py
index 1d6eb5b028f94e761a572a6d804c06b3c4499376..33482964e1e7de522e9d7bb193f71cfffd224f9b 100755
--- a/net/data/verify_certificate_chain_unittest/generate-incorrect-trust-anchor.py
+++ b/net/data/verify_certificate_chain_unittest/incorrect-trust-anchor/generate-chains.py
@@ -7,6 +7,9 @@
incorrect (neither subject nor signature matches). Verification is expected to
fail."""
+import sys
+sys.path += ['..']
+
import common
# Self-signed root certificate, which is NOT saved as the trust anchor.
@@ -22,17 +25,5 @@ target = common.create_end_entity_certificate('Target', intermediate)
# anchor.
bogus_root = common.create_self_signed_root_certificate('BogusRoot')
-chain = [target, intermediate]
-trusted = common.TrustAnchor(bogus_root, constrained=False)
-time = common.DEFAULT_TIME
-key_purpose = common.DEFAULT_KEY_PURPOSE
-verify_result = False
-errors = """----- Certificate i=1 (CN=Intermediate) -----
-ERROR: Signature verification failed
-ERROR: VerifySignedData failed
-ERROR: subject does not match issuer
-
-"""
-
-common.write_test_file(__doc__, chain, trusted, time, key_purpose,
- verify_result, errors)
+chain = [target, intermediate, bogus_root]
+common.write_chain(__doc__, chain, 'chain.pem')

Powered by Google App Engine
This is Rietveld 408576698