mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2026-01-08 15:39:22 +01:00
Add test for CA forgery attempt
As we accept EE certs that are explicitly trusted (in the list of trusted roots) and usually look for parent by subject, and in the future we might want to avoid checking the self-signature on trusted certs, there could a risk that we incorrectly accept a cert that looks like a trusted root except it doesn't have the same key. This test ensures this will never happen.
This commit is contained in:
parent
d092277683
commit
c10afdb322
4 changed files with 25 additions and 0 deletions
|
|
@ -97,6 +97,13 @@ server5-ss-expired.crt: server5.key
|
|||
$(FAKETIME) -f -3653d $(OPENSSL) req -x509 -new -subj "/C=UK/O=mbed TLS/OU=testsuite/CN=localhost" -days 3653 -sha256 -key $< -out $@
|
||||
all_final += server5-ss-expired.crt
|
||||
|
||||
# try to forge a copy of test-int-ca3 with different key
|
||||
server5-ss-forgeca.crt: server5.key
|
||||
$(FAKETIME) '2015-09-01 14:08:43' $(OPENSSL) req -x509 -new -subj "/C=UK/O=mbed TLS/CN=mbed TLS Test intermediate CA 3" -set_serial 77 -config $(test_ca_config_file) -extensions noext_ca -days 3650 -sha256 -key $< -out $@
|
||||
all_final += server5-ss-forgeca.crt
|
||||
|
||||
|
||||
|
||||
|
||||
################################################################
|
||||
#### Meta targets
|
||||
|
|
|
|||
11
tests/data_files/server5-ss-forgeca.crt
Normal file
11
tests/data_files/server5-ss-forgeca.crt
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
-----BEGIN CERTIFICATE-----
|
||||
MIIBlDCCATmgAwIBAgIBTTAKBggqhkjOPQQDAjBKMQswCQYDVQQGEwJVSzERMA8G
|
||||
A1UECgwIbWJlZCBUTFMxKDAmBgNVBAMMH21iZWQgVExTIFRlc3QgaW50ZXJtZWRp
|
||||
YXRlIENBIDMwHhcNMTUwOTAxMTIwODQzWhcNMjUwODI5MTIwODQzWjBKMQswCQYD
|
||||
VQQGEwJVSzERMA8GA1UECgwIbWJlZCBUTFMxKDAmBgNVBAMMH21iZWQgVExTIFRl
|
||||
c3QgaW50ZXJtZWRpYXRlIENBIDMwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQ3
|
||||
zFbZdgkeWnI+x1kt/yBu7nz5BpF00K0UtfdoIllikk7lANgjEf/qL9I0XV0WvYqI
|
||||
wmt3DVXNiioO+gHItO3/oxAwDjAMBgNVHRMEBTADAQH/MAoGCCqGSM49BAMCA0kA
|
||||
MEYCIQDF5pY54AUMNbhy3jk+8sdgsZS6bmeH/QI4D0I6UiIhXQIhAO7Y8V7Z8bx2
|
||||
gZyyk/wZpswb53ZaIP2XsJiJ/CPMCCVq
|
||||
-----END CERTIFICATE-----
|
||||
|
|
@ -11,3 +11,6 @@ commonName = PolarSSL Test CA
|
|||
subjectKeyIdentifier=hash
|
||||
authorityKeyIdentifier=keyid:always,issuer:always
|
||||
basicConstraints = CA:true
|
||||
|
||||
[noext_ca]
|
||||
basicConstraints = CA:true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue