aboutsummaryrefslogtreecommitdiff
path: root/tests/data_files
AgeCommit message (Collapse)AuthorFilesLines
2023-01-24Generate csr files to test v3 extensionsPrzemek Stekiel6-0/+66
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com>
2022-11-29Merge pull request #6663 from davidhorstmann-arm/fix-typo-unsupportedGilles Peskine2-2/+2
Fix typo 'unsupoported' -> 'unsupported'
2022-11-27Fix memory leak on error in pkcs7_get_signers_info_setGilles Peskine1-0/+0
mbedtls_x509_name allocates memory, which must be freed if there is a subsequent error. Credit to OSS-Fuzz (https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=53811). Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-11-27Fix dangling freed pointer on error in pkcs7_get_signers_info_setGilles Peskine1-0/+0
This fixes a use-after-free in PKCS#7 parsing when the signer data is malformed. Credit to OSS-Fuzz (https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=53798). Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-11-25Fix typo 'unsupoported' -> 'unsupported'David Horstmann2-2/+2
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-11-22Merge branch 'development' into pr3431Bence Szépkúti2-0/+22
2022-11-15Merge pull request #6454 from valeriosetti/issue4577Manuel Pégourié-Gonnard2-0/+22
Adding unit test for mbedtls_x509write_csr_set_extension()
2022-11-14Adding unit test for mbedtls_x509write_csr_set_extension()Valerio Setti2-0/+22
The already existing "x509_csr_check()" function is extended in order to support/test also CSR's extensions. The test is performed by adding an extended key usage. Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2022-11-10Merge remote-tracking branch 'origin/development' into pr3431Dave Rodgman13-0/+64
2022-11-08Merge pull request #6265 from Kabbah/x509-info-hwmodulename-hexGilles Peskine3-0/+22
`x509_info_subject_alt_name`: Render HardwareModuleName as hex
2022-11-03test/pkcs7: Add Windows CRLF EOF to data filesNick Child16-2/+10
Windows tests are failing pkcs7 verification due to differnt line endings. Therefore, add make instuctions for building the data files with Windows EOF instead. As a result, regenerate other data files so that verification works. Add these CRLF EOF files to the exception in check_files to ignore the line endings. Signed-off-by: Nick Child <nick.child@ibm.com>
2022-10-31Merge pull request #6121 from daverodgman/pr277Dave Rodgman2-0/+41
cert_write - add a way to set extended key usages - rebase
2022-10-28pkcs7: Improve verify logic and rebuild test dataNick Child21-168/+168
Various responses to feedback regarding the pkcs7_verify_signed_data/hash functions. Mainly, merge these two functions into one to reduce redudant logic [1]. As a result, an identified bug about skipping over a signer is patched [2]. Additionally, add a conditional in the verify logic that checks if the given x509 validity period is expired [3]. During testing of this conditional, it turned out that all of the testing data was expired. So, rebuild all of the pkcs7 testing data to refresh timestamps. [1] https://github.com/Mbed-TLS/mbedtls/pull/3431#discussion_r999652525 [2] https://github.com/Mbed-TLS/mbedtls/pull/3431#discussion_r997090215 [3] https://github.com/Mbed-TLS/mbedtls/pull/3431#discussion_r967238206 Signed-off-by: Nick Child <nick.child@ibm.com>
2022-10-26Merge pull request #6410 from gilles-peskine-arm/psa-pkparse-pkwrite-3.2Ronald Cron1-0/+0
PSA with RSA requires PK_WRITE and PK_PARSE
2022-10-13Rename LMS private key files to match library nameRaef Coles3-0/+0
Signed-off-by: Raef Coles <raef.coles@arm.com>
2022-10-13Rename LMS private key filesRaef Coles6-0/+0
And remove now-unnecessary modification to check_files.py Signed-off-by: Raef Coles <raef.coles@arm.com>
2022-10-13Add LMS hsslms interop testsRaef Coles1-0/+0
Signed-off-by: Raef Coles <raef.coles@arm.com>
2022-10-13Add repro instructions for LMS test dataRaef Coles5-0/+0
Add more interop tests, and use real data for the negative tests Signed-off-by: Raef Coles <raef.coles@arm.com>
2022-10-11Add mbedtls_dhm_parse_dhmfile test case with DER inputGilles Peskine1-0/+0
dh.optlen.der is the result of converting dh.optlen.pem from PEM to DER. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-09-29Add a new test with a binary hwSerialNumVictor Barpp Gomes3-0/+22
Signed-off-by: Victor Barpp Gomes <17840319+Kabbah@users.noreply.github.com>
2022-09-23Finalize client side code for pskXiaokangQian1-0/+1
Signed-off-by: XiaokangQian <xiaokang.qian@arm.com>
2022-09-01pkcs7: Fix dependencies for pkcs7 testsNick Child3-0/+9
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 <nick.child@ibm.com>
2022-09-01Avoid unwanted eol conversion of test dataManuel Pégourié-Gonnard3-20/+8
Also, text files don't need to be generated by the Makefile. Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2022-09-01mbedtls: add pkcs7 test dataNayna Jain21-0/+194
This commit adds the static test data generated by commands from Makefile. Signed-off-by: Nayna Jain <nayna@linux.ibm.com>
2022-09-01pkcs7: add support for signed dataNayna Jain1-0/+5
OpenSSL provides APIs to generate only the signted data format PKCS7 i.e. without content type OID. This patch adds support to parse the data correctly even if formatted only as signed data Signed-off-by: Nayna Jain <nayna@linux.ibm.com>
2022-09-01mbedtls: add support for pkcs7Nayna Jain1-0/+92
PKCS7 signing format is used by OpenPOWER Key Management, which is using mbedtls as its crypto library. This patch adds the limited support of pkcs7 parser and verification to the mbedtls. The limitations are: * Only signed data is supported. * CRLs are not currently handled. * Single signer is supported. Signed-off-by: Daniel Axtens <dja@axtens.net> Signed-off-by: Eric Richter <erichte@linux.ibm.com> Signed-off-by: Nayna Jain <nayna@linux.ibm.com>
2022-08-30Fix test fails due to changes in cert generationDave Rodgman2-17/+17
Test certs were originally generated with an old version of Mbed TLS that used printableString where we now use utf8string (e.g., in the organizationName). Otherwise the certs are identical. Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-08-30Add test for mbedtls_x509write_crt_set_ext_key_usage, and fix reversed orderNicholas Wilson2-0/+41
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-08-01Remove remaining bignum radix argsWerner Lewis2-1/+1
Functions which are not covered by script, changes made to use radix 16. Signed-off-by: Werner Lewis <werner.lewis@arm.com>
2022-06-27Fix parsing of special chars in X509 DN valuesWerner Lewis3-1/+43
Use escape mechanism defined in RFC 1779 when parsing commas and other special characters in X509 DN values. Resolves failures when generating a certificate with a CSR containing a comma in subject value. Fixes #769. Signed-off-by: Werner Lewis <werner.lewis@arm.com>
2022-05-11Redo of PR#5345. Fixed spelling and typographical errors found by CodeSpell.Shaun Case2-3/+3
Signed-off-by: Shaun Case <warmsocks@gmail.com> Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2021-12-10tests: data_files: Avoid symbolic linksRonald Cron4-6/+21
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2021-12-06rename ecdsa_secp*sha* to ecdsa_secp*Jerry Yu10-53/+54
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2021-12-06Add keys for tls13 compat testsJerry Yu7-0/+73
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2021-06-21Removal of RC4 certs and fixes to docs and testsTRodziewicz6-99/+0
Signed-off-by: TRodziewicz <tomasz.rodziewicz@mobica.com>
2021-06-18Code review fixesTRodziewicz1-4/+6
Reverting some deleted tests and changing the deprecated algo Deleting deprecated headers from /alt-dummy dir Corrections to the comments Removal of deleted functions from compat-2.x.h Corrections to tests/data_files/Makefile Signed-off-by: TRodziewicz <tomasz.rodziewicz@mobica.com>
2021-06-16Remove MD2, MD4, RC4, Blowfish and XTEATRodziewicz8-157/+1
Signed-off-by: TRodziewicz <tomasz.rodziewicz@mobica.com>
2021-04-01More precise testing of dhm_min_lenGilles Peskine3-0/+44
An SSL client can be configured to insist on a minimum size for the Diffie-Hellman (DHM) parameters sent by the server. Add several test cases where the server sends parameters with exactly the minimum size (must be accepted) or parameters that are one bit too short (must be rejected). Make sure that there are test cases both where the boundary is byte-aligned and where it isn't. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-01-17Merge pull request #3698 from darrenkrahn/developmentDave Rodgman4-0/+47
Mark basic constraints critical as appropriate.
2021-01-13Add build instructions for new test data.Darren Krahn2-0/+8
Signed-off-by: Darren Krahn <dkrahn@google.com>
2020-12-03Merge pull request #773 from paul-elliott-arm/discrepancy_certGilles Peskine2-1/+5
Add missing tag check to signature check on certificate load
2020-11-26Add tag check to cert algorithm checkPaul Elliott2-1/+5
Add missing tag check for algorithm parameters when comparing the signature in the description part of the cert against the actual signature whilst loading a certificate. This was found by a certificate (created by fuzzing) that openssl would not verify, but mbedtls would. Regression test added (one of the client certs modified accordingly) Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2020-10-20Add a context-info.sh test for 0xFF charsDavid Brown1-0/+5
Add a non-regression test for ssl_context_info to ensure the base64 decoder doesn't stop processing when it encounters a 0xFF character. Signed-off-by: David Brown <david.brown@linaro.org>
2020-10-15Merge pull request #3595 from ↵Ronald Cron4-2/+52
gilles-peskine-arm/cert-gen-cleanup-202008-development Minor cleanups in certificate generation
2020-09-24Fix "make -C tests/data_files -f ..."Gilles Peskine1-1/+1
The toplevel directory is actually just ../..: the makefile commands are executed in the subdirectory. $(PWD) earlier was wrong because it comes from the shell, not from make. Looking up $(MAKEFILE_LIST) is wrong because it indicates where the makefile is (make -f), not which directory to work in (make -C). Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-09-21Mark basic constraints critical as appropriate.Darren Krahn2-0/+39
Per RFC 5280 4.2.1.9 if the 'cA' field is set to true, the extension must be marked critical. Signed-off-by: Darren Krahn <dkrahn@google.com>
2020-08-26Merge pull request #3433 from raoulstrackx/raoul/verify_crl_without_timeGilles Peskine5-2/+36
Always revoke certificate on CRL
2020-08-24Merge pull request #2182 from hanno-arm/key_pwdManuel Pégourié-Gonnard3-0/+50
Add support for password protected key files to ssl_server2 and ssl_client2
2020-08-21Commit the intermediate files cert_md*.csrGilles Peskine3-0/+48
They are used to generate cert_md*.crt. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2020-08-21Fix "make -C tests/data_files"Gilles Peskine1-2/+4
It wasn't working when invoking programs/x509/cert_write or programs/x509/cert_req due to relying on the current directory rather than the location of the makefile. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>