From 5ff986cb0a51c90dfab16b2e57f9466c9f58b8d4 Mon Sep 17 00:00:00 2001 From: Przemek Stekiel Date: Thu, 6 Apr 2023 09:22:20 +0200 Subject: [PATCH] Provide makefile rules to generate cerst for authorityKeyId, subjectKeyId tests Signed-off-by: Przemek Stekiel --- tests/data_files/Makefile | 21 ++++++++++++++++++ .../authorityKeyId_subjectKeyId.conf | 11 +++++++++ .../authorityKeyId_subjectKeyId.crt.der | Bin 0 -> 536 bytes ...subjectKeyId_issuer_tag1_malformed.crt.der | Bin 0 -> 536 bytes ...subjectKeyId_issuer_tag2_malformed.crt.der | Bin 0 -> 536 bytes ...d_subjectKeyId_keyid_tag_malformed.crt.der | Bin 0 -> 536 bytes ...eyId_subjectKeyId_length_malformed.crt.der | Bin 0 -> 536 bytes ...ubjectKeyId_sequence_tag_malformed.crt.der | Bin 0 -> 536 bytes ...tyKeyId_subjectKeyId_tag_malformed.crt.der | Bin 0 -> 536 bytes 9 files changed, 32 insertions(+) create mode 100644 tests/data_files/authorityKeyId_subjectKeyId.conf create mode 100644 tests/data_files/authorityKeyId_subjectKeyId.crt.der create mode 100644 tests/data_files/authorityKeyId_subjectKeyId_issuer_tag1_malformed.crt.der create mode 100644 tests/data_files/authorityKeyId_subjectKeyId_issuer_tag2_malformed.crt.der create mode 100644 tests/data_files/authorityKeyId_subjectKeyId_keyid_tag_malformed.crt.der create mode 100644 tests/data_files/authorityKeyId_subjectKeyId_length_malformed.crt.der create mode 100644 tests/data_files/authorityKeyId_subjectKeyId_sequence_tag_malformed.crt.der create mode 100644 tests/data_files/authorityKeyId_subjectKeyId_tag_malformed.crt.der diff --git a/tests/data_files/Makefile b/tests/data_files/Makefile index ea8e0c96a..702aefb6d 100644 --- a/tests/data_files/Makefile +++ b/tests/data_files/Makefile @@ -550,6 +550,27 @@ crl_cat_rsa-ec.pem:crl.pem crl-ec-sha256.pem all_final += crl_cat_ec-rsa.pem crl_cat_rsa-ec.pem +authorityKeyId_subjectKeyId.crt.der: + $(OPENSSL) req -x509 -nodes -days 7300 -key server5.key -outform DER -out authorityKeyId_subjectKeyId.crt.der -config authorityKeyId_subjectKeyId.conf -extensions 'v3_req' + +authorityKeyId_subjectKeyId_tag_malformed.crt.der: authorityKeyId_subjectKeyId.crt.der + hexdump -ve '1/1 "%.2X"' $< | sed "s/04145061A58FD407D9D782010CE5657F8C6346A713BE/01145061A58FD407D9D782010CE5657F8C6346A713BE/" | xxd -r -p > $@ + +authorityKeyId_subjectKeyId_length_malformed.crt.der: authorityKeyId_subjectKeyId.crt.der + hexdump -ve '1/1 "%.2X"' $< | sed "s/306D80145061A58FD407/306C80145061A58FD407/" | xxd -r -p > $@ + +authorityKeyId_subjectKeyId_sequence_tag_malformed.crt.der: authorityKeyId_subjectKeyId.crt.der + hexdump -ve '1/1 "%.2X"' $< | sed "s/6F306D80145061A58FD4/6F006D80145061A58FD4/" | xxd -r -p > $@ + +authorityKeyId_subjectKeyId_keyid_tag_malformed.crt.der: authorityKeyId_subjectKeyId.crt.der + hexdump -ve '1/1 "%.2X"' $< | sed "s/306D80145061A58FD407/306D00145061A58FD407/" | xxd -r -p > $@ + +authorityKeyId_subjectKeyId_issuer_tag1_malformed.crt.der: authorityKeyId_subjectKeyId.crt.der + hexdump -ve '1/1 "%.2X"' $< | sed "s/A13FA43D303B310B3009/003FA43D303B310B3009/" | xxd -r -p > $@ + +authorityKeyId_subjectKeyId_issuer_tag2_malformed.crt.der: authorityKeyId_subjectKeyId.crt.der + hexdump -ve '1/1 "%.2X"' $< | sed "s/A43D303B310B30090603/003D303B310B30090603/" | xxd -r -p > $@ + ################################################################ #### Generate various RSA keys ################################################################ diff --git a/tests/data_files/authorityKeyId_subjectKeyId.conf b/tests/data_files/authorityKeyId_subjectKeyId.conf new file mode 100644 index 000000000..208082d20 --- /dev/null +++ b/tests/data_files/authorityKeyId_subjectKeyId.conf @@ -0,0 +1,11 @@ +[req] +distinguished_name = req_distinguished_name +x509_extensions = v3_req +prompt = no +[req_distinguished_name] +countryName = NL +organizationalUnitName = PolarSSL +commonName = PolarSSL Test CA +[v3_req] +subjectKeyIdentifier = hash +authorityKeyIdentifier = keyid:always,issuer:always diff --git a/tests/data_files/authorityKeyId_subjectKeyId.crt.der b/tests/data_files/authorityKeyId_subjectKeyId.crt.der new file mode 100644 index 0000000000000000000000000000000000000000..dbbe51866b15d91efa225450b203d954d4d098d6 GIT binary patch literal 536 zcmXqLViGZEV%)ianTe5!NyIYY{k^b~d-By~Vl&V8#W49PObIgJV&l+i^EhYA!pvk~ zZOCoF$;KSY!Y0h*=VK^nzz^bZ^Kb;@=Oh*d2m2UG8i<30n0W+XLJA?N#U%>Pjs|k# zyhg?bCI)5(=7ts~hEd|YCLpdMluMc6kp{wS>|l2?F+v^8%*f8{#K2;HChTSzr(9H# z-SJ4>{|b5UYJRd!EV-~&Wb5|~rO2d7eoq;0C=337rGLpJHdbtJSI433a^BFhU0Qs< z7*A|@`+srcEQ7}B2C_hJ$?~y?v4{jDF73aPjs|k# zyhg?bCI)5(=7ts~hEd|YCLpdMluMc6kp{wS>|l2?F+v^8%*f8{#K2;HChTSzr(9H# z-SJ4>{|b5UYJRd!EV-~&Wb5|~rO2d7eoq;0C=337rGLpJHdbtJSI433a^BFhU0Qs< z7*A|@`+srcEQ7}B2C_hJ$?~y?v4{jDF73a_R1}mV?5qJEBlps(x&e| smEY8XN-j+9JE-{V+mamPjs|k# zyhg?bCI)5(=7ts~hEd|YCLpdMluMc6kp{wS>|l2?F+v^8%*f8{#K2;HChTSzr(9H# z-SJ4>{|b5UYJRd!EV-~&Wb5|~rO2d7eoq;0C=337rGLpJHdbtJSI433a^BFhU0Qs< z7*A|@`+srcEQ7}B2C_hJ$?~y?v4{jDF73a_R1}mV?5qJEBlps(x&e| smEY8XN-j+9JE-{V+mamPjs|k# zyhg?bCI)5(=7ts~hEd|YCLpdMluMc6kp{wS>|l2?F+v^8%*f8{#K2;HChTSzr(9H# z-SJ4>{|b5UYJRd!EV-~&Wb5|~rO2d7eoq;0C=337rGLpJHdbtJSI433a^BFhU0Qs< z7*A|@`+srcEQ7}B2C_hJ$?~y?v4{jDF73a%fS^xk5 literal 0 HcmV?d00001 diff --git a/tests/data_files/authorityKeyId_subjectKeyId_length_malformed.crt.der b/tests/data_files/authorityKeyId_subjectKeyId_length_malformed.crt.der new file mode 100644 index 0000000000000000000000000000000000000000..3f9e8709637e02b2a3a2288656955418a1c2f9b5 GIT binary patch literal 536 zcmXqLViGZEV%)ianTe5!NyIYY{k^b~d-By~Vl&V8#W49PObIgJV&l+i^EhYA!pvk~ zZOCoF$;KSY!Y0h*=VK^nzz^bZ^Kb;@=Oh*d2m2UG8i<30n0W+XLJA?N#U%>Pjs|k# zyhg?bCI)5(=7ts~hEd|YCLpdMluMc6kp{wS>|l2?F+v^8%*f8{#K2;HChTSzr(9H# z-SJ4>{|b5UYJRd!EV-~&Wb5|~rO2d7eoq;0C=337rGLpJHdbtJSI433a^BFhU0Qs< z7*A|@`+srcEQ7}B2C_hJ$?~y?v4{jDF73aPjs|k# zyhg?bCI)5(=7ts~hEd|YCLpdMluMc6kp{wS>|l2?F+v^8%*f8{#K2;HChTSzr(9H# z-SJ4>{|b5UYJRd!EV-~&Wb5|~rO2d7eoq;0C=337rGLpJHdbtJSI433a^BFhU0Qs< z7*A|@`+srcEQ7}B2C_hJ$?~y?v4{jDF73aPjs|k# zyhg?bCI)5(=7ts~hEd|YCLpdMluMc6kp{wS>|l2?F+v^8%*f8{#K2;HChTSzr(9H# z-SJ4>{|b5UYJRd!EV-~&Wb5|~rO2d7eoq;0C=337rGLpJHdbtJSI433a^BFhU0Qs< z7*A|@`+srcEQ7}B2C_hJ$?~y?F^U8vF73a