39dbe23845
Release memory for subject alt name in test
...
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com >
2023-04-04 17:48:28 +02:00
79354c3c4d
Use MBEDTLS_MD_CAN_SHA1 macro as test dependency
...
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com >
2023-04-04 17:48:28 +02:00
21903ec860
Fix after rebase
...
Handle manually functions that have been moved to different locations.
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com >
2023-04-04 17:48:28 +02:00
09720e2228
Remove redundant test cases
...
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com >
2023-04-04 17:48:28 +02:00
019842119d
Adapt test for authority_key_id (parsing subject alt name)
...
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com >
2023-04-04 17:48:28 +02:00
4f3e7b934e
Fix parsing of authorityCertIssuer
...
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com >
2023-04-04 17:48:28 +02:00
75653b1df0
Add indication of extension error while parsing authority/subject key id
...
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com >
2023-04-04 17:48:28 +02:00
6ec839a1f9
x509_get_authority_key_id: add length check + test
...
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com >
2023-04-04 17:48:28 +02:00
8661fed943
Fix tests dependencies
...
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com >
2023-04-04 17:48:28 +02:00
3520fe6fda
Use MBEDTLS_ERROR_ADD() and tag macros
...
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com >
2023-04-04 17:48:28 +02:00
8a13866f65
Remove parsing of rfc822Name
...
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com >
2023-04-04 17:48:28 +02:00
a2939e8728
Remove duplicated function
...
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com >
2023-04-04 17:48:28 +02:00
240cbe4040
Remove generation of authorityKeyId_subjectKeyId.crt from makefile
...
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com >
2023-04-04 17:48:28 +02:00
9a511c5bdf
Rename back mbedtls_x509_parse_general_name->mbedtls_x509_parse_subject_alt_name
...
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com >
2023-04-04 17:48:28 +02:00
db323aa241
Fix Subject Key Identifier, Authority Key Identifier entries in oid_x509_ext
...
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com >
2023-04-04 17:48:28 +02:00
62d8f84be2
Adapt mbedtls_x509_crt_free after rebase
...
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com >
2023-04-04 17:48:28 +02:00
9232e0ad84
Adding some comments for easier understand
...
Signed-off-by: toth92g <toth92g@gmail.com >
2023-04-04 17:48:28 +02:00
9085cff438
Removing obsolete test after merging and correcting missing macro
...
Signed-off-by: toth92g <toth92g@gmail.com >
2023-04-04 17:48:28 +02:00
8d435a0c8b
Renaming x509_get_subject_alt_name to x509_get_general_names and mbedtls_x509_parse_subject_alt_name to mbedtls_x509_parse_general_name so they can be used not only to collect subject alt name, but the V3 authority cert issuer that is also GeneralName type.
...
Also updated the x509_get_general_names function to be able to parse rfc822Names
Test are also updated according these changes.
Signed-off-by: toth92g <toth92g@gmail.com >
2023-04-04 17:48:28 +02:00
5042b104c2
- Removing obsolete test files (DER strings are used instead of them to minimize resource usage)
...
- Renaming test functions to match the naming conventions
Signed-off-by: toth92g <toth92g@gmail.com >
2023-04-04 17:48:28 +02:00
357b297b16
Correcting tests:
...
- Wrong condition was checked (ref_ret != 0 instead of ref_ret == 0)
- tags were not checked (nor lengths)
- Using ASSERT_COMPARE where possible
Signed-off-by: toth92g <toth92g@gmail.com >
2023-04-04 17:48:27 +02:00
2d2fb3a5a7
Correting findings: Using DER format instead of PEM while testing to minimize the resource usage. Comparation of byte arrays in test are now done via the dedicated ASSERT_COMPARE test macro for better understanding
...
Signed-off-by: toth92g <toth92g@gmail.com >
2023-04-04 17:48:27 +02:00
d96027acd2
Correcting documentation issues:
...
- Changelog entry is Feature instead of API Change
- Correcting whitespaces around braces
- Also adding defensive mechanism to x509_get_subject_key_id
to avoid malfunction in case of trailing garbage
Signed-off-by: toth92g <toth92g@gmail.com >
2023-04-04 17:48:27 +02:00
0e2e2d6841
x509parse tests used only last 16 bits of the return values. They are updated to check the whole 32 bit value
...
Signed-off-by: toth92g <toth92g@gmail.com >
2023-04-04 17:48:27 +02:00
3c2243c6d5
Replacing hard-coded literals with macros of the library in the new x509parse tests
...
Signed-off-by: toth92g <toth92g@gmail.com >
2023-04-04 17:48:27 +02:00
27f9e7815c
Adding openssl configuration file and command to Makefile to be able to reproduce the certificate for testing Authority and Subject Key Id fields
...
Increasing heap memory size of SSL_Client2 and SSL_Server2, because the original value is not enough to handle some certificates. The AuthorityKeyId and SubjectKeyId are also parsed now increasing the size of some certificates
Signed-off-by: toth92g <toth92g@gmail.com >
2023-04-04 17:48:27 +02:00
a41954d0cf
Extracting SubjectKeyId and AuthorityKeyId in case of x509 V3 extensions. Updating mbedtls_x509_crt_free function to also free the new dynamic elements (issuer field of AuthorityKeyId).
...
A few tests are also added which test the feature with a correct certificate and multiple ones with erroneous ASN1 tags.
Signed-off-by: toth92g <toth92g@gmail.com >
2023-04-04 17:48:27 +02:00
56f59d749c
Merge pull request #7394 from mprse/fix_pkcs7_test_alloc
...
Fix memory allocations in pkcs7_verify test
2023-04-04 15:46:59 +01:00
1b75e5f784
Add missing md.h includes
...
MBEDTLS_MD_CAN_SHAXXX are defined there.
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com >
2023-04-04 09:55:06 -04:00
13c73de6de
Merge pull request #6233 from tom-cosgrove-arm/issue-6226-core-mul
...
Bignum: extract core_mul from the prototype
2023-04-04 13:36:22 +01:00
219f978097
Merge pull request #7059 from ronald-cron-arm/psa-crypto-misc
...
PSA cryptography miscellaneous
2023-04-04 10:54:03 +02:00
98680fc2ed
ecp: revert changes to ECP module and test suite
...
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no >
2023-04-04 10:22:59 +02:00
8eb552647f
pk_wrap: fix sizing for private key buffer
...
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no >
2023-04-04 10:20:53 +02:00
9735be5ef3
Fix memory allocations in pkcs7_verify test
...
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com >
2023-04-04 09:07:10 +02:00
d62605126d
Fix documentation
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com >
2023-04-03 17:32:55 +02:00
b0f013784f
Multplication is simmetric so only generate unique combinations
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com >
2023-04-03 17:26:44 +02:00
86d5d4bf31
Merge pull request #7103 from valeriosetti/issue6622
...
Some MAX_SIZE macros are too small when PSA ECC is accelerated
2023-04-03 16:23:27 +02:00
f3dc4a1a21
fixed guard position for doxygen
...
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no >
2023-04-03 15:37:53 +02:00
0fe1ee27e5
pk: add an alternative function for checking private/public key pairs
...
Instead of using the legacy mbedtls_ecp_check_pub_priv() function which
was based on ECP math, we add a new option named eckey_check_pair_psa()
which takes advantage of PSA.
Of course, this is available when MBEDTLS_USE_PSA_CRYPTO in enabled.
Tests were also fixed accordingly.
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no >
2023-04-03 15:00:21 +02:00
f8b55d6358
Fix code style issues
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com >
2023-04-03 14:13:46 +02:00
3a3a756431
adding missing newline at the end of changelog file
...
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no >
2023-04-03 10:55:29 +02:00
384e84849d
Update BRANCHES.md
...
Co-authored-by: Dave Rodgman <dave.rodgman@arm.com >
Signed-off-by: Janos Follath <janos.follath@arm.com >
2023-04-03 09:46:33 +01:00
0a7ff791a6
add Changelog
...
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no >
2023-04-03 09:18:41 +02:00
c6ecdad42d
test: disable all RSA algs and fix tests
...
All RSA associated algs are now forcedly disabled both on library
and driver sides.
Some PSA driver tests required to be fixed because they were just
requiring for not having the built-in version, but they didn't check
if the driver one was present (kind of assuming that RSA was always
supported on the driver side).
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no >
2023-04-03 08:26:35 +02:00
dd48c6e3df
Merge pull request #7385 from daverodgman/timing_alignment
...
Fix cast alignment warning in timing.c
2023-03-31 19:48:34 +01:00
d43b42ebfa
Whitespace fix
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com >
2023-03-31 18:04:34 +01:00
4ffc9d80f7
Test that setting reset actually does something
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com >
2023-03-31 17:07:26 +01:00
33b2210065
Fix cast alignment warning in timing.c
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com >
2023-03-31 15:50:54 +01:00
6f182c33a8
Fix documentation
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com >
2023-03-31 16:17:06 +02:00
87223ab1ce
Add generated test for core_mul
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com >
2023-03-31 16:17:06 +02:00