From 45525d37688e8b3d9918ca8b59591a3604a9c6db Mon Sep 17 00:00:00 2001 From: Nick Child Date: Fri, 25 Feb 2022 11:54:34 -0600 Subject: [PATCH] pkcs7: Fix dependencies for pkcs7 tests Fixes include removing PEM dependency for greater coverage when PEM config is not set and defining test dependencies at the appropriate level. Signed-off-by: Nick Child --- tests/data_files/Makefile | 9 +++++++ tests/data_files/pkcs7-rsa-sha256-1.der | Bin 0 -> 845 bytes tests/data_files/pkcs7-rsa-sha256-2.der | Bin 0 -> 845 bytes tests/suites/test_suite_pkcs7.data | 33 +++++++++++++++++------- tests/suites/test_suite_pkcs7.function | 26 +++++++++---------- 5 files changed, 46 insertions(+), 22 deletions(-) create mode 100644 tests/data_files/pkcs7-rsa-sha256-1.der create mode 100644 tests/data_files/pkcs7-rsa-sha256-2.der diff --git a/tests/data_files/Makefile b/tests/data_files/Makefile index 8c7520fe3..b92944ac2 100644 --- a/tests/data_files/Makefile +++ b/tests/data_files/Makefile @@ -1147,6 +1147,15 @@ pkcs7-rsa-sha256-2.crt: cat pkcs7-rsa-sha256-2.crt pkcs7-rsa-sha256-2.key > pkcs7-rsa-sha256-2.pem all_final += pkcs7-rsa-sha256-2.crt +# Convert signing certs to DER for testing PEM-free builds +pkcs7-rsa-sha256-1.der: $(pkcs7_test_cert_1) + $(OPENSSL) x509 -in pkcs7-rsa-sha256-1.crt -out $@ -outform DER +all_final += pkcs7-rsa-sha256-1.der + +pkcs7-rsa-sha256-2.der: $(pkcs7_test_cert_2) + $(OPENSSL) x509 -in pkcs7-rsa-sha256-2.crt -out $@ -outform DER +all_final += pkcs7-rsa-sha256-2.der + # pkcs7 signature file with CERT pkcs7_data_cert_signed_sha256.der: $(pkcs7_test_file) $(pkcs7_test_cert_1) $(OPENSSL) smime -sign -binary -in pkcs7_data.bin -out $@ -md sha256 -signer pkcs7-rsa-sha256-1.pem -noattr -outform DER -out $@ diff --git a/tests/data_files/pkcs7-rsa-sha256-1.der b/tests/data_files/pkcs7-rsa-sha256-1.der new file mode 100644 index 0000000000000000000000000000000000000000..622df1e7a38899b4da3a3601badd4fb36a333238 GIT binary patch literal 845 zcmXqLV)is>VlrI7%*4pVBw`>aSo3skbeK)@x~&Pb%e4X`66YH5vTwH$JbLRo$llQJx_~g5mBnX^&@X|JJO&8<>!io&TlW zro-4;JEAuDYNN)--fN5-t|xtF7Lu-iUAfBf+tqG=Gq2y%bU4?&2yXx6eQHw6U)8Xy zMM94^9|__wtI8HMSpHz6c;9>ZBQxahJUw~6p7V9_gHwxm=dr(=r|=`|)~hYe?{9~n zNI8DK*?g|R>foMoU7f$8_jc`!klwqvZN}gC$NN_I?cVFeaa`d?6Sv~mzc&pYvWW#Q z_EPiaEP0UA_93qFZdUsDuBFq=rzP>!^@jWn@%^y=*w-JjA6&lY8((<(?vdYxBiCjx zaAaa;WMEtzY!GN53yc(5J{B<+k=WS#3ojMliz!!~ar(=|l;3Jm<(vlcAZcY52?MbP z>hCTPm>zwz`M|_mN_W4RJ-=L~sV{Wl43ClijajNM!=@VlrI7%*4pVB;vW}r~J}88hi8BWNs3_WV?Uu`Gdy|c-c6$+C196^D;7W zvoaW%7;+nMvN4CUun9By`55vU@PIg6JgfoU&cWt}q6WesJ~Iywn6KcRT2!K7WFRNb zYh++(Xk=n&VrXD!83p7TB5}zywTV#)*?Ekt49rc8{0s(7j9g4jjEoHTbQwJM#213~Tme+zeW^Cn^8C z6LaszO_qWe4PI|NF7e`ke%*;W!>u8ypL1h3Obqg>Y!DE=wYef??!!=aiHYyN%D)a> z|9&kKGb01z;$VY716g3C$nvp>v4~tR+OThf|EhWoz7Kz&zhqYZ{U`LMfjmfBnMJ}t ztO2_MevkrTM#ldvtOm?L3OU$;sR9`6j0_7W9hH8e|1gug>20SSQ|G(#6Dx}qwf3bP zsi>&j$`Z1uOff%e=G$ZTDOV7Cf)zdRK7X zhL7Jw^C!MqY#6uU>4P)6o}I_9%Bb|jZ|dz?vwT(TvHS(=S6WZilkTY675Y`e>kH#v z?T&<#|6-@@Ph-)!aCKgL;ewDzO)1Cyr$x`K4xK2eb+j(4<;d1d!^h!1%>f(M`OAOu z$+EL3Zu$Ld*{iSOKZ4sgPc#*mJ0h@w_paFFNBWcAzZBVbKh#Ta>J3%?