diff options
author | eroman <eroman@chromium.org> | 2015-12-17 14:38:04 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-17 22:39:05 +0000 |
commit | e461b9127d35010e41e47cbb9f07a4bc25fc0866 (patch) | |
tree | 7e8e53884ca0524857777ce3631dfc459ace1000 /net/data/verify_certificate_chain_unittest/generate-target-and-intermediary.py | |
parent | 41466286433367a1e66a15aa34c64c94017013f5 (diff) | |
download | chromium_src-e461b9127d35010e41e47cbb9f07a4bc25fc0866.zip chromium_src-e461b9127d35010e41e47cbb9f07a4bc25fc0866.tar.gz chromium_src-e461b9127d35010e41e47cbb9f07a4bc25fc0866.tar.bz2 |
Add scripts to generate simple test data for certificate verification.
The intent is to complement other path validation test suites (i.e PKITS). Certainly there is overlap, but the advantage is easier manipulation and addition of test cases.
This introduces some python scripts and helpers that shell out to "openssl req" and "openssl ca" to generate certificate chains with certain properties.
These certificate chains (and associated data for verification) are used as test data by the follow-up CL (https://codereview.chromium.org/1414923007)
BUG=410574
Review URL: https://codereview.chromium.org/1414393008
Cr-Commit-Position: refs/heads/master@{#365922}
Diffstat (limited to 'net/data/verify_certificate_chain_unittest/generate-target-and-intermediary.py')
-rwxr-xr-x | net/data/verify_certificate_chain_unittest/generate-target-and-intermediary.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/net/data/verify_certificate_chain_unittest/generate-target-and-intermediary.py b/net/data/verify_certificate_chain_unittest/generate-target-and-intermediary.py new file mode 100755 index 0000000..94525cc --- /dev/null +++ b/net/data/verify_certificate_chain_unittest/generate-target-and-intermediary.py @@ -0,0 +1,25 @@ +#!/usr/bin/python +# Copyright (c) 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Certificate chain with 1 intermediary and a trusted root. Verification is +expected to succeed.""" + +import common + +# Self-signed root certificate (part of trust store). +root = common.create_self_signed_root_certificate('Root') + +# Intermediary certificate. +intermediary = common.create_intermediary_certificate('Intermediary', root) + +# Target certificate. +target = common.create_end_entity_certificate('Target', intermediary) + +chain = [target, intermediary] +trusted = [root] +time = common.DEFAULT_TIME +verify_result = True + +common.write_test_file(__doc__, chain, trusted, time, verify_result) |