Commit Graph

5760 Commits

Author SHA1 Message Date
Ron Eldor
7269fee0b6 Check return code of mbedtls_mpi_fill_random
Add MBEDTLS_MPI_CHK to check for error value of mbedtls_mpi_fill_random.
Reported and fix suggested by guidovranken in #740
2017-07-27 21:44:33 +01:00
Ron Eldor
3e19df5c95 Resource leak fix on windows platform
Fix a resource leak on windows platform, in mbedtls_x509_crt_parse_path,
in case a failure. when an error occurs, goto cleanup, and free the
resource, instead of returning error code immediately.
2017-07-27 21:44:33 +01:00
Ron Eldor
8ab0595538 Wrong preproccessor condition fix
Fix for issue #696
Change #if defined(MBEDTLS_THREADING_PTHREAD)
to #if defined(MBEDTLS_THREADING_C)
2017-07-27 21:44:33 +01:00
Ron Eldor
5a21fd62bf fix for issue 1118: check if iv is zero in gcm.
1) found by roberto in mbedtls forum
2) if iv_len is zero, return an error
3) add tests for invalid parameters
2017-07-27 21:44:33 +01:00
Ron Eldor
2a47be5012 Minor: Fix typos in program comments
Fix a couple of typos and writer's mistakes,
in some reference program applications
2017-07-27 21:44:33 +01:00
Andres Amaya Garcia
92fcfe2933 Add ChangeLog entry for config-no-entropy.h change 2017-07-27 21:44:32 +01:00
Andres Amaya Garcia
28f320e60e Enable MBEDTLS_AES_ROM_TABLES in config-no-entropy
Enable the MBEDTLS_AES_ROM_TABLES option in the
configs/config-no-entropy.h to place AES lookup tables in ROM. This
saves considerable RAM space, a resource that is very limited in small
devices that use this configuration.
2017-07-27 21:44:32 +01:00
Janos Follath
bfea4a7c02 Remove mutexes from ECP hardware acceleration
Protecting the ECP hardware acceleratior with mutexes is inconsistent with the
philosophy of the library. Pre-existing hardware accelerator interfaces
leave concurrency support to the underlying platform.

Fixes #863
2017-07-27 21:44:32 +01:00
Hanno Becker
b6479192d8 Improve documentation of PKCS1 decryption functions
Document the preconditions on the input and output buffers for
the PKCS1 decryption functions
- mbedtls_rsa_pkcs1_decrypt,
- mbedtls_rsa_rsaes_pkcs1_v15_decrypt
- mbedtls_rsa_rsaes_oaep_decrypt
2017-07-27 21:43:17 +01:00
Simon Butcher
ab0a8042f4 Fix merge errors in ChangeLog 2017-07-26 17:25:55 +01:00
Andres AG
642ea1f399 Prevent signed integer overflow in CSR parsing
Modify the function mbedtls_x509_csr_parse_der() so that it checks the
parsed CSR version integer before it increments the value. This prevents
a potential signed integer overflow, as these have undefined behaviour
in the C standard.
2017-07-26 17:19:59 +01:00
Andres AG
487b7a9efc Fix potential integer overflow parsing DER CRT
This patch prevents a potential signed integer overflow during the
certificate version verification checks.
2017-07-26 17:13:03 +01:00
Hanno Becker
3b1422e55e Check threshold for MBEDTLS_X509_MAX_INTERMEDIATE_CA in X509 tests
The X509 test suite assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA is below the
hardcoded threshold 20 used in the long certificate chain generating script
tests/data_files/dir-max/long.sh. This commit adds a compile-time check for
that.
2017-07-26 13:49:38 +01:00
Hanno Becker
e908c3de67 Improve Readme for long test certificate chains 2017-07-26 13:49:38 +01:00
Hanno Becker
a6bca9f19e Check value of MBEDTLS_X509_MAX_INTERMEDIATE_CA in ssl-opt.sh
Some tests in ssl-opt.sh assumes the value 8 for the maximal number
MBEDTLS_X509_MAX_INTERMEDIATE_CA of intermediate CA's. This commit adds a check
before conducting the respective tests.
2017-07-26 13:49:32 +01:00
Andres AG
eacc616a9c Add CRT DER tests with incorrect version 2017-07-26 12:13:13 +01:00
Andres AG
2a9fd0e5c7 Add CRL DER tests with incorrect version 2017-07-26 12:13:04 +01:00
Andres AG
ae7b1c4aed Add CSR DER tests with incorrect version 2017-07-26 12:12:53 +01:00
Andres AG
853c46c8d3 Fix potential integer overflow parsing DER CRL
This patch prevents a potential signed integer overflow during the
CRL version verification checks.
2017-07-26 12:07:26 +01:00
Hanno Becker
01a0e07e9d Correct indentation and labelling in ChangeLog 2017-07-26 11:49:40 +01:00
Ron Eldor
4d90d56dfe Move the git scripts to correct path
The git scripts were accidently put in `test` folder instead of `tests`.
Moved them to `tests` folder
2017-07-24 21:47:30 +01:00
Hanno Becker
47deec488f Move flag indicating presence of strong entropy to test code 2017-07-24 15:31:30 +01:00
Ron Eldor
ee16553d8e Update after @sbutcher-arm comments
1. Move the scripts to test/git-scripts folder
2. Support the script to run independant, not only with git
3. modify Readme accordingly
2017-07-24 14:26:31 +02:00
Ron Eldor
9508923e9a Fix slash direction for linux path
Update direction of the slash, for linux path, after @hanno-arm comments
2017-07-24 14:25:51 +02:00
Ron Eldor
84f986c0e0 Add note for the git_hoos README file
Add a note to the git_hooks README.md file, to state that currently
they only work on GNU platforms
2017-07-24 14:25:40 +02:00
Ron Eldor
fcb7491a49 Pre push hook script
Add git_hook folder, and pre-push script,
to be soft linked from .git/hooks/pre-push
2017-07-24 14:25:26 +02:00
Simon Butcher
3aa712dff7 Minor typo fixes in the github template files 2017-07-24 14:19:02 +02:00
Ron Eldor
779d9f6886 Update after Simon's comment
Update the comment with Simon's comments
2017-07-24 14:15:09 +02:00
Ron Eldor
b3136be542 github templates
Add templates for github, for templates to be used in new issues and new
PRs
2017-07-24 14:14:49 +02:00
Hanno Becker
c6deafc0d4 Omit RSA key generation test if no strong entropy is present
The RSA key generation test needs strong entropy to succeed. This commit captures the presence of a strong entropy
source in a preprocessor flag and only runs the key generation test if that flag is set.
2017-07-24 09:09:01 +01:00
Simon Butcher
51aaa99473 Fixes test for MBEDTLS_NO_UDBL_DIVISION
The test for MBEDTLS_NO_UDBL_DIVISION wasn't preserving it's own config.h
for the next test.

Also added comments to ARM Compiler 6 tests to better explain them.
2017-07-23 13:42:36 +02:00
Hanno Becker
f058f34b5a Support negative dependencies in test cases
The entropy test suite uses a negative dependency "depends_on:!CONFIG_FLAG" for one of its tests. This kind of
dependency (running a test only if some configuration flag is not defined) is currently not supported and instead
results in the respective test case being dropped.

This commit adds support for negative dependencies in test cases.
2017-07-23 10:41:04 +01:00
Hanno Becker
75efa79201 Adapt generic test suite file to coding standard 2017-07-23 10:40:58 +01:00
Hanno Becker
910f662cd7 Increase readability of verbose test suite output 2017-07-23 10:40:53 +01:00
Hanno Becker
1b841cc9bf Correct typo in entropy test suite data 2017-07-23 10:40:46 +01:00
Hanno Becker
7e8e57c6d1 Initialize RSA context in RSA test suite before first potentially failing operation
The function `mbedtls_rsa_gen_key` from `test_suite_rsa.function` initialized a stack allocated RSA context only after
seeding the CTR DRBG. If the latter operation failed, the cleanup code tried to free the uninitialized RSA context,
potentially resulting in a segmentation fault. Fixes one aspect of #1023.
2017-07-23 10:40:29 +01:00
Simon Butcher
de1586799d Added missing credit to Changelog and format fixes 2017-07-22 11:56:20 +02:00
Ron Eldor
e6ec1d2d44 Check return code of mbedtls_mpi_fill_random
Add MBEDTLS_MPI_CHK to check for error value of mbedtls_mpi_fill_random.
Reported and fix suggested by guidovranken in #740
2017-07-22 11:56:20 +02:00
Ron Eldor
8a26de6d99 Resource leak fix on windows platform
Fix a resource leak on windows platform, in mbedtls_x509_crt_parse_path,
in case a failure. when an error occurs, goto cleanup, and free the
resource, instead of returning error code immediately.
2017-07-22 11:56:20 +02:00
Ron Eldor
237ab35b4a Wrong preproccessor condition fix
Fix for issue #696
Change #if defined(MBEDTLS_THREADING_PTHREAD)
to #if defined(MBEDTLS_THREADING_C)
2017-07-22 11:56:20 +02:00
Ron Eldor
537e2e9bb3 fix for issue 1118: check if iv is zero in gcm.
1) found by roberto in mbedtls forum
2) if iv_len is zero, return an error
3) add tests for invalid parameters
2017-07-22 11:56:20 +02:00
Janos Follath
3422ddfa4c Remove mutexes from ECP hardware acceleration
Protecting the ECP hardware acceleratior with mutexes is inconsistent with the
philosophy of the library. Pre-existing hardware accelerator interfaces
leave concurrency support to the underlying platform.

Fixes #863
2017-07-22 11:55:39 +02:00
Andres Amaya Garcia
fdd11b2531 Improve MBEDTLS_NO_UDBL_DIVISION description 2017-07-22 11:53:56 +02:00
Andres Amaya Garcia
c327aa1542 Remove MBEDTLS_TYPE_UDBL tests from all.sh 2017-07-22 11:53:56 +02:00
Andres Amaya Garcia
de2e70431f Remove MBEDTLS_TYPE_UDBL option 2017-07-22 11:53:56 +02:00
Andres Amaya Garcia
6fb65864a2 Fix no 64-bit division test in all.sh 2017-07-22 11:53:56 +02:00
Andres Amaya Garcia
33264d7a96 Add tests for 64 and 32-bit int types compilation 2017-07-22 11:53:56 +02:00
Andres Amaya Garcia
713c6fdd4e Fix check_config.h #error directive 2017-07-22 11:53:56 +02:00
Andres Amaya Garcia
bebc5f69f8 Fix typo in check_config.h 2017-07-22 11:53:56 +02:00
Gilles Peskine
710f54182f Checked names 2017-07-22 11:53:56 +02:00