1a8e1175bSopenharmony_ciThis documents the X.509 CAs, certificates, and CRLS used for testing.
2a8e1175bSopenharmony_ci
3a8e1175bSopenharmony_ciCertification authorities
4a8e1175bSopenharmony_ci-------------------------
5a8e1175bSopenharmony_ci
6a8e1175bSopenharmony_ciThere are two main CAs for use as trusted roots:
7a8e1175bSopenharmony_ci- test-ca.crt aka "C=NL, O=PolarSSL, CN=PolarSSL Test CA"
8a8e1175bSopenharmony_ci  uses a RSA-2048 key
9a8e1175bSopenharmony_ci  test-ca-sha1.crt and test-ca-sha256.crt use the same key, signed with
10a8e1175bSopenharmony_ci  different hashes.
11a8e1175bSopenharmony_ci- test-ca2*.crt aka "C=NL, O=PolarSSL, CN=Polarssl Test EC CA"
12a8e1175bSopenharmony_ci  uses an EC key with NIST P-384 (aka secp384r1)
13a8e1175bSopenharmony_ci  variants used to test the keyUsage extension
14a8e1175bSopenharmony_ciThe files test-ca_cat12 and test-ca_cat21 contain them concatenated both ways.
15a8e1175bSopenharmony_ci
16a8e1175bSopenharmony_ciTwo intermediate CAs are signed by them:
17a8e1175bSopenharmony_ci- test-int-ca.crt "C=NL, O=PolarSSL, CN=PolarSSL Test Intermediate CA"
18a8e1175bSopenharmony_ci  uses RSA-4096, signed by test-ca2
19a8e1175bSopenharmony_ci    - test-int-ca-exp.crt is a copy that is expired
20a8e1175bSopenharmony_ci- test-int-ca2.crt "C=NL, O=PolarSSL, CN=PolarSSL Test Intermediate EC CA"
21a8e1175bSopenharmony_ci  uses an EC key with NIST P-384, signed by test-ca
22a8e1175bSopenharmony_ci
23a8e1175bSopenharmony_ciA third intermediate CA is signed by test-int-ca2.crt:
24a8e1175bSopenharmony_ci- test-int-ca3.crt "C=UK, O=mbed TLS, CN=mbed TLS Test intermediate CA 3"
25a8e1175bSopenharmony_ci  uses an EC key with NIST P-256, signed by test-int-ca2
26a8e1175bSopenharmony_ci
27a8e1175bSopenharmony_ciFinally, other CAs for specific purposes:
28a8e1175bSopenharmony_ci- enco-ca-prstr.pem: has its CN encoded as a printable string, but child cert
29a8e1175bSopenharmony_ci  enco-cert-utf8str.pem has its issuer's CN encoded as a UTF-8 string.
30a8e1175bSopenharmony_ci- test-ca-v1.crt: v1 "CA", signs
31a8e1175bSopenharmony_ci    server1-v1.crt: v1 "intermediate CA", signs
32a8e1175bSopenharmony_ci        server2-v1*.crt: EE cert (without of with chain in same file)
33a8e1175bSopenharmony_ci- keyUsage.decipherOnly.crt: has the decipherOnly keyUsage bit set
34a8e1175bSopenharmony_ci
35a8e1175bSopenharmony_ciEnd-entity certificates
36a8e1175bSopenharmony_ci-----------------------
37a8e1175bSopenharmony_ci
38a8e1175bSopenharmony_ciShort information fields:
39a8e1175bSopenharmony_ci
40a8e1175bSopenharmony_ci- name or pattern
41a8e1175bSopenharmony_ci- issuing CA:   1   -> test-ca.crt
42a8e1175bSopenharmony_ci                2   -> test-ca2.crt
43a8e1175bSopenharmony_ci                I1  -> test-int-ca.crt
44a8e1175bSopenharmony_ci                I2  -> test-int-ca2.crt
45a8e1175bSopenharmony_ci                I3  -> test-int-ca3.crt
46a8e1175bSopenharmony_ci                O   -> other
47a8e1175bSopenharmony_ci- key type: R -> RSA, E -> EC
48a8e1175bSopenharmony_ci- C -> there is a CRL revoking this cert (see below)
49a8e1175bSopenharmony_ci- L -> CN=localhost (useful for local test servers)
50a8e1175bSopenharmony_ci- P1, P2 if the file includes parent (resp. parent + grandparent)
51a8e1175bSopenharmony_ci- free-form comments
52a8e1175bSopenharmony_ci
53a8e1175bSopenharmony_ciList of certificates:
54a8e1175bSopenharmony_ci
55a8e1175bSopenharmony_ci- cert_example_multi*.crt: 1/O R: subjectAltName
56a8e1175bSopenharmony_ci- cert_example_wildcard.crt: 1 R: wildcard in subject's CN
57a8e1175bSopenharmony_ci- cert_md*.crt, cert_sha*.crt: 1 R: signature hash
58a8e1175bSopenharmony_ci- cert_v1_with_ext.crt: 1 R: v1 with extensions (illegal)
59a8e1175bSopenharmony_ci- cli2.crt: 2 E: basic
60a8e1175bSopenharmony_ci- cli-rsa.key, cli-rsa-*.crt: RSA key used for test clients, signed by
61a8e1175bSopenharmony_ci  the RSA test CA.
62a8e1175bSopenharmony_ci- enco-cert-utf8str.pem: see enco-ca-prstr.pem above
63a8e1175bSopenharmony_ci- server1*.crt: 1* R C* P1*: misc *(server1-v1 see test-ca-v1.crt above)
64a8e1175bSopenharmony_ci    *CRL for: .cert_type.crt, .crt, .key_usage.crt, .v1.crt
65a8e1175bSopenharmony_ci    P1 only for _ca.crt
66a8e1175bSopenharmony_ci- server2-v1*.crt: O R: see test-ca-v1.crt above
67a8e1175bSopenharmony_ci- server2*.crt: 1 R L: misc
68a8e1175bSopenharmony_ci- server3.crt: 1 E L: EC cert signed by RSA CA
69a8e1175bSopenharmony_ci- server4.crt: 2 R L: RSA cert signed by EC CA
70a8e1175bSopenharmony_ci- server5*.crt: 2* E L: misc *(except -selfsigned and -ss-*)
71a8e1175bSopenharmony_ci    -sha*: hashes
72a8e1175bSopenharmony_ci    .eku*: extendeKeyUsage (cli/srv = www client/server, cs = codesign, etc)
73a8e1175bSopenharmony_ci    .ku*: keyUsage (ds = signatures, ke/ka = key exchange/agreement)
74a8e1175bSopenharmony_ci    .req*: CSR, not certificate
75a8e1175bSopenharmony_ci    -der*: trailing bytes in der (?)
76a8e1175bSopenharmony_ci    -badsign.crt: S5 with corrupted signature
77a8e1175bSopenharmony_ci    -expired.crt: S5 with "not after" date in the past
78a8e1175bSopenharmony_ci    -future.crt: S5 with "not before" date in the future
79a8e1175bSopenharmony_ci    -non-compliant.crt: S5, RFC non-compliant
80a8e1175bSopenharmony_ci      (with forbidden EC algorithm identifier NULL parameter)
81a8e1175bSopenharmony_ci      generated by (before fix):
82a8e1175bSopenharmony_ci        cert_write subject_key=server5.key subject_name="CN=Test EC RFC non-compliant" issuer_crt=test-ca2.crt issuer_key=test-ca2.key
83a8e1175bSopenharmony_ci    -selfsigned.crt: Self-signed cert with S5 key
84a8e1175bSopenharmony_ci    -ss-expired.crt: Self-signed cert with S5 key, expired
85a8e1175bSopenharmony_ci    -ss-forgeca.crt: Copy of test-int-ca3 self-signed with S5 key
86a8e1175bSopenharmony_ci- server6-ss-child.crt: O E: "child" of non-CA server5-selfsigned
87a8e1175bSopenharmony_ci- server6.crt, server6.pem: 2 E L C: revoked
88a8e1175bSopenharmony_ci- server7.crt: I1 E L P1(usually): EC signed by RSA signed by EC
89a8e1175bSopenharmony_ci    -badsign.crt: S7 with corrupted signature + I1
90a8e1175bSopenharmony_ci    -expired.crt: S7 with "not after" date in the past + I1
91a8e1175bSopenharmony_ci    -future.crt: S7 with "not before" date in the future + I1
92a8e1175bSopenharmony_ci    _int-ca-exp.crt: S7 + expired I1
93a8e1175bSopenharmony_ci    _int-ca.crt: S7 + I1
94a8e1175bSopenharmony_ci    _int-ca_ca2.crt: S7 + I1 + 2
95a8e1175bSopenharmony_ci    _all_space.crt: S7 + I1 both with misplaced spaces (invalid PEM)
96a8e1175bSopenharmony_ci    _pem_space.crt: S7 with misplaced space (invalid PEM) + I1
97a8e1175bSopenharmony_ci    _trailing_space.crt: S7 + I1 both with trailing space (valid PEM)
98a8e1175bSopenharmony_ci    _spurious_int-ca.crt: S7 + I2(spurious) + I1
99a8e1175bSopenharmony_ci- server8*.crt: I2 R L: RSA signed by EC signed by RSA (P1 for _int-ca2)
100a8e1175bSopenharmony_ci- server9*.crt: 1 R C* L P1*: signed using RSASSA-PSS
101a8e1175bSopenharmony_ci    *CRL for: 9.crt, -badsign, -with-ca (P1)
102a8e1175bSopenharmony_ci- server10.crt: I3 E L
103a8e1175bSopenharmony_ci    -badsign.crt: S10 with corrupted signature
104a8e1175bSopenharmony_ci    -bs_int3.pem: S10-badsign + I3
105a8e1175bSopenharmony_ci    _int3-bs.pem: S10 + I3-badsign
106a8e1175bSopenharmony_ci    _int3_int-ca2.crt: S10 + I3 + I2
107a8e1175bSopenharmony_ci    _int3_int-ca2_ca.crt: S10 + I3 + I2 + 1
108a8e1175bSopenharmony_ci    _int3_spurious_int-ca2.crt: S10 + I3 + I1(spurious) + I2
109a8e1175bSopenharmony_ci
110a8e1175bSopenharmony_ciCertificate revocation lists
111a8e1175bSopenharmony_ci----------------------------
112a8e1175bSopenharmony_ci
113a8e1175bSopenharmony_ciSigning CA in parentheses (same meaning as certificates).
114a8e1175bSopenharmony_ci
115a8e1175bSopenharmony_ci- crl-ec-sha*.pem: (2) server6.crt
116a8e1175bSopenharmony_ci- crl-future.pem: (2) server6.crt + unknown
117a8e1175bSopenharmony_ci- crl-rsa-pss-*.pem: (1) server9{,badsign,with-ca}.crt + cert_sha384.crt + unknown
118a8e1175bSopenharmony_ci- crl.pem, crl-futureRevocationDate.pem, crl_expired.pem: (1) server1{,.cert_type,.key_usage,.v1}.crt + unknown
119a8e1175bSopenharmony_ci- crl_md*.pem: crl_sha*.pem: (1) same as crl.pem
120a8e1175bSopenharmony_ci- crt_cat_*.pem: (1+2) concatenations in various orders:
121a8e1175bSopenharmony_ci    ec = crl-ec-sha256.pem, ecfut = crl-future.pem
122a8e1175bSopenharmony_ci    rsa = crl.pem, rsabadpem = same with pem error, rsaexp = crl_expired.pem
123a8e1175bSopenharmony_ci
124a8e1175bSopenharmony_ciNote: crl_future would revoke server9 and cert_sha384.crt if signed by CA 1
125a8e1175bSopenharmony_ci      crl-rsa-pss* would revoke server6.crt if signed by CA 2
126a8e1175bSopenharmony_ci
127a8e1175bSopenharmony_ciGeneration
128a8e1175bSopenharmony_ci----------
129a8e1175bSopenharmony_ci
130a8e1175bSopenharmony_ciNewer test files have been generated through commands in the Makefile. The
131a8e1175bSopenharmony_ciresulting files are committed to the repository so that the tests can
132a8e1175bSopenharmony_cirun without having to re-do the generation and so that the output is the
133a8e1175bSopenharmony_cisame for everyone (the generation process is randomized).
134a8e1175bSopenharmony_ci
135a8e1175bSopenharmony_ciThe origin of older certificates has not been recorded.
136