From 0b683a9a57785de66a3f052fef608bc6b82dde17 Mon Sep 17 00:00:00 2001 From: Przemek Stekiel Date: Wed, 24 May 2023 16:06:30 +0200 Subject: [PATCH] Remove redundant test and add tests: keyid only (without issuer) Signed-off-by: Przemek Stekiel --- tests/data_files/Makefile | 6 +++--- tests/data_files/authorityKeyId_empty.crt.der | Bin 809 -> 0 bytes tests/data_files/authorityKeyId_no_issuer.crt.der | Bin 0 -> 842 bytes tests/data_files/authorityKeyId_subjectKeyId.conf | 5 +++-- tests/suites/test_suite_x509parse.data | 8 ++++---- 5 files changed, 10 insertions(+), 9 deletions(-) delete mode 100644 tests/data_files/authorityKeyId_empty.crt.der create mode 100644 tests/data_files/authorityKeyId_no_issuer.crt.der diff --git a/tests/data_files/Makefile b/tests/data_files/Makefile index 8ec84c1049..f8144319f0 100644 --- a/tests/data_files/Makefile +++ b/tests/data_files/Makefile @@ -556,12 +556,12 @@ authorityKeyId_subjectKeyId.crt.der: authorityKeyId_no_keyid.crt.der: $(OPENSSL) req -x509 -nodes -days 7300 -key server2.key -outform DER -out $@ -config authorityKeyId_subjectKeyId.conf -extensions 'v3_req_authorityKeyId_no_keyid' +authorityKeyId_no_issuer.crt.der: + $(OPENSSL) req -x509 -nodes -days 7300 -key server2.key -outform DER -out $@ -config authorityKeyId_subjectKeyId.conf -extensions 'v3_req_authorityKeyId_no_issuer' + authorityKeyId_no_authorityKeyId.crt.der: $(OPENSSL) req -x509 -nodes -days 7300 -key server2.key -outform DER -out $@ -config authorityKeyId_subjectKeyId.conf -extensions 'v3_req_no_authorityKeyId' -authorityKeyId_empty.crt.der: - $(OPENSSL) req -x509 -nodes -days 7300 -key server2.key -outform DER -out $@ -config authorityKeyId_subjectKeyId.conf -extensions 'v3_req_authorityKeyId_empty' - authorityKeyId_subjectKeyId_tag_malformed.crt.der: authorityKeyId_subjectKeyId.crt.der hexdump -ve '1/1 "%.2X"' $< | sed "s/0414A505E864B8DCDF600F50124D60A864AF4D8B4393/0114A505E864B8DCDF600F50124D60A864AF4D8B4393/" | xxd -r -p > $@ diff --git a/tests/data_files/authorityKeyId_empty.crt.der b/tests/data_files/authorityKeyId_empty.crt.der deleted file mode 100644 index e4a208661045ff15c87f970685a73490c6419f8a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 809 zcmXqLVpcV1V&YxE%*4pVBqDygN!xXq-3hm^E06TOFI)6#QhbB~FB_*;n@8JsUPeZ4 zRt5uWLv903Hs(+kHen_|A45R{eh`P7ha(_AC$T6v*vC-PKpZ5*%p(93QV2;cE>UoH zG>{YLH8M6ZHLx%=G&D0XiW28F0db9?T*?e@VpKwQEF&uea}y&!gFzD`7gG}>Bf~-8 z#dn{dmA%Mv-Lq)N%r$%!PpoXb&RYqKU5I*eb}>W8@^^CC)0PKqnebk>sLD=d)}L)A zYgE3LKTu2QnX^HocHym8JGkLZ$On7*!Ng%CuU5IvfYURX*j}i}`b@1eP zm%;O~yX}(O{tG)+2{Oyohpmv3bCKZZZ|%O-?GpD$;#iXY@wDDwu{UZzt9NQL9-Y8v zul~{CgcslYYxj;HSI<7qYFl-L$!3Z@2Sg5_+R&W4*o2AO#)>tf13t$okbxG?zi zTLUv2pT=v?1b>#lcM?y`{q}#og6i$F%zUT!RLLz@X*@K=A>zK}fblu(TNZZ*jyDN-O U#DuQDwZ8f3=GnUq7INPO0BpBHZ2$lO diff --git a/tests/data_files/authorityKeyId_no_issuer.crt.der b/tests/data_files/authorityKeyId_no_issuer.crt.der new file mode 100644 index 0000000000000000000000000000000000000000..175ee3f303e9902b474aa4f5b00e27ab17acbe94 GIT binary patch literal 842 zcmXqLVs3A58`n1a0KM%Bo+k+`xr_Zh=YWfc?4iW3L&Y*B?``t z26E!OM#cuFMka>FCT51_QR2KNK(3)BluMc6O^iy&j%8$JU~XdMXE11Dpu?ta8&Ms!?SpH5fd)o4#Efe1B7FF4)%=)v< zWR1$#@&{@uJ##i_)GoaBs^{5BnQ43e9b^gGY<6YwuZJ7UZcI3sxFs#fY>`^A!Mb-Ax4AgOw5c7jEkKN91LWE@gvK}BE}-Jl=Vf*jyv}g_ydG|6IP_G_w9C`Y#&g53 zfAK%-WfB(Kcya6E<&)km6Og(0@0Oaqe}s5JFKgaDnM~2FyR&_z0$ZE6-BFnJyKJBF zq0oi4o4wczBpz!Gr_xUYyUB3>LZ)eW@v-14Yw5 ee0P!9&|39-UxDh1mU#^~SL|xM{>9T~dkX-^Oh`EZ literal 0 HcmV?d00001 diff --git a/tests/data_files/authorityKeyId_subjectKeyId.conf b/tests/data_files/authorityKeyId_subjectKeyId.conf index 94ab20e15b..296fac8630 100644 --- a/tests/data_files/authorityKeyId_subjectKeyId.conf +++ b/tests/data_files/authorityKeyId_subjectKeyId.conf @@ -12,7 +12,8 @@ authorityKeyIdentifier = keyid:always,issuer:always [v3_req_authorityKeyId_no_keyid] subjectKeyIdentifier = hash authorityKeyIdentifier = issuer:always +[v3_req_authorityKeyId_no_issuer] +subjectKeyIdentifier = hash +authorityKeyIdentifier = keyid:always [v3_req_no_authorityKeyId] subjectKeyIdentifier = hash -[v3_req_authorityKeyId_empty] -subjectKeyIdentifier = hash diff --git a/tests/suites/test_suite_x509parse.data b/tests/suites/test_suite_x509parse.data index 51b92dadc5..b49824be84 100644 --- a/tests/suites/test_suite_x509parse.data +++ b/tests/suites/test_suite_x509parse.data @@ -3321,14 +3321,14 @@ X509 CRT parse Authority Key Id - Correct Authority Key ID (no keyid) depends_on:MBEDTLS_MD_CAN_SHA256:MBEDTLS_RSA_C x509_crt_parse_authoritykeyid:"data_files/authorityKeyId_no_keyid.crt.der":"":"NL/PolarSSL/PolarSSL Test CA/":"7581F2D168FE33F964F0AE5FE884FAD3C55F24DA":0 +X509 CRT parse Authority Key Id - Correct Authority Key ID (no issuer) +depends_on:MBEDTLS_MD_CAN_SHA256:MBEDTLS_RSA_C +x509_crt_parse_authoritykeyid:"data_files/authorityKeyId_no_issuer.crt.der":"A505E864B8DCDF600F50124D60A864AF4D8B4393":"":"":0 + X509 CRT parse Authority Key Id - no Authority Key ID depends_on:MBEDTLS_MD_CAN_SHA256:MBEDTLS_RSA_C x509_crt_parse_authoritykeyid:"data_files/authorityKeyId_no_authorityKeyId.crt.der":"":"":"":0 -X509 CRT parse Authority Key Id - Correct Authority Key ID (empty) -depends_on:MBEDTLS_MD_CAN_SHA256:MBEDTLS_RSA_C -x509_crt_parse_authoritykeyid:"data_files/authorityKeyId_empty.crt.der":"":"":"":0 - X509 CRT parse Authority Key Id - Wrong Length depends_on:MBEDTLS_MD_CAN_SHA256:MBEDTLS_RSA_C x509_crt_parse_authoritykeyid:"data_files/authorityKeyId_subjectKeyId_length_malformed.crt.der":"":"":"":MBEDTLS_ERR_X509_INVALID_EXTENSIONS+MBEDTLS_ERR_ASN1_LENGTH_MISMATCH