From 9c134cef3503d109cd4de18053482182b37128a0 Mon Sep 17 00:00:00 2001 From: Darren Krahn Date: Wed, 13 Jan 2021 22:04:45 -0800 Subject: [PATCH] Add build instructions for new test data. Signed-off-by: Darren Krahn --- tests/data_files/Makefile | 8 ++++++++ tests/data_files/server1.ca.der | Bin 0 -> 841 bytes tests/suites/test_suite_x509write.function | 1 + 3 files changed, 9 insertions(+) create mode 100644 tests/data_files/server1.ca.der diff --git a/tests/data_files/Makefile b/tests/data_files/Makefile index 88f265ce1..212cb0129 100644 --- a/tests/data_files/Makefile +++ b/tests/data_files/Makefile @@ -1012,6 +1012,14 @@ server1.v1.der: server1.v1.crt $(OPENSSL) x509 -inform PEM -in $< -outform DER -out $@ all_final += server1.v1.crt server1.v1.der +server1.ca.crt: server1.key server1.req.sha256 $(test_ca_crt) $(test_ca_key_file_rsa) + $(MBEDTLS_CERT_WRITE) request_file=server1.req.sha256 issuer_crt=$(test_ca_crt) issuer_key=$(test_ca_key_file_rsa) issuer_pwd=$(test_ca_pwd_rsa) version=1 not_before=20190210144406 not_after=20290210144406 md=SHA1 is_ca=1 version=3 output_file=$@ +server1.ca_noauthid.crt: server1.key server1.req.sha256 $(test_ca_crt) $(test_ca_key_file_rsa) + $(MBEDTLS_CERT_WRITE) request_file=server1.req.sha256 issuer_crt=$(test_ca_crt) issuer_key=$(test_ca_key_file_rsa) issuer_pwd=$(test_ca_pwd_rsa) not_before=20190210144406 not_after=20290210144406 md=SHA1 authority_identifier=0 is_ca=1 version=3 output_file=$@ +server1.ca.der: server1.ca.crt + $(OPENSSL) x509 -inform PEM -in $< -outform DER -out $@ +all_final += server1.ca.crt server1.ca_noauthid.crt server1.ca.der + server1_ca.crt: server1.crt $(test_ca_crt) cat server1.crt $(test_ca_crt) > $@ all_final += server1_ca.crt diff --git a/tests/data_files/server1.ca.der b/tests/data_files/server1.ca.der new file mode 100644 index 0000000000000000000000000000000000000000..a5ff059bc76c412a5af81105e3e3dc2082ab2f04 GIT binary patch literal 841 zcmXqLVssC%f_kI=F#?@mywZ`mBGN;klTQhjX9KsO_<5g$57CK zAH?C};RwjjNh}Hu_A!(+5C;h{^9aC%6hcyqOB9?P4dldm4J{3f3=IrTOiT>SqQrTP zkhumn1PzxmkboF22sb=9wWut$NWsvciBSpJwT!F`%uS5^3_x)%rY1&4hLue6whmcW zLxa2jn!RgE)e}vO>)gNNh3kad?>fYSE`M|maGxd=nbMy9SNnn6&*FV|&rfK`77Q9{jMpRO6g)xWwK~|@ge|-*bxqp{U-d7;d zA-!0b-{D7YqiQ_Y#^7THb)uGQen!2kpEPe7YxHyB>8)FpC*8cF!giHYwX>A{?lP%< zdrrxHYg2VnUQeBU=bvMo__A9$(V1tMc8TbSsm$@ZbN0gbp!DL8x(k&5)_pNNrCV^S zlbhwX-ZKA!ym{yLMsz+3j+~blH7WH`hds{}$;Ee{zL+~z_^syc)dfO#qE2OtuMTPo z*~rAq$iTQb*dP!bXR^YKjQ?3!4VZzHfh;gkW%*ddSVZJYuGwoIEGcodW);%0U9s0W zl4+TNJV;uZMZ!R=L1atRlck&QT?+cP^Xjsx{IBiy9RK?tIoN@T1Q_g$3{7`gCoktV zvX%^T&73sl!waW84L%$B6Y~O94xjCk;!O(J5N7`1k<3M}cw^4ezE~~6qtOeV$EZ{< zxZwJxE^m5JNauu~&kAqXn|FxZ|8jNW6@!(#Umr4?=lv-9ir;-7j#)cS?E3v$Km516 z)o*m>7B z?b33M3UC0Gj`s7 zoNStU!O)ebaCeSDmCDPYXYc)6cO7!vv-icufOD1ts}1cmpKE)a`nu<}jg98KOYAMK GGM)e>#6WKV literal 0 HcmV?d00001 diff --git a/tests/suites/test_suite_x509write.function b/tests/suites/test_suite_x509write.function index 6136a7923..90de6a576 100644 --- a/tests/suites/test_suite_x509write.function +++ b/tests/suites/test_suite_x509write.function @@ -277,6 +277,7 @@ void x509_crt_check( char *subject_key_file, char *subject_pwd, if( crt.version >= MBEDTLS_X509_CRT_VERSION_3 ) { + /* For the CA case, a path length of -1 means unlimited. */ TEST_ASSERT( mbedtls_x509write_crt_set_basic_constraints( &crt, is_ca, (is_ca ? -1 : 0) ) == 0 ); TEST_ASSERT( mbedtls_x509write_crt_set_subject_key_identifier( &crt ) == 0 );