Commit Graph

1453 Commits

Author SHA1 Message Date
Simon Butcher
275265dc1d Merge remote-tracking branch 'public/pr/1823' into mbedtls-2.1 2018-07-10 14:34:34 +01:00
Simon Butcher
7175918621 Merge remote-tracking branch 'public/pr/1445' into mbedtls-2.1 2018-07-10 12:57:56 +01:00
Gilles Peskine
2cc7ad4cfc Fix ssl-opt.sh not starting when lsof is not available
$START_DELAY was used before it was defined.
2018-06-29 16:03:18 +02:00
Simon Butcher
e5828ce06c Merge remote-tracking branch 'public/pr/1771' into mbedtls-2.1 2018-06-28 11:38:18 +01:00
Simon Butcher
e509b4ffe0 Merge remote-tracking branch 'public/pr/1770' into mbedtls-2.1 2018-06-28 11:37:50 +01:00
Simon Butcher
e8934313e7 Merge remote-tracking branch 'public/pr/1391' into mbedtls-2.1 2018-06-22 15:08:25 +01:00
Simon Butcher
ba3e5e60f2 Merge remote-tracking branch 'public/pr/1558' into mbedtls-2.1 2018-06-22 15:07:52 +01:00
Simon Butcher
ad761c45b9 Fix multiple quality issues in the source
This PR fixes multiple issues in the source code to address issues raised by
tests/scripts/check-files.py. Specifically:
 * incorrect file permissions
 * missing newline at the end of files
 * trailing whitespace
 * Tabs present
 * TODOs in the souce code
2018-06-22 11:22:44 +01:00
Darryl Green
f8277f9cdb Add check-files.py to all.sh 2018-06-22 09:55:26 +01:00
Darryl Green
dd3c93fbf1 Add script for source integrity checking 2018-06-22 09:55:18 +01:00
Simon Butcher
6fc9ceece3 Change the library version to 2.1.13 2018-06-18 14:49:02 +01:00
Simon Butcher
b795b4fffa Merge remote-tracking branch 'public/pr/1665' into mbedtls-2.1 2018-06-17 18:02:40 +01:00
Simon Butcher
12826dfb83 Extend the timeout for SNI DTLS tests
The following tests were timing out under valgrind so now have a much
longer timeout:
    SNI: DTLS, CA no override
    SNI: DTLS, CA override with CRL
2018-06-16 19:46:52 +01:00
Simon Butcher
a5fb40d9f9 Merge remote-tracking branch 'public/pr/1465' into mbedtls-2.1 2018-06-11 11:49:28 +01:00
Simon Butcher
4ffe49e962 Merge remote-tracking branch 'public/pr/1607' into mbedtls-2.1 2018-06-01 19:42:02 +01:00
Andres Amaya Garcia
0b8eaa899d Add more SNI/DTLS tests
Run the normal SNI/TLS tests over DTLS in ssl-opt.sh for greater
coverage.
2018-05-30 08:30:07 +01:00
Andres Amaya Garcia
021ad3dc38 Rename SNI/DTLS tests in ssl-opt.sh script 2018-05-30 08:30:06 +01:00
Andres AG
52142f186f Add SNI with DTLS tests to ssl-opt.sh script 2018-05-30 08:30:03 +01:00
Jaeden Amero
eb4f2d6feb Merge remote-tracking branch 'upstream-public/pr/1488' into mbedtls-2.1-proposed 2018-05-04 11:04:33 +01:00
Andres AG
e19e4bfd88 Fix uninitialized var in check-generated-files.sh 2018-05-01 21:07:31 +01:00
Andres Amaya Garcia
ce229dfd6a Check generated-visualc-files in check-generated-files 2018-05-01 21:07:25 +01:00
Jaeden Amero
6c0fba4350 Update version to 2.1.12 2018-04-27 13:13:54 +01:00
fbrosson
0620206db3 Backport 2.1: Use "#!/usr/bin/env perl" as shebang line. 2018-04-04 22:29:59 +00:00
Azim Khan
341e3789a3 Enable SSL test scripts to dump logs on stdout 2018-04-03 17:59:56 +01:00
Gilles Peskine
225684015d Merge remote-tracking branch 'upstream-public/pr/1501' into mbedtls-2.1-proposed 2018-04-01 12:41:33 +02:00
Andrzej Kurek
a1149a70ae Add tests for "return plaintext data faster on unpadded decryption" 2018-03-30 05:00:19 -04:00
Jaeden Amero
82e288adb6 Merge remote-tracking branch 'upstream-public/pr/1494' into mbedtls-2.1-proposed 2018-03-29 10:59:43 +01:00
Jaeden Amero
478baecc06 Merge remote-tracking branch 'upstream-public/pr/1525' into mbedtls-2.1-proposed 2018-03-28 15:34:25 +01:00
Deomid Ryabkov
e42510305f Fix some test deps
* Cert revocation tests require `MBEDTLS_HAVE_TIME_DATE`.
 * Verison features tests require... well, `MBEDTLS_VERSION_FEATURES`, actually.

Fixes https://github.com/ARMmbed/mbedtls/issues/1475
2018-03-27 23:22:34 +02:00
Andres Amaya Garcia
748ddda494 Fix test dependencies of pkcs5 pbs2 on asn1 parse 2018-03-27 21:33:07 +01:00
Andres Amaya Garcia
aa3ff98b1d Fix shared library lookup on Mac OS X when running tests 2018-03-27 20:08:04 +01:00
Andres Amaya Garcia
9b2c5b7202 Make DLEXT var configurable in programs and tests makefiles 2018-03-27 20:08:03 +01:00
Gilles Peskine
9a05d1a765 Add missing dependencies in test_suite_x509parse
Found by depends-hashes.pl and depends-pkgalgs.pl.
2018-03-23 02:29:02 +01:00
Gilles Peskine
a19316965d all.sh --keep-going: properly handle multiple-builds scripts
In keep-going mode, if a multiple-builds script fails, record its
status and keep going.
2018-03-23 02:29:00 +01:00
Gilles Peskine
2a74061198 Merge tag 'mbedtls-2.1.11' into iotssl-1381-x509-verify-refactor-2.1-restricted
Conflict resolution:

* ChangeLog
* tests/data_files/Makefile: concurrent additions, order irrelevant
* tests/data_files/test-ca.opensslconf: concurrent additions, order irrelevant
* tests/scripts/all.sh: one comment change conflicted with a code
  addition. In addition some of the additions in the
  iotssl-1381-x509-verify-refactor-restricted branch need support for
  keep-going mode, this will be added in a subsequent commit.
2018-03-23 02:28:33 +01:00
Jethro Beekman
1a886ff45f Fix parsing of PKCS#8 encoded Elliptic Curve keys.
The relevant ASN.1 definitions for a PKCS#8 encoded Elliptic Curve key are:

PrivateKeyInfo ::= SEQUENCE {
  version                   Version,
  privateKeyAlgorithm       PrivateKeyAlgorithmIdentifier,
  privateKey                PrivateKey,
  attributes           [0]  IMPLICIT Attributes OPTIONAL
}

AlgorithmIdentifier  ::=  SEQUENCE  {
  algorithm   OBJECT IDENTIFIER,
  parameters  ANY DEFINED BY algorithm OPTIONAL
}

ECParameters ::= CHOICE {
  namedCurve         OBJECT IDENTIFIER
  -- implicitCurve   NULL
  -- specifiedCurve  SpecifiedECDomain
}

ECPrivateKey ::= SEQUENCE {
  version        INTEGER { ecPrivkeyVer1(1) } (ecPrivkeyVer1),
  privateKey     OCTET STRING,
  parameters [0] ECParameters {{ NamedCurve }} OPTIONAL,
  publicKey  [1] BIT STRING OPTIONAL
}

Because of the two optional fields, there are 4 possible variants that need to
be parsed: no optional fields, only parameters, only public key, and both
optional fields. Previously mbedTLS was unable to parse keys with "only
parameters". Also, only "only public key" was tested. There was a test for "no
optional fields", but it was labelled incorrectly as SEC.1 and not run because
of a great renaming mixup.
2018-03-22 18:03:30 -07:00
Gilles Peskine
aebcfbb034 all.sh: Verify out-of-tree testing with CMake
Run a test case in ssl-opt.sh to validate that testing works in an
out-of-tree CMake build.
2018-03-21 12:17:20 +01:00
Gilles Peskine
00de2fd3dd all.sh: fix cleanup happening during an out-of-tree build 2018-03-21 12:16:57 +01:00
Gilles Peskine
341ea25724 all.sh: be more conservative when cleaning up CMake artefacts
Only delete things that we expect to find, to avoid deleting other
things that people might have lying around in their build tree.
Explicitly skip .git to avoid e.g. accidentally matching a branch
name.
2018-03-21 12:15:06 +01:00
Gilles Peskine
cd0265ec85 Support out-of-tree testing with CMake
Create extra symbolic links with CMake so that SSL testing (ssl-opt.sh
and compat.sh) works in out-of-tree builds.
2018-03-21 12:12:47 +01:00
Gilles Peskine
37c88db612 all.sh: support armcc path options for compatibility with later Mbed TLS
Use $ARMC5_BIN_DIR or --armc5-bin-dir to set the location of
armcc (version 5), for compatibility with later versions of Mbed TLS.
Ignore --armc6-bin-dir for the same reason, since in 2.1 we only test
with a single version of armcc and we expect version 5. Keep
defaulting to armcc in the $PATH for backward compatibility with the
2.1 branch.
2018-03-21 12:01:20 +01:00
Gilles Peskine
32d9293dcf all.sh: add --no-yotta for compatibility with later Mbed TLS
Allow scripts to run all.sh --no-yotta unconditionally. --no-yotta
just happens to be a no-op in 2.1 since 2.1's all.sh doesn't do
anything with Yotta.
2018-03-21 12:01:12 +01:00
Gilles Peskine
243bb4ce65 all.sh: add opposites to all boolean options
All options can now be overridden by a subsequent option, e.g.
"all.sh --foo --no-foo" is equivalent to "all.sh --no-foo". This
allows making wrapper scripts with default options and occasionally
overriding those options when running the wrapper script.
2018-03-21 10:11:12 +01:00
Gilles Peskine
7efa8cf456 all.sh: option parsing: reduce vertical spread
Only whitespace changes.
2018-03-21 10:04:49 +01:00
Jaeden Amero
1c986a9859 Update version to 2.1.11 2018-03-16 16:29:30 +00:00
Jaeden Amero
23f503f12d Merge remote-tracking branch 'upstream-restricted/pr/465' into mbedtls-2.1-restricted-proposed 2018-03-14 18:32:21 +00:00
Jaeden Amero
5e50ff8f44 Merge remote-tracking branch 'upstream-restricted/pr/395' into mbedtls-2.1-restricted-proposed 2018-03-14 18:16:29 +00:00
Manuel Pégourié-Gonnard
a566dc4d45 fixup previous commit: add forgotten file 2018-03-14 14:10:43 +01:00
Manuel Pégourié-Gonnard
74b8ae89c6 x509: CRL: add tests for non-critical extension
The 'critical' boolean can be set to false in two ways:
- by leaving it implicit (test data generated by openssl)
- by explicitly setting it to false (generated by hand)
2018-03-14 12:48:04 +01:00
Manuel Pégourié-Gonnard
85f36ae0a1 x509: CRL: add tests for malformed extensions
This covers all lines added in the previous commit. Coverage was tested using:

    make CFLAGS='--coverage -g3 -O0'
    (cd tests && ./test_suite_x509parse)
    make lcov
    firefox Coverage/index.html # then visual check

Test data was generated by taking a copy of tests/data_files/crl-idp.pem,
encoding it as hex, and then manually changing the values of some bytes to
achieve the desired errors, using https://lapo.it/asn1js/ for help in locating
the desired bytes.
2018-03-14 12:48:03 +01:00