Commit Graph

5274 Commits

Author SHA1 Message Date
Andres AG
f00baffdc1 Add CSR DER tests with incorrect version 2017-07-27 15:08:01 +01:00
Andres AG
c0fbf784b6 Fix potential integer overflow parsing DER CRL
This patch prevents a potential signed integer overflow during the
CRL version verification checks.
2017-07-27 15:08:01 +01:00
Ron Eldor
ab8e04094a 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-27 15:08:01 +01:00
Ron Eldor
205672fc19 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-27 15:08:01 +01:00
Ron Eldor
98df169a4d Fix slash direction for linux path
Update direction of the slash, for linux path, after @hanno-arm comments
2017-07-27 15:08:01 +01:00
Ron Eldor
c898a3baf0 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-27 15:08:01 +01:00
Ron Eldor
2f43032f1a Pre push hook script
Add git_hook folder, and pre-push script,
to be soft linked from .git/hooks/pre-push
2017-07-27 15:08:01 +01:00
Simon Butcher
b9f00a7f14 Minor typo fixes in the github template files 2017-07-27 15:08:01 +01:00
Ron Eldor
d7f057f368 Update after Simon's comment
Update the comment with Simon's comments
2017-07-27 15:08:01 +01:00
Ron Eldor
fe617367f8 github templates
Add templates for github, for templates to be used in new issues and new
PRs
2017-07-27 15:08:01 +01:00
Simon Butcher
940737f43b 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-27 15:08:01 +01:00
Simon Butcher
a85ae63de1 Added missing credit to Changelog and format fixes 2017-07-27 15:08:01 +01:00
Ron Eldor
84ccfe0328 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 15:08:01 +01:00
Ron Eldor
c44b5a0068 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 15:08:01 +01:00
Ron Eldor
9e0bb50e7b Wrong preproccessor condition fix
Fix for issue #696
Change #if defined(MBEDTLS_THREADING_PTHREAD)
to #if defined(MBEDTLS_THREADING_C)
2017-07-27 15:08:01 +01:00
Ron Eldor
fb46c32ecb 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 15:08:01 +01:00
Janos Follath
b85291c364 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 15:08:01 +01:00
Andres Amaya Garcia
2801d00c6a Improve MBEDTLS_NO_UDBL_DIVISION description 2017-07-27 15:08:01 +01:00
Andres Amaya Garcia
72df64a2bf Remove MBEDTLS_TYPE_UDBL tests from all.sh 2017-07-27 15:08:01 +01:00
Andres Amaya Garcia
031622ffa2 Remove MBEDTLS_TYPE_UDBL option 2017-07-27 15:08:01 +01:00
Andres Amaya Garcia
05931979a6 Fix no 64-bit division test in all.sh 2017-07-27 15:08:01 +01:00
Andres Amaya Garcia
fe843a359b Add tests for 64 and 32-bit int types compilation 2017-07-27 15:08:01 +01:00
Andres Amaya Garcia
75c0b2c192 Fix check_config.h #error directive 2017-07-27 15:08:01 +01:00
Andres Amaya Garcia
99716caf5d Fix typo in check_config.h 2017-07-27 15:08:01 +01:00
Gilles Peskine
04d6c3da3f Checked names 2017-07-27 15:08:01 +01:00
Gilles Peskine
ed942f84e6 MBEDTLS_NO_INT64_DIVISION -> MBEDTLS_NO_UDBL_DIVISION
Changed the option to disable the use of 64-bit division, to an option
to disable the use of double-width division, whether that's 64 or 128-bit.
2017-07-27 15:08:01 +01:00
Andres Amaya Garcia
6316ceb4b5 Allow forcing 64-bit integer type
Allow forcing 64-bit integer type for bignum operations. Also introduce
the macro MBEDTLS_TYPE_UDBL to allow configuration of the double length
integer in unknown compilers.
2017-07-27 15:08:01 +01:00
Andres Amaya Garcia
84e6ce899f Add all.sh test to force 32-bit compilation 2017-07-27 15:08:01 +01:00
Andres Amaya Garcia
b820bf8e45 Enable 64-bit compilation with ARM Compiler 6
This patch fixes the conditional preprocessor directives in
include/mbedtls/bignum.h to enable 64-bit compilation with ARM
Compiler 6.
2017-07-27 15:08:01 +01:00
Simon Butcher
9469919447 Fix platform setup/teardown feature and comments
Fixed the platform setup/teardown feature, by fixing it for doxygen and adding it
as a feature  in 'version_features.c'.
2017-07-27 15:08:01 +01:00
Simon Butcher
0a1f94775c Add additional comments to platform setup/teardown functions 2017-07-27 15:08:01 +01:00
Simon Butcher
11757be5e1 Correct order of sections in the ChangeLog 2017-07-27 15:08:01 +01:00
Ron Eldor
410b74205f 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 15:08:01 +01:00
Ron Eldor
23a99c46fd 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 15:08:01 +01:00
Ron Eldor
4aa02719c0 Wrong preproccessor condition fix
Fix for issue #696
Change #if defined(MBEDTLS_THREADING_PTHREAD)
to #if defined(MBEDTLS_THREADING_C)
2017-07-27 15:08:01 +01:00
Ron Eldor
70505ac981 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 15:08:01 +01:00
Janos Follath
8c14b2e24b 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 15:08:01 +01:00
Andres Amaya Garcia
5478bc79ae Fix typo in ChangeLog and update macro name 2017-07-27 15:08:01 +01:00
Andres Amaya Garcia
59c202618e Rename macro SETUP_ALT to SETUP_TEARDOWN_ALT
Rename the macro MBEDTLS_PLATFORM_SETUP_ALT to
MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT to make the name more descriptive
as this macro enables/disables both functions.
2017-07-27 15:08:01 +01:00
Andres Amaya Garcia
3d3aadc736 Improve documentation for mbedtls_platform_context 2017-07-27 15:08:01 +01:00
Andres Amaya Garcia
24f3641617 Modify ChangeLog according to API changes 2017-07-27 15:08:01 +01:00
Andres Amaya Garcia
d24f5feb59 Remove internal functions from setup API 2017-07-27 15:08:01 +01:00
Andres Amaya Garcia
2187e03817 Add ChangeLog entry for platform setup and teardown 2017-07-27 15:08:01 +01:00
Andres Amaya Garcia
d9e7ada52a Add library setup and teardown APIs
Add the following two functions to allow platform setup and teardown
operations for the full library to be hooked in:

* mbedtls_platform_setup()
* mbedtls_platform_teardown()

An mbedtls_platform_context C structure is also added and two internal
functions that are called by the corresponding setup and teardown
functions above:

* mbedtls_internal_platform_setup()
* mbedtls_internal_plartform_teardown()

Finally, the macro MBEDTLS_PLATFORM_SETUP_ALT is also added to allow
mbedtls_platform_context and internal function to be overriden by the
user as needed for a platform.
2017-07-27 15:08:01 +01:00
Simon Butcher
ab67043178 Update Changelog for API/ABI fixes to revert interface 2017-07-27 15:08:01 +01:00
Hanno Becker
2de930fdec Make minor changes to documentation 2017-07-27 15:08:01 +01:00
Hanno Becker
09b30789e5 Export mbedtls_aes_(en/de)crypt to retain for API compatibility
The commit f5bf7189d3 made the AES
functions mbedtls_aes_encrypt and mbedtls_aes_decrypt static, changing
the library's API.

This commit reverts this.
2017-07-27 15:08:01 +01:00
Hanno Becker
a5723f454a Clarify documentation for alternative AES implementations
The functions mbedtls_aes_decrypt and mbedtls_aes_encrypt have been
superseded by mbedtls_aes_internal_decrypt and
mbedtls_aes_internal_encrypt, respectively. Alternative
implementations should now only replace the latter, and leave the
maintenance wrapper definitions of the former untouched.

This commit clarifies this in the documentation of the respective
configuration options MBEDTLS_AES_DECRYPT_ALT and
MBEDTLS_AES_ENCRYPT_ALT.
2017-07-27 15:08:01 +01:00
Hanno Becker
59df56e9b6 Undo API change from SHA1 deprecation
The previous commit bd5ceee484f201b90a384636ba12de86bd330cba removed
the definition of the global constants
- mbedtls_test_ca_crt_rsa_len,
- mbedtls_test_cli_crt_rsa_len,
- mbedtls_test_ca_crt_rsa, and
- mbedtls_test_cli_crt_rsa.
This commit restores these to maintain ABI compatibility.

Further, it was noticed that without SHA256_C being enabled the
previous code failed to compile because because the SHA1 resp. SHA256
certificates were only defined when the respective SHAXXX_C options
were set, but the emission of the global variable mbedtls_test_ca_crt
was unconditionally defined through the SHA256
certificate. Previously, the RSA SHA1 certificate was unconditionally
defined and used for that.

As a remedy, this commit makes sure some RSA certificate is defined
and exported through the following rule:
1. If SHA256_C is active, define an RSA SHA256 certificate and export
   it as mbedtls_test_ca_crt. Also, define SHA1 certificates only if
   SHA1_C is set.
2. If SHA256_C is not set, always define SHA1 certificate and export
   it as mbedtls_test_ca_crt.
2017-07-27 15:08:01 +01:00
Hanno Becker
ff1b846b67 Undo API change
The previous commit b3e6872c93 changed
to public functions from ssl_ciphersuite.h to static inline. This
commit reverts this change.
2017-07-27 15:08:01 +01:00