Commit graph

785 commits

Author SHA1 Message Date
Manuel Pégourié-Gonnard
2adb375c50 Add option to avoid 64-bit multiplication
Motivation is similar to NO_UDBL_DIVISION.

The alternative implementation of 64-bit mult is straightforward and aims at
obvious correctness. Also, visual examination of the generate assembly show
that it's quite efficient with clang, armcc5 and arm-clang. However current
GCC generates fairly inefficient code for it.

I tried to rework the code in order to make GCC generate more efficient code.
Unfortunately the only way to do that is to get rid of 64-bit add and handle
the carry manually, but this causes other compilers to generate less efficient
code with branches, which is not acceptable from a side-channel point of view.

So let's keep the obvious code that works for most compilers and hope future
versions of GCC learn to manage registers in a sensible way in that context.

See https://bugs.launchpad.net/gcc-arm-embedded/+bug/1775263
2018-06-07 11:05:33 +02:00
Simon Butcher
eb6ed719e3 Merge remote-tracking branch 'public/pr/1267' into development 2018-06-01 19:28:18 +01:00
Manuel Pégourié-Gonnard
dca3a5d884 Rename aead_chacha20_poly1305 to chachapoly
While the old name is explicit and aligned with the RFC, it's also very long,
so with the mbedtls_ prefix prepended we get a 31-char prefix to each
identifier, which quickly conflicts with our 80-column policy.

The new name is shorter, it's what a lot of people use when speaking about
that construction anyway, and hopefully should not introduce confusion at
it seems unlikely that variants other than 20/1305 be standardised in the
foreseeable future.
2018-05-24 13:37:31 +02:00
Daniel King
b8025c5826 Implement AEAD-ChaCha20-Poly1305.
This implementation is based off the description in RFC 7539.

The ChaCha20 code is also updated to provide a means of generating
keystream blocks with arbitrary counter values. This is used to
generated the one-time Poly1305 key in the AEAD construction.
2018-05-24 13:37:31 +02:00
Daniel King
adc32c0b50 Add Poly1305 authenticator algorithm (RFC 7539)
Test vectors are included from RFC 7539.

Poly1305 is also added to the benchmark program.
2018-05-24 13:37:31 +02:00
Daniel King
34b822ce7b Initial implementation of ChaCha20 2018-05-24 13:37:31 +02:00
Manuel Pégourié-Gonnard
a3712beb9b Merge branch 'development' into iotssl-1941-aria-ciphersuites
* development: (504 commits)
  Fix minor code style issues
  Add the uodate to the soversion to the ChangeLog
  Fix the ChangeLog for clarity, english and credit
  Update version to 2.9.0
  ecp: Fix binary compatibility with group ID
  Changelog entry
  Change accepted ciphersuite versions when parsing server hello
  Remove preprocessor directives around platform_util.h include
  Fix style for mbedtls_mpi_zeroize()
  Improve mbedtls_platform_zeroize() docs
  mbedtls_zeroize -> mbedtls_platform_zeroize in docs
  Reword config.h docs for MBEDTLS_PLATFORM_ZEROIZE_ALT
  Organize CMakeLists targets in alphabetical order
  Organize output objs in alfabetical order in Makefile
  Regenerate errors after ecp.h updates
  Update ecp.h
  Change variable bytes_written to header_bytes in record decompression
  Update ecp.h
  Update ecp.h
  Update ecp.h
  ...
2018-05-22 15:58:50 +02:00
Jaeden Amero
cdd97fd632 Merge remote-tracking branch 'upstream-public/pr/1433' into development 2018-05-11 10:48:15 +01:00
Jaeden Amero
09c4e7ef5a Merge remote-tracking branch 'upstream-public/pr/1486' into development-proposed 2018-05-04 11:03:16 +01:00
Darryl Green
418527b041 Fix minor issues with command line options 2018-04-16 12:02:29 +01:00
Andres AG
5121d4b32f Remove refs to VS6 from generate_visualc_files.pl 2018-04-11 20:52:38 -05:00
Andres Amaya Garcia
3c5f9498e5 genereate_visualc_files.pl deletes old files
Add a function that deletes all the old Visual Studio prokect files
before generating the new ones. This ensure that project files for
delete example applications are removed from the repository.
2018-04-11 20:29:21 -05:00
Darryl Green
7869680e41 Updated abi_check.py docstrings 2018-04-06 11:23:22 +01:00
fbrosson
533407a266 Use "#!/usr/bin/env perl" as shebang line. 2018-04-04 21:44:29 +00:00
Jaeden Amero
5031a9a278 Merge remote-tracking branch 'upstream-public/pr/1134' into development-proposed
Fixes #504 and fixes #1057
2018-03-29 10:53:42 +01:00
Gilles Peskine
262329603d all.sh: with --no-armcc, don't call armcc from output_env.sh
When not running armcc, don't try to invoke armcc at all, not even to
report its version.
2018-03-21 08:35:07 +01:00
Darryl Green
a6f430f577 Fix current directory check 2018-03-15 13:53:58 +00:00
Gilles Peskine
553a06f08a Merge remote-tracking branch 'upstream-restricted/pr/351' into development-restricted-proposed
Move the added ChangeLog entry to the bottom so that the list remains
in merge order.
2018-03-13 17:15:34 +01:00
Darryl Green
127c5affce Add copyright to abi_check script 2018-03-13 09:17:23 +00:00
Gilles Peskine
13678d251f Merge remote-tracking branch 'upstream-public/pr/922' into development-proposed 2018-03-13 00:10:07 +01:00
Darryl Green
7c2dd5890f Add script for ABI compatibility checking 2018-03-09 17:33:32 +00:00
Hanno Becker
a3389ebb09 Merge branch 'development-restricted' into iotssl-1306-rsa-is-vulnerable-to-bellcore-glitch-attack 2018-03-06 11:55:21 +00:00
Manuel Pégourié-Gonnard
6b3689237d Add compat.sh ARIA run to all.sh
Warning: needs OpenSSL >= 1.1.1-pre1 installed and environment variable
OPENSSL_NEXT pointing to it.
2018-02-27 12:39:12 +01:00
Markku-Juhani O. Saarinen
3c0b53b2b0 ARIA build integration 2018-02-27 12:39:12 +01:00
Jaeden Amero
0cb770973c Add LinkLibraryDependencies to VS2010 app template
Add mbedTLS.vcxproj to the VS2010 application template so that the next
time we auto-generate the application project files, the
LinkLibraryDependencies for mbedTLS.vcxproj are maintained.

Fixes #1347
2018-02-22 12:23:53 +00:00
Gilles Peskine
7ecab3df4c Error codes for hardware accelerator failures
Add MBEDTLS_ERR_XXX_HW_ACCEL_FAILED error codes for all cryptography
modules where the software implementation can be replaced by a hardware
implementation.

This does not include the individual message digest modules since they
currently have no way to return error codes.

This does include the higher-level md, cipher and pk modules since
alternative implementations and even algorithms can be plugged in at
runtime.
2018-01-26 17:56:38 +01:00
Gilles Peskine
9214327623 Sort list to make things easier to find 2018-01-25 23:26:24 +01:00
Azim Khan
c4e9694d43 Add MBEDTLS_NO_UDBL_DIVISION to excludes of full config 2017-12-21 15:22:37 +00:00
Azim Khan
c3c3a68e74 Update usage description 2017-12-21 15:19:53 +00:00
Azim Khan
0d44573e8b Add option to do baremetal configuration. 2017-12-21 10:41:38 +00:00
Gilles Peskine
f16de7d525 Merge remote-tracking branch 'upstream-public/pr/995' into development 2017-11-28 16:59:20 +01:00
Andres Amaya Garcia
69944b1e67 Make matching more robbust in generate_errors.pl 2017-10-17 21:24:56 +01:00
Andres Amaya Garcia
d2da622138 Ensure that only .h files are parsed in generate_errors.pl 2017-10-17 21:23:15 +01:00
Gilles Peskine
8ca0e8fdff Minor style fix 2017-10-12 23:21:37 +01:00
Gilles Peskine
d98e9e8577 config.pl get: be better behaved
When printing an option's value, print a newline at the end.

When the requested option is missing, fail with status 1 (the usual
convention for "not found") rather than -1 (which has a
system-dependent effect).
2017-10-12 23:21:37 +01:00
Gilles Peskine
01f57e351c config.pl get: don't rewrite config.h; detect write errors
scripts/config.pl would always rewrite config.h if it was reading it.
This commit changes it to not modify the file when only reading is
required, i.e. for the get command.

Also, die if writing config.h fails (e.g. disk full).
2017-10-12 23:21:37 +01:00
Gilles Peskine
f0f55ccb72 Fixed "config.pl get" for options with no value
Between 2.5.0 and 2.6.0, "scripts/config.pl get MBEDTLS_XXX" was fixed
for config.h lines with a comment at the end, but that broke the case
of macros with an empty expansion. Support all cases.
2017-10-12 23:21:37 +01:00
Andres Amaya Garcia
36855d66bb Change generate_errors.pl to call perl grep
Change the script generate_errors.pl to call the grep function in Perl
instead of calling the external tool grep directly as this causes
problems when ANSI escape sequences are included in the grep output
string.
2017-10-09 17:22:07 +01:00
Hanno Becker
7c0f17d115 Add MBEDTLS_RSA_NO_CRT to options unaffected by config.pl full
The effect of `config.pl full` on 'negative' options such as
`NO_PLATFORM_ENTROPY` is usually inverted, but `MBEDTLS_RSA_NO_CRT` was not
included in the list of such options. This commit adds it.
2017-09-28 12:53:34 +01:00
Hanno Becker
c6f346b60c Fix get option in config.pl script 2017-07-28 16:45:55 +01:00
Andres Amaya Garcia
fe9483184f Remove malloc references in mbedtls/scripts 2017-07-06 10:34:12 +01:00
Ron Eldor
a7f51f6e1f Remove Yotta module from footprint.sh script
Remove Yotta module configuration usd in footprint.sh script
2017-05-15 11:23:55 +03:00
Simon Butcher
08902ed671 Fix Visual Studio template files
Adds interim directories to the Visual Studio project files to avoid warning
MSB8028 in Visual Studio 2015, where shared directories of intermediate files
between project files generate the warning.
2017-03-01 22:32:28 +00:00
Simon Butcher
4d1e104bc1 Merge iotssl-1079-macro-redefinition-warning
Fix redefinition of macro ssl_set_bio to undefined symbol
mbedtls_ssl_set_bio_timeout in compat-1.3.h.
2017-02-02 12:19:04 +00:00
Andres AG
31f9b5bdd8 Modify output_env.sh to make it extensible 2017-01-05 10:14:51 +00:00
Andres AG
87bb577cfb Add ARM Compiler 6 build tests to all.sh 2017-01-03 10:12:11 +00:00
Andres AG
ee7157e735 Fix redefinition of macro ssl_set_bio
Fix redefinition of macro ssl_set_bio to undefined symbol
mbedtls_ssl_set_bio_timeout in compat-1.3.h.
2016-12-07 10:27:00 +00:00
Brian J Murray
2adecba01f Clarify Comments and Fix Typos (#651)
Fixes many typos, and errors in comments.

* Clarifies many comments
* Grammar correction in config.pl help text
* Removed comment about MBEDTLS_X509_EXT_NS_CERT_TYPE.
* Comment typo fix (Dont => Don't)
* Comment typo fix (assure => ensure)
* Comment typo fix (byes => bytes)
* Added citation for quoted standard
* Comment typo fix (one complement => 1's complement)

The is some debate about whether to prefer "one's complement",  "ones'
complement", or "1's complement".  The more recent RFCs related to TLS
(RFC 6347,  RFC 4347, etc) use " 1's complement", so I followed that
convention.

* Added missing ")" in comment
* Comment alignment
* Incorrect comment after #endif
2016-11-06 12:45:15 +00:00
Simon Butcher
37a064af76 Remove CMAC as a separate and independent error group 2016-10-05 14:19:18 +01:00
Robert Cragie
84a4c67741 Added CMAC as proper low-level module and changed error returns 2016-10-05 14:19:13 +01:00
Andres AG
788aa4a812 Rename net.{c,h} to net_sockets.{c,h}
The library/net.c and its corresponding include/mbedtls/net.h file are
renamed to library/net_sockets.c and include/mbedtls/net_sockets.h
respectively. This is to avoid naming collisions in projects which also
have files with the common name 'net'.
2016-09-26 23:23:52 +01:00
Simon Butcher
40122e015a Remove list numbering in output_env.sh 2016-09-15 20:45:53 +01:00
Andres AG
7a63eaf2de Add version printing for all.sh env vars 2016-09-15 20:45:53 +01:00
Andres Amaya Garcia
9a5398f71b Fix footprint.sh call to makefile (#600)
Ideally, Makefile targets should be called irrespectively of their
execution order. In this sense, `clean` and `lib` should not be
passed both as target command line arguments in the same make
invocation. This is because out-of-order execution could cause a
failure. This change ensures that `clean` and `lib` are called in
separate executions of make in scripts/footprint.sh
2016-09-06 17:15:54 +01:00
Simon Butcher
3ac076784c Suppress shell errors in output_env.sh
When the output_env.sh script is executed, if any application wasn't found on
the path by hash, and error was being output, which as an error looked like
the script wasn't working.

This change redirects the output to stderr from hash to /dev/null to suppress
the error.

Also fixes a formatting error.
2016-09-05 14:53:13 +01:00
Janos Follath
b72c67804a Add script to print build environment info. (#539)
* Add script to print build environment info.

The new script is also included in:
- all.sh
- basic-build-test.sh

* Tidy up environment reporting script.

Changes include:
- making the echo calls portable
- removing unnecessary brackets
- using more efficient checks for the existance of commands
- correcting typos and copyright year

* Update references to output_env.sh
2016-07-19 14:54:17 +01:00
Simon Butcher
3d26513650 Fix for config.pl if no arguments are passed 2016-06-26 15:44:20 +01:00
Simon Butcher
6dc7c9c5e1 Adds checks to 1.3->2.0 API migration script 2016-06-23 11:11:30 +01:00
Simon Butcher
dd9895d810 Fix config.pl to return successful exitcode for full and realfull 2016-06-21 15:12:00 +01:00
Simon Butcher
4ae869139a Adds 'get' command to scripts/config.pl to retrieve config state
Adds 'get' command to indicate if the option is enabled in the given
configuration file, and to returns it's value if one has been set.
2016-06-21 10:09:25 +01:00
Simon Butcher
ab5df40054 Rename the 'no entropy' feature to MBEDTLS_TEST_NULL_ENTROPY
Following review and for clarity, changed the name of the feature to 'null
entropy'.
2016-06-11 02:31:21 +01:00
Janos Follath
53de78444c Add entropy safety switch.
Add a switch that turns entropy collecting off entirely, but enables
mbed TLS to run in an entirely unsafe mode. Enables to test mbed TLS
on platforms that don't have their entropy sources integrated yet.
2016-06-09 11:54:54 +01:00
-~- redtangent ~-~
9fa2e86d93 Add missing mbedtls_time_t definitions (#493)
Add missing mbedtls_time_t definitions to sample applications and the error.c
generation script.

Fixes #490.
2016-05-26 10:07:49 +01:00
Simon Butcher
768594d772 Removes yotta from bump_version.sh
Yotta version is independent of the mbed TLS version so shouldn't be set by this
script.
Also adds a header, copyright and attribution to the script.
2016-05-23 19:15:39 +01:00
SimonB
73883c12bc Fixes formatting of spacing in config.pl 2016-04-04 13:49:10 +01:00
SimonB
ba9dd1ec13 Adds to footprint.sh MBEDTLS_NO_PLATFORM_ENTROPY
For baremetal builds MBEDTLS_NO_PLATFORM_ENTROPY must now be set to avoid the
build failing.

Fixes #449.
2016-04-03 15:06:52 +01:00
SimonB
60f2cf93f5 Adds option to config.pl to force config changes
The script config.pl fails when setting a #define symbol if the symbol isn't
already in the configuration header. This adds an option '--force' to append
the symbol to the end of the file if it isn't already present.

Also clarified usage, and added copyright to the config.pl.
2016-04-03 14:16:08 +01:00
Manuel Pégourié-Gonnard
d091ed1911 Add scripts/apidoc_full.sh
This re-introduces the apidoc with full config.h, but hopefully with the race
conditions and other issues that the previous implementation had.

Adapt doxygen test script to use that new script, and also check for errors
in addition to warnings while at it.
2016-01-12 14:48:03 +00:00
Manuel Pégourié-Gonnard
1989caf71c Use a full config.h with doxygen
Otherwise we get warnings that some documentation items don't have
corresponding #define, and more importantly the corresponding snippets are not
included in the output.

For that we need a modified version of the "full" argument for config.pl.

Also, the new CMakeLists.txt target only works on Unix (which was already the
case of the Makefile target). Hopefully this is not an issue as people are
unlikely to need that target on Windows.
2016-01-04 12:57:32 +01:00
Manuel Pégourié-Gonnard
3134ef0504 footprint.sh: tune output again 2015-11-25 10:50:27 +00:00
Manuel Pégourié-Gonnard
4553a6cdcf footprint.sh: improve printed output 2015-11-25 10:39:54 +00:00
Manuel Pégourié-Gonnard
ac8673cb3f Add quick script to estimate ROM footprint 2015-10-23 15:51:02 +02:00
Manuel Pégourié-Gonnard
a6b95f01cc Print I/O buffer size in memory.sh 2015-09-09 13:51:05 +02:00
Manuel Pégourié-Gonnard
67e4652bfc Fix bug in bump_version.sh
Missing quotes around "version" in module.json
2015-09-04 14:31:16 +02:00
Manuel Pégourié-Gonnard
37ff14062e Change main license to Apache 2.0 2015-09-04 14:21:07 +02:00
Manuel Pégourié-Gonnard
278098f4f4 Merge pull request #233 from ARMmbed/yotta-scripted
Yotta scripted
2015-08-06 18:04:34 +02:00
Manuel Pégourié-Gonnard
48573f8337 Fix renaming error in script 2015-08-06 17:25:33 +02:00
Manuel Pégourié-Gonnard
63e7ebaaa1 Add material for generating yotta module 2015-08-06 09:57:53 +02:00
Manuel Pégourié-Gonnard
7381ff0046 Update copyright date in templates too 2015-08-04 11:12:49 +02:00
Manuel Pégourié-Gonnard
10c767488b Adjust rename/compat list 2015-07-15 11:07:26 +02:00
Manuel Pégourié-Gonnard
1409616d9c Fix one renaming in the list
Found by Simon while testing the upgrade guide
2015-07-09 09:17:18 +01:00
Manuel Pégourié-Gonnard
3d7d00ad23 Rename mbedtls_net_close() to mbedtls_net_free()
close() may be more meaningful, but free() is symmetric with _init(), and more
consistent with all other modules
2015-06-30 16:50:37 +02:00
Manuel Pégourié-Gonnard
752c501126 One soversion per library 2015-06-25 11:56:17 +02:00
Manuel Pégourié-Gonnard
ace35999b0 Fix GNUism in bump_version.sh 2015-06-25 11:51:12 +02:00
Manuel Pégourié-Gonnard
7f9049baf4 Make config.pl more resistant to misuse 2015-06-23 23:30:16 +02:00
Manuel Pégourié-Gonnard
07894338a0 Rename M255 to Curve25519 2015-06-23 13:09:10 +02:00
Manuel Pégourié-Gonnard
7320eb46d4 Remove references to some Montgomery curves
After all it looks like those won't become standard.
2015-06-23 13:09:10 +02:00
Manuel Pégourié-Gonnard
9dbaf400ef Rationalize other snprintf() uses 2015-06-22 14:42:04 +02:00
Manuel Pégourié-Gonnard
c0696c216b Rename mbedtls_mpi_msb to mbedtls_mpi_bitlen 2015-06-18 16:49:37 +02:00
Manuel Pégourié-Gonnard
097c7bb05b Rename relevant global symbols from size to bitlen
Just applying rename.pl with this file:

mbedtls_cipher_get_key_size mbedtls_cipher_get_key_bitlen
mbedtls_pk_get_size mbedtls_pk_get_bitlen
MBEDTLS_BLOWFISH_MIN_KEY MBEDTLS_BLOWFISH_MIN_KEY_BITS
MBEDTLS_BLOWFISH_MAX_KEY MBEDTLS_BLOWFISH_MAX_KEY_BITS
2015-06-18 16:43:38 +02:00
Manuel Pégourié-Gonnard
b541da6ef3 Fix define for ssl_conf_curves()
This is a security feature, it shouldn't be optional.
2015-06-17 14:27:38 +02:00
Manuel Pégourié-Gonnard
a14cbb6141 Have config.pl return non-zero rather than warn 2015-06-03 10:49:38 +01:00
Manuel Pégourié-Gonnard
7ee5ddd798 Merge branch 'mbedtls-1.3' into development
* mbedtls-1.3:
  Fix compile errors with NO_STD_FUNCTIONS
  Expand config.pl's notion of "full"
  Ack external bugfix in Changelog
  FIx misplaced Changelog entry (oops)
  Fix compile bug: incompatible declaration of polarssl_exit in platform.c
  Fix contributor's name in Changelog
2015-06-03 10:33:55 +01:00
Manuel Pégourié-Gonnard
b752715893 Expand config.pl's notion of "full"
Make sure bugs in PLATFORM_xxx_ALT are catched
2015-06-03 10:00:02 +01:00
Manuel Pégourié-Gonnard
0469e41342 Add MBEDTLS_CONFIG_FILE to the rename list 2015-06-02 13:52:02 +01:00
Manuel Pégourié-Gonnard
c730ed3f2d Rename boolean functions to be clearer 2015-06-02 10:38:50 +01:00
Manuel Pégourié-Gonnard
cb46fd8216 Avoid non-standard strcasecmp() 2015-05-29 10:18:09 +02:00
Manuel Pégourié-Gonnard
6a8ca33fa5 Rename ERR_xxx_MALLOC_FAILED to ..._ALLOC_FAILED 2015-05-28 16:25:05 +02:00
Manuel Pégourié-Gonnard
d9e6a3ac10 Rename pk_init_ctx() -> pk_setup() 2015-05-14 21:58:34 +02:00
Manuel Pégourié-Gonnard
8473f87984 Rename cipher_init_ctx() to cipher_setup() 2015-05-14 21:58:34 +02:00
Manuel Pégourié-Gonnard
51f14be888 Remove VS6 files, only 2010 supported now 2015-05-14 13:04:03 +02:00
Manuel Pégourié-Gonnard
e3a062ba1f Rename ecp_use_known_dp -> mbedtls_ecp_group_load() 2015-05-11 18:46:47 +02:00
Manuel Pégourié-Gonnard
6729e79482 Rename ssl_set_xxx() to ssl_conf_xxx() 2015-05-11 14:35:41 +02:00
Manuel Pégourié-Gonnard
ae31914990 Rename ssl_legacy_renegotiation() to ssl_set_... 2015-05-11 12:33:27 +02:00
Manuel Pégourié-Gonnard
8836994f6b Move WANT_READ/WANT_WRITE codes to SSL 2015-05-11 12:33:26 +02:00
Manuel Pégourié-Gonnard
eab147c4d0 Rename pkcs11_xxx_init() to bind() 2015-04-29 02:08:34 +02:00
Manuel Pégourié-Gonnard
331ba5778a Fix some additional renaming issues 2015-04-20 12:33:57 +01:00
Manuel Pégourié-Gonnard
5f29a73d13 Fix regex in scripts/rename.pl again 2015-04-20 12:27:12 +01:00
Manuel Pégourié-Gonnard
e6028c93f5 Fix some X509 macro names
For some reason, during the great renaming, some names that should have been
prefixed with MBEDTLS_X509_ have only been prefixed with MBEDTLS_
2015-04-20 12:19:02 +01:00
Manuel Pégourié-Gonnard
e75317bb5c Anticipate merging x509_crt_verify_info() 2015-04-17 20:57:33 +02:00
Manuel Pégourié-Gonnard
862d503c01 Merge branch 'mbedtls-1.3' into development
* mbedtls-1.3:
  Fix typos in Changelog
  Fix macro name from wrong branch
  Fix bug in pk_parse_key()
  Fixed typos
  Updated Travis CI config for mbedtls project

Conflicts:
	include/mbedtls/ecp.h
	include/polarssl/compat-1.2.h
	include/polarssl/openssl.h
	include/polarssl/platform.h
	library/pkparse.c
	programs/pkey/mpi_demo.c
2015-04-15 11:30:46 +02:00
Paul Bakker
6152b0267c Fixed typos 2015-04-14 15:00:09 +02:00
Manuel Pégourié-Gonnard
2aa81ccedb Fix embarrassing mistake in rename.pl 2015-04-10 11:34:22 +02:00
Manuel Pégourié-Gonnard
d09a6b53b5 Move test scripts to tests/scripts 2015-04-10 11:34:22 +02:00
Manuel Pégourié-Gonnard
7b53889f05 Remove support for HAVE_INT8 and HAVE_INT16 2015-04-10 11:34:22 +02:00
Manuel Pégourié-Gonnard
e546ad4afd Fix comment generated by generate_errors.pl 2015-04-08 20:27:02 +02:00
Manuel Pégourié-Gonnard
c559f0476d Improve regexes in rename.pl 2015-04-08 20:13:33 +02:00
Manuel Pégourié-Gonnard
b20a70fcc7 Move rename.pl to scripts & add data file 2015-04-08 20:13:33 +02:00
Manuel Pégourié-Gonnard
2cf5a7c98e The Great Renaming
A simple execution of tmp/invoke-rename.pl
2015-04-08 13:25:31 +02:00
Manuel Pégourié-Gonnard
8a89fcd13f Rm references to removed config options
POLARSSL_MEMORY_C POLARSSL_PBKDF2_C DISABLE_RENEGO
2015-04-03 18:46:55 +02:00
Manuel Pégourié-Gonnard
ea0920f079 Adjust test scripts to new RC4 defaults 2015-03-24 10:14:23 +01:00
Manuel Pégourié-Gonnard
4b378c9423 Remove old script 2015-03-20 18:30:40 +00:00
Manuel Pégourié-Gonnard
7c4e60fa7d Merge branch 'mbedtls-1.3' into development
* mbedtls-1.3:
  Mark a few additional deprecations
  Use proper doxygen markup to mark deprecations
  Add -fdata-sections in memory.sh too
2015-03-20 17:30:31 +00:00
Manuel Pégourié-Gonnard
47e0214d2c Add -fdata-sections in memory.sh too 2015-03-18 16:52:20 +00:00
Manuel Pégourié-Gonnard
f9c1387b9d Drop POLARSSL_ERROR_STRERROR_BC 2015-03-11 10:59:38 +00:00
Manuel Pégourié-Gonnard
57a26da593 Merge branch 'mbedtls-1.3' into development
* mbedtls-1.3:
  Use link-time garbage collection in memory.sh
  scripts/memory.sh only work on Linux
  Add missing 'const' on selftest data
  Use only headers for doxygen (no doc in C files)
  Add missing extern "C" guard in aesni.h
  Fix compile error with renego disabled
  Remove slow PKCS5 test
  Stop checking key-cert match systematically
  Make tests/*.sh runnable from anywhere
  Update visual C files
2015-03-11 10:30:21 +00:00
Manuel Pégourié-Gonnard
3b110c2d34 Use link-time garbage collection in memory.sh 2015-03-11 10:28:17 +00:00
Manuel Pégourié-Gonnard
4a7ed714bf scripts/memory.sh only work on Linux 2015-03-11 10:26:50 +00:00
Manuel Pégourié-Gonnard
7f8099773e Rename include directory to mbedtls 2015-03-10 11:23:56 +00:00
Manuel Pégourié-Gonnard
129db08c90 Rm polarssl compat targets from Makefiles 2015-03-10 11:23:56 +00:00
Manuel Pégourié-Gonnard
fe44643b0e Rename website and repository 2015-03-06 13:17:10 +00:00
Manuel Pégourié-Gonnard
385069f17d Add some missing 'static' on a few objects 2015-03-06 12:01:27 +00:00
Manuel Pégourié-Gonnard
ac08b543db Merge remote-tracking branch 'rasp/mem-leak' into development
* rasp/mem-leak:
  Fix another potential memory leak found by find-mem-leak.cocci.
  Add a rule for another type of memory leak to find-mem-leak.cocci.
  Fix a potential memory leak found by find-mem-leak.cocci.
  Add a semantic patch to find potential memory leaks.
  Fix whitespace of 369e6c20.
  Apply the semantic patch rm-malloc-cast.cocci.
  Add a semantic patch to remove casts of malloc.

Conflicts:
	programs/ssl/ssl_server2.c
2015-02-18 10:07:22 +00:00
Mansour Moufid
263438b071 Add a rule for another type of memory leak to find-mem-leak.cocci. 2015-02-17 13:41:23 -05:00
Mansour Moufid
961c626d6d Add a semantic patch to find potential memory leaks. 2015-02-17 13:07:29 -05:00
Manuel Pégourié-Gonnard
8b7d7d6c0b Add curve25519 to ecc-heap.sh 2015-02-16 17:28:11 +00:00
Manuel Pégourié-Gonnard
500de6eb18 New script ecc-heap.sh 2015-02-16 17:28:10 +00:00
Manuel Pégourié-Gonnard
92471fb3e5 Disable SRV_C for client measurement 2015-02-16 17:22:46 +00:00
Manuel Pégourié-Gonnard
c6dbc8eb84 Output stack+heap usage with massif 2015-02-16 17:22:46 +00:00
Manuel Pégourié-Gonnard
c5b849bb7d Refactor memory.sh 2015-02-16 17:22:46 +00:00
Manuel Pégourié-Gonnard
f166c543ff Adapt memory.sh to config-suite-b 2015-02-16 17:22:46 +00:00
Manuel Pégourié-Gonnard
4d5cc11ed6 Add script to automate memory usage measurement 2015-02-16 17:22:46 +00:00
Manuel Pégourié-Gonnard
efd9dd0c44 Adapt bump_version.sh to new Makefile 2015-02-16 15:35:41 +00:00
Manuel Pégourié-Gonnard
f812054d00 Revert "Replace SONAME with SOVERSION in makefile"
This reverts commit 418080010a.

In preparation of merging one external contribution that supersedes this.
2015-02-16 15:24:17 +00:00
Mansour Moufid
fd9afb29d3 Add a semantic patch to remove casts of malloc. 2015-02-16 10:43:52 +00:00
Mansour Moufid
5b535de474 Add a semantic patch to remove casts of malloc. 2015-02-15 17:48:33 -05:00
Manuel Pégourié-Gonnard
ac1f76c362 Merge remote-tracking branch 'rich/platform' into development
* rich/platform:
  Remove dependency on sscanf in lib x509
  Fix extra guard in memory_buffer_alloc
  rebase from development
  implemented macro overriding for polarssl_* library functions
  fix bug introduced by the addition of snprintf and assert macro which caused tests to fail without polarssl_platform_c defined
  add initial symbols to config and checks to check_config to allow use of macros to define standard functions
  reformat and arrange additions to config alphabetically
  add missing checks to check_config
  add macro definition of assert using polarssl_exit
  modify library/memory_buffer_alloc.c, benchmark.c and the tests main code to use polarssl_exit
  add POLARSSL_PLATFORM_EXIT_ALT
  modify scripts/* and tests/* to use polarssl_snprintf
  modify programs/*.c to use polarssl_snprintf
  modify library/debug.c to use polarssl_snprintf
  modify library/x509*.c to use polarssl_snprintf
  modify library/net.c to use polarssl_snprintf
  modify oid.c to use polarssl_snprintf
  add platform_set_snprintf

Conflicts:
	library/memory_buffer_alloc.c
	programs/pkey/pk_sign.c
	programs/pkey/pk_verify.c
	programs/pkey/rsa_sign_pss.c
	programs/pkey/rsa_verify_pss.c
	programs/ssl/ssl_client2.c
	programs/ssl/ssl_pthread_server.c
	programs/test/benchmark.c
	programs/test/ssl_cert_test.c
2015-02-13 15:11:24 +00:00
Manuel Pégourié-Gonnard
f5dc8ec358 Update error.fmt to match update error.c 2015-02-13 14:32:17 +00:00
Rich Evans
6aa04bcd85 modify scripts/* and tests/* to use polarssl_snprintf 2015-02-13 13:50:26 +00:00
Manuel Pégourié-Gonnard
418080010a Replace SONAME with SOVERSION in makefile
- avoids duplication
- fixes warning about redefined rule with WINDOWS=1
2015-02-13 13:15:13 +00:00
Paul Bakker
daae3b749b Prepare for mbed TLS 1.3.10 release 2015-02-08 15:49:54 +01:00
Manuel Pégourié-Gonnard
7e81e7003f Fix left out printf's 2015-01-29 11:47:41 +00:00
Manuel Pégourié-Gonnard
860b51642d Fix url again 2015-01-28 17:12:07 +00:00
Manuel Pégourié-Gonnard
8984cc8a71 Add script for polarssl symlink creation 2015-01-28 15:21:04 +00:00
Manuel Pégourié-Gonnard
813e585fe3 Rename in visual C script and templates 2015-01-26 16:44:38 +00:00
Manuel Pégourié-Gonnard
085ab040aa Fix website url to use https. 2015-01-23 11:06:27 +00:00
Manuel Pégourié-Gonnard
9698f5852c Remove maintainer line. 2015-01-23 10:59:00 +00:00
Manuel Pégourié-Gonnard
19f6b5dfaa Remove redundant "all rights reserved" 2015-01-23 10:54:00 +00:00
Manuel Pégourié-Gonnard
a658a4051b Update copyright 2015-01-23 09:55:24 +00:00
Manuel Pégourié-Gonnard
f234ff82ec Rename doxyfile 2015-01-22 17:01:27 +00:00
Manuel Pégourié-Gonnard
b4fe3cb1fa Rename to mbed TLS in the documentation/comments 2015-01-22 16:11:05 +00:00
Manuel Pégourié-Gonnard
967a2a5f8c Change name to mbed TLS in the copyright notice 2015-01-22 14:28:16 +00:00
Manuel Pégourié-Gonnard
a9a991633d generate_errors.pl now errors on duplicate codes
Duplication could easily happen during merges, now it can't go unnoticed.
2015-01-22 13:19:20 +00:00
Paul Bakker
e522d0fa57 Merge smarter certificate selection for pre-TLS-1.2 clients 2015-01-14 16:12:48 +01:00
Paul Bakker
f6080b8557 Merge support for enabling / disabling renegotiation support at compile-time 2015-01-13 16:18:23 +01:00
Manuel Pégourié-Gonnard
6f303ce19e Fix portability issue in script
If there was a reason for hardcoding the path, it should have been documented.
2015-01-08 17:07:18 +01:00
Manuel Pégourié-Gonnard
86b2908236 Adapt to "negative" switch for renego 2014-12-02 10:40:55 +01:00
Manuel Pégourié-Gonnard
10c44d767d Allow x509_crt_verify_child() in recursion.pl 2014-11-20 17:30:37 +01:00
Manuel Pégourié-Gonnard
052ae25e56 Avoid advertising private option 2014-11-14 13:09:41 +01:00
Manuel Pégourié-Gonnard
fd60a5c621 Add script finding recursive functions 2014-11-13 12:42:12 +01:00
Manuel Pégourié-Gonnard
5924f9f810 Add script to find malloc() not followed by init 2014-11-13 12:42:12 +01:00
Manuel Pégourié-Gonnard
ab3d8627f3 Make config.pl more versatile 2014-08-14 11:34:34 +02:00
Manuel Pégourié-Gonnard
bb3a7f2b20 Add scripts to create "full" config.h 2014-08-14 11:34:33 +02:00
Paul Bakker
0464dd9357 Fix bee8ded in error template file too 2014-07-09 10:16:18 +02:00
Paul Bakker
39daf6620c Ability to ignore changes to Makefiles due to CMake usage 2014-06-24 11:09:25 +02:00
Paul Bakker
b5212b436f Merge CCM cipher mode and ciphersuites
Conflicts:
	library/ssl_tls.c
2014-05-22 15:30:31 +02:00
Manuel Pégourié-Gonnard
d66f900ba2 Simplify usage of generate scripts 2014-05-22 13:52:52 +02:00
Manuel Pégourié-Gonnard
71c8f20619 Add generate_visualc_files to bump_version 2014-05-22 13:52:52 +02:00
Manuel Pégourié-Gonnard
30159b452c Make visualc script less chatty 2014-05-22 13:52:52 +02:00
Manuel Pégourié-Gonnard
50868a7a82 Rename VS script more appropriately 2014-05-22 13:52:52 +02:00
Manuel Pégourié-Gonnard
411f73e7b3 Factor some output code 2014-05-22 13:52:52 +02:00
Manuel Pégourié-Gonnard
0598faf15b Generate VS2010 solution file 2014-05-22 13:52:51 +02:00
Manuel Pégourié-Gonnard
41e8b62ebb Generate GUID for VS2010 apps 2014-05-22 13:52:50 +02:00
Manuel Pégourié-Gonnard
cd8f844eb3 Add VS6 workspace to update-vs-apps.pl 2014-05-22 13:52:50 +02:00
Manuel Pégourié-Gonnard
0aafa5c55f Add visual C main files to update_vs_apps.pl 2014-05-22 13:52:49 +02:00
Manuel Pégourié-Gonnard
2d34fe3918 Rework update-vs-apps script a bit 2014-05-22 13:52:49 +02:00
Manuel Pégourié-Gonnard
fe671f4aeb Add markers around generated code in error.c 2014-05-22 13:52:48 +02:00
Manuel Pégourié-Gonnard
a6916fada8 Add (placeholder) CCM module 2014-05-06 11:28:09 +02:00
Paul Bakker
9af723cee7 Fix formatting: remove trailing spaces, #endif with comments (> 10 lines) 2014-05-01 13:03:14 +02:00
Paul Bakker
2ca1dc8958 Updated error.c and version_features.c based on changes 2014-05-01 09:46:38 +02:00
Paul Bakker
790e395729 Fixed to the features check 2014-04-30 16:48:32 +02:00
Manuel Pégourié-Gonnard
0bc1f23dfd Adapt script and instructions for alt config.h 2014-04-30 16:40:22 +02:00
Manuel Pégourié-Gonnard
cef4ad2509 Adapt sources to configurable config.h name 2014-04-30 16:40:20 +02:00
Paul Bakker
0f90d7d2b5 version_check_feature() added to check for compile-time options at run-time 2014-04-30 11:49:44 +02:00
Paul Bakker
1f69a93ab1 Move configs to 'configs/' and activate-config.pl should be called from root 2014-04-25 10:04:49 +02:00
Manuel Pégourié-Gonnard
cf38367f45 Fix HMAC_DRBG and RIPEMD160 error codes 2014-02-01 10:24:53 +01:00
Paul Bakker
17d99fc6f2 Fixed error.fmt to match active error.c code 2013-11-21 17:34:13 +01:00
Paul Bakker
911807284d bump_version script also handled SOVERSION for library/Makefile 2013-11-05 11:28:32 +01:00
Paul Bakker
fa6a620b75 Defines for UEFI environment under MSVC added 2013-10-29 14:05:38 +01:00
Paul Bakker
b9cfaa0c7f Explicit conversions and minor changes to prevent MSVC compiler warnings 2013-10-14 15:50:40 +02:00
Paul Bakker
b887f1119e Removed return from error_strerror() 2013-10-11 15:24:31 +02:00
Paul Bakker
2466d93546 Threading abstraction layer added 2013-09-28 15:00:02 +02:00
Manuel Pégourié-Gonnard
420edcaf1d Clean up config-suite-b.h thanks to new certs 2013-09-25 11:52:38 +02:00
Manuel Pégourié-Gonnard
cbf3ef3861 RSA and ECDSA key exchanges don't depend on CRL 2013-09-24 21:25:53 +02:00
Manuel Pégourié-Gonnard
684e9dc52e Add custom configurations with activation script 2013-09-20 16:51:13 +02:00
Paul Bakker
eaed9dffb7 Added --soversion to help in bump_version.sh 2013-09-18 21:19:35 +02:00
Manuel Pégourié-Gonnard
ef009ffde9 Small fix to check_doxy_blocks script 2013-09-18 14:34:33 +02:00
Manuel Pégourié-Gonnard
1b57878e4a Add missing VS project files, generated by script 2013-09-18 14:34:33 +02:00
Paul Bakker
5187656211 Renamed X509 / X509WRITE error codes to generic (non-cert-specific) 2013-09-17 14:36:05 +02:00
Paul Bakker
36713e8ed9 Fixed bunch of X509_PARSE related defines / dependencies 2013-09-17 13:25:29 +02:00
Paul Bakker
cff6842b39 POLARSSL_PEM_C split into POLARSSL_PEM_PARSE_C and POLARSSL_PEM_WRITE_C 2013-09-16 13:36:18 +02:00
Paul Bakker
0e06c0fdb4 Assigned error codes to the error defines 2013-08-25 11:21:30 +02:00
Manuel Pégourié-Gonnard
7a6c946446 Fix error code in pk.h 2013-07-09 10:37:27 +02:00
Paul Bakker
9e36f0475f SHA2 renamed to SHA256, SHA4 renamed to SHA512 and functions accordingly
The SHA4 name was not clear with regards to the new SHA-3 standard. So
SHA2 and SHA4 have been renamed to better represent what they are:
SHA256 and SHA512 modules.
2013-06-30 14:34:05 +02:00
Paul Bakker
e2ab84f4a1 Renamed error_strerror() to the less conflicting polarssl_strerror()
Ability to keep old function error_strerror() as well with
POLARSSL_ERROR_STRERROR_BC. Also works with
POLARSSL_ERROR_STRERROR_DUMMY.
2013-06-29 18:35:41 +02:00
Paul Bakker
28144decef PKCS#5 v2 PBES2 support and use in PKCS#8 encrypted certificates
The error code POLARSSL_ERR_X509_PASSWORD_MISMATCH is now properly
returned in case of an encryption failure in the padding. The
POLARSSL_ERR_X509_PASSWORD_REQUIRED error code is only returned for PEM
formatted private keys as for DER formatted ones it is impossible to
distinguish if a DER blob is PKCS#8 encrypted or not.
(cherry picked from commit 1fd4321ba2016dfaff2b48c11f731fc9ccbd7ccf)

Conflicts:
	include/polarssl/error.h
	scripts/generate_errors.pl
2013-06-25 15:06:52 +02:00
Paul Bakker
b0c19a4b3d PKCS#5 module added. Moved PBKDF2 functionality inside and deprecated
old PBKDF2 module.
(cherry picked from commit 19bd297dc896410e0d859729f9e8d4b1e107e6c8)

Conflicts:
	include/polarssl/error.h
	scripts/generate_errors.pl
2013-06-25 15:06:52 +02:00
Paul Bakker
f1f21fe825 Parsing of PKCS#8 encrypted private key files added and PKCS#12 basis
PKCS#8 encrypted key file support has been added to x509parse_key() with
support for some PCKS#12 PBE functions (pbeWithSHAAnd128BitRC4,
pbeWithSHAAnd3-KeyTripleDES-CBC and pbeWithSHAAnd2-KeyTripleDES-CBC)
(cherry picked from commit cf6e95d9a81c7b22271beb58a09b5c756148e62a)

Conflicts:
	scripts/generate_errors.pl
2013-06-25 15:06:51 +02:00
Paul Bakker
b2a1140469 Added error.h inclusion in error.c template
(cherry picked from commit ac6168b95e7abf22dcab50c8487db231e986d2ec)
2013-06-24 19:09:25 +02:00
Paul Bakker
c70b982056 OID functionality moved to a separate module.
A new OID module has been created that contains the main OID searching
functionality based on type-dependent arrays. A base type is used to
contain the basic values (oid_descriptor_t) and that type is extended to
contain type specific information (like a pk_alg_t).

As a result the rsa sign and verify function prototypes have changed. They
now expect a md_type_t identifier instead of the removed RSA_SIG_XXX
defines.

All OID definitions have been moved to oid.h
All OID matching code is in the OID module.

The RSA PKCS#1 functions cleaned up as a result and adapted to use the
MD layer.

The SSL layer cleanup up as a result and adapted to use the MD layer.

The X509 parser cleaned up and matches OIDs in certificates with new
module and adapted to use the MD layer.

The X509 writer cleaned up and adapted to use the MD layer.

Apps and tests modified accordingly
2013-04-07 22:00:46 +02:00
Paul Bakker
a0234377fc Made change to error.c for dummy error_strerror() permanent 2013-03-20 14:42:21 +01:00
Paul Bakker
cf4365f560 Updated error codes for ECP 2013-01-16 17:00:43 +01:00
Paul Bakker
34558735d2 Inserted bump_version.sh in git repository 2012-11-26 17:18:12 +01:00
Paul Bakker
9a73632fd9 - Merged changesets 1399 up to and including 1415 into 1.2 branch 2012-11-14 12:39:52 +00:00
Paul Bakker
d14277d7de - Added PBKDF2 error code 2012-09-26 15:19:05 +00:00
Paul Bakker
83f00bba9c - Updated strerror codes for SSL Compression and Blowfish 2012-07-04 11:08:50 +00:00
Paul Bakker
3aac1daf1d - Added exception error parsing when FATAL ssl message is received 2012-05-08 13:12:27 +00:00
Paul Bakker
7890405856 - Added GCM as known module 2012-04-18 14:11:33 +00:00
Paul Bakker
69e095cc15 - Changed the behaviour of x509parse_parse_crt for permissive parsing. Now returns the number of 'failed certificates' instead of having a switch to enable it.
- As a consequence all error code that were positive were changed. A lot of MALLOC_FAILED and FILE_IO_ERROR error codes added for different modules.
 - Programs and tests were adapted accordingly
2011-12-10 21:55:01 +00:00
Paul Bakker
6083fd252d - Added a generic entropy accumulator that provides support for adding custom entropy sources and added some generic and platform dependent entropy sources 2011-12-03 21:45:14 +00:00
Paul Bakker
880ac7eb95 - Added handling for CTR_DRBG module 2011-11-27 14:50:49 +00:00
Paul Bakker
dceecd80f7 - Adapted error generation to include ASN.1 changes and have Windows snprintf macro 2011-11-15 16:38:34 +00:00
Paul Bakker
d0a345e394 - Added MFC snprintf macro 2011-11-10 13:03:42 +00:00
Paul Bakker
e471cd14bd - Fixed handling of SSL module 2011-05-18 13:27:35 +00:00
Paul Bakker
9d781407bc - A error_strerror function() has been added to translate between error codes and their description.
- The error codes have been remapped and combining error codes is now done with a PLUS instead of an OR as error codes used are negative.
 - Descriptions to all error codes have been added.
 - Generation script for error.c has been created to automatically generate error.c from the available error definitions in the headers.
2011-05-09 16:17:09 +00:00