Commit Graph

4780 Commits

Author SHA1 Message Date
Paul Bakker
440ce420bd Put clang analyzer fix inside __clang_analyzer__ guard 2016-05-23 14:29:31 +01:00
Simon Butcher
cc4eabd22a Reverts change in commit daf534d
Commit daf534d from PR #457 breaks the build. This may reintroduce a
clang-analyse warning, but this is the wrong fix for that.

The fix removed a call to mbedtls_ecp_curve_info_from_grp_id() to find
the curve info. This fix adds that back in.
2016-05-23 14:29:31 +01:00
Paul Bakker
cfe392bdd4 Add end guard comment 2016-05-23 14:29:31 +01:00
Embedthis Software
c0715cb39f Fix single threaded builds 2016-05-23 14:29:31 +01:00
Simon Butcher
da01266599 Corrects incorrectly named function in ctr_drbg.c comment 2016-05-23 14:29:31 +01:00
Simon Butcher
ae79124905 Disables backtrace config from basic-build-test.sh
The configuration MBEDTLS_MEMORY_BACKTRACE is intended for debug and
is not necessary for test coverage. Because it causes timing problems
in some tests the configuration has been removed as it's not present in
equivalent tests in the all.sh test script.
2016-05-23 14:29:30 +01:00
Simon Butcher
a557cfb9ad Widens test bounds on memory alloc tests 2016-05-23 14:29:30 +01:00
Simon Butcher
80119c5d28 Fixes minor typos in comments in pk.h and ctr_drbg.c
Fixes typos in PRs #475 and #437
2016-05-23 14:29:30 +01:00
Paul Bakker
acaac8510e Add option to preserve all logs in ssl-opt.sh
Useful to also allow saving of correct logs in order to compare
differences with failed logs
2016-05-23 14:29:30 +01:00
Paul Bakker
e20310a9fc Add option to print test numbers in ssl-opt.sh output
Allows for easy selection of tests based on numbers for use with the
'-n' option
2016-05-23 14:29:30 +01:00
Paul Bakker
b7584a5e37 Add ability to only run select numbered tests in ssl-opt.sh
In order to reduce debugging time, allows you to only run interesting
tests (by number) from the commandline.

e.g. the command 'tests/ssl-opt.sh -n 246,258' will only run test 246
and 258 (as per the number in the log file names)
2016-05-23 14:29:30 +01:00
Paul Bakker
4fde40f656 Fix logic to allow at least one PKCS version enabled 2016-05-23 14:29:30 +01:00
Paul Bakker
37068a79fe Add check to prevent enabling of RSA without selecting PKCS version(s) 2016-05-23 14:29:30 +01:00
Simon Butcher
4ec1e8193e Widens test parameters in memory alloc tests 2016-05-23 14:29:30 +01:00
SimonB
214f5c0af2 Additional tests to test stack buffer allocator
Adds additional tests to the test suite for
memory_buffer_alloc.c
2016-05-23 14:29:29 +01:00
SimonB
295dfa24e7 Clarifies documentation on reported memory statistics 2016-05-23 14:29:29 +01:00
SimonB
4a3b023172 Adds line numbering in errors for test helpers
Adds to the 'generate_code.pl' tool, support to insert line numbers
before test suite helper code.
2016-05-23 14:29:29 +01:00
SimonB
20273ddc4c Adds reporting of file/line no. in failed tests
Tests in tests/suites will now report the file and line number of
failed test assertions.
2016-05-23 14:29:29 +01:00
SimonB
525b792823 Fixes off by 1 error reported in line number errors 2016-05-23 14:29:29 +01:00
SimonB
ab07135165 Adds line number substitution in test cases
Expanded generate_code.pl to substitute !LINE_NO! in test cases.
2016-05-23 14:29:29 +01:00
SimonB
99cff58958 Fixes memory leak in memory_buffer_alloc.c debug
Debug symbols were being leaked in memory_buffer_alloc.c
2016-05-23 14:29:29 +01:00
Nicholas Wilson
1b666554c9 Silence a clang-analyze warning
The check is already effectively performed later in the function, but
implicitly, so Clang's analysis fail to notice the functions are in
fact safe.  Pulling the check up to the top helps Clang to verify the
behaviour.
2016-05-23 14:29:29 +01:00
Nicholas Wilson
f0021645b0 Refactor slightly to silence a clang-analyze warning
Since the buffer is used in a few places, it seems Clang isn't clever
enough to realise that the first byte is never touched.  So, even though
the function has a correct null check for ssl->handshake, Clang
complains.  Pulling the handshake type out into its own variable is
enough for Clang's analysis to kick in though.
2016-05-23 14:29:28 +01:00
Nicholas Wilson
b47fd5e8c9 Remove a dead store to silence clang-analyze 2016-05-23 14:29:28 +01:00
Nicholas Wilson
e735303026 Shut up a few clang-analyze warnings about use of uninitialized variables
The functions are all safe, Clang just isn't clever enough to realise
it.
2016-05-23 14:29:28 +01:00
Nicholas Wilson
91c68a5e15 Shut up a clang-analyzer warning
The function appears to be safe, since grow() is called with sensible
arguments in previous functions.  Ideally Clang would be clever enough to
realise this.  Even if N has size MBEDTLS_MPI_MAX_LIMBS, which will
cause the grow to fail, the affected lines in montmul won't be reached.
Having this sanity check can hardly hurt though.
2016-05-23 14:29:28 +01:00
Attila Molnar
2791ba1429 Fix handle leak in mbedtls_platform_entropy_poll() on Windows on error 2016-05-23 14:29:28 +01:00
Alexey Skalozub
c8404607ea Move K inside MBEDTLS_SHA512_PROCESS_ALT block
It is used only by `mbedtls_sha512_process()`, and in case `MBEDTLS_SHA512_PROCESS_ALT` is defined, it still cannot be reused because of `static` declaration.
2016-05-23 14:29:28 +01:00
James Cowgill
c788b4cb5a Fix segfault on x32 by using better register constraints in bn_mul.h
On x32, pointers are only 4-bytes wide and need to be loaded using the "movl"
instruction instead of "movq" to avoid loading garbage into the register.

The MULADDC routines for x86-64 are adjusted to work on x32 as well by getting
gcc to load all the registers for us in advance (and storing them later) by
using better register constraints. The b, c, D and S constraints correspond to
the rbx, rcx, rdi and rsi registers respectively.
2016-05-23 14:29:28 +01:00
James Cowgill
5c1e24ca05 Fix build errors on x32 by using the generic 'add' instruction
On x32 systems, pointers are 4-bytes wide and are therefore stored in %e?x
registers (instead of %r?x registers). These registers must be accessed using
"addl" instead of "addq", however the GNU assembler will acccept the generic
"add" instruction and determine the correct opcode based on the registers
passed to it.
2016-05-23 14:29:28 +01:00
Nicholas Wilson
b19bac4d82 Allow test suites to be run on Windows
For a start, they don't even compile with Visual Studio due to strcasecmp
being missing.  Secondly, on Windows Perl scripts aren't executable and have
to be run using the Perl interpreter directly; thankfully CMake is able to
find cygwin Perl straight away without problems.
2016-05-23 14:29:28 +01:00
Janos Follath
c6dab2b029 Fix non compliance SSLv3 in server extension handling.
The server code parses the client hello extensions even when the
protocol is SSLv3 and this behaviour is non compliant with rfc6101.
Also the server sends extensions in the server hello and omitting
them may prevent interoperability problems.
2016-05-23 14:27:02 +01:00
Janos Follath
bed09bd7c5 Merge branch 'iotssl-760-c++-fix' into development 2016-05-23 14:12:20 +01:00
Simon Butcher
27f9ccc959 Adds check for valgrind to ssl-opt.sh (#488)
Provides graceful exit rather than fail silently if valgrind isn't installed.
2016-05-23 11:13:17 +01:00
Simon Butcher
12833ed3c8 Adds additional casts to calloc calls
Casts added to allow compilation of the library as C++
2016-05-20 00:19:09 +01:00
Simon Butcher
3b36bd12f6 Adds casts to zeroize functions to allow building as C++ 2016-05-20 00:00:37 +01:00
Simon Butcher
80d70cb468 Updates copyright and attribution in comment header in ssl-opt.sh 2016-05-19 23:43:11 +01:00
Simon Butcher
7c0ad8b8cf Adds parallel builds to basic-build-test.sh
To speed up test time, added parallel builds
2016-05-19 22:15:34 +01:00
Simon Butcher
99239d6ff1 Fixes RC4 config dependencies in tests in ssl-opt.h
Adds dependencies on MBEDTLS_REMOVE_ARC4_CIPHERSUITES for tests that
require RC4 to be disabled (the default config).
2016-05-19 22:12:18 +01:00
Simon Butcher
7ee51c626a Fixes whitespace errors in x509_crl.c 2016-05-19 00:22:37 +01:00
Simon Butcher
d5bc3ebe29 Merge pull request #486 from bmurray7/fix-indentation
fix indentation in output of selftest.c
2016-05-19 00:16:58 +01:00
Simon Butcher
3a3159a674 Merge pull request #476 from pjbakker/numbered-tests-ssl-opt
Update ssl-opt.sh capabilities to help with debugging
2016-05-19 00:16:18 +01:00
Simon Butcher
a81d08a93c Merge pull request #473 from pjbakker/iotssl-694-config-warnings
Add check to prevent enabling of RSA without selecting PKCS version(s)
2016-05-19 00:10:53 +01:00
Brian Murray
a8a318db45 fix indentation in output of selftest.c 2016-05-18 14:38:02 -07:00
Simon Butcher
94bafdf834 Merge branch 'development' 2016-05-18 18:40:46 +01:00
Paul Bakker
d7392c44e9 Merge branch 'ssl-opt-regression' into development 2016-05-18 10:29:42 +01:00
Simon Butcher
edb7fd9d76 Fixes stdlib.h dependencies in test suites
Moved stdlib.h in test suites, so platforms that don't support
MBEDTLS_PLATFORM_C would build.
2016-05-17 13:35:51 +01:00
Simon Butcher
db0feca55c Fixes platform time_t abstraction
Fixes platform abstraction in error.c and the file that it's generated
from as well as DTLS samples.
2016-05-17 00:03:14 +01:00
Simon Butcher
c21bec8af4 Merge branch 'development' 2016-05-16 16:15:20 +01:00
Paul Bakker
f8e3794792 Update ChangeLog to reflect 2016-05-13 10:50:41 +01:00