Skip to content

Commit 65f6188

Browse files
mbed TLS 2.4.2, Virgil Security 2.0.2
2 parents f233d8e + ec93412 commit 65f6188

File tree

114 files changed

+1912
-1178
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+1912
-1178
lines changed

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ if(CMAKE_COMPILER_IS_CLANG)
9292
endif(CMAKE_COMPILER_IS_CLANG)
9393

9494
if(MSVC)
95-
set(CMAKE_C_FLAGS_CHECK "/WX")
95+
# Strictest warnings, and treat as errors
96+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3")
97+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")
9698
endif(MSVC)
9799

98100
if(CMAKE_BUILD_TYPE STREQUAL "Coverage")

ChangeLog

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,80 @@
11
mbed TLS ChangeLog (Sorted per branch, date)
22

3+
= mbed TLS 2.4.2 branch released 2017-03-08
4+
5+
Security
6+
* Add checks to prevent signature forgeries for very large messages while
7+
using RSA through the PK module in 64-bit systems. The issue was caused by
8+
some data loss when casting a size_t to an unsigned int value in the
9+
functions rsa_verify_wrap(), rsa_sign_wrap(), rsa_alt_sign_wrap() and
10+
mbedtls_pk_sign(). Found by Jean-Philippe Aumasson.
11+
* Fixed potential livelock during the parsing of a CRL in PEM format in
12+
mbedtls_x509_crl_parse(). A string containing a CRL followed by trailing
13+
characters after the footer could result in the execution of an infinite
14+
loop. The issue can be triggered remotely. Found by Greg Zaverucha,
15+
Microsoft.
16+
* Removed MD5 from the allowed hash algorithms for CertificateRequest and
17+
CertificateVerify messages, to prevent SLOTH attacks against TLS 1.2.
18+
Introduced by interoperability fix for #513.
19+
* Fixed a bug that caused freeing a buffer that was allocated on the stack,
20+
when verifying the validity of a key on secp224k1. This could be
21+
triggered remotely for example with a maliciously constructed certificate
22+
and potentially could lead to remote code execution on some platforms.
23+
Reported independently by rongsaws and Aleksandar Nikolic, Cisco Talos
24+
team. #569 CVE-2017-2784
25+
26+
Bugfix
27+
* Fix output certificate verification flags set by x509_crt_verify_top() when
28+
traversing a chain of trusted CA. The issue would cause both flags,
29+
MBEDTLS_X509_BADCERT_NOT_TRUSTED and MBEDTLS_X509_BADCERT_EXPIRED, to be
30+
set when the verification conditions are not met regardless of the cause.
31+
Found by Harm Verhagen and inestlerode. #665 #561
32+
* Fix the redefinition of macro ssl_set_bio to an undefined symbol
33+
mbedtls_ssl_set_bio_timeout in compat-1.3.h, by removing it.
34+
Found by omlib-lin. #673
35+
* Fix unused variable/function compilation warnings in pem.c, x509_crt.c and
36+
x509_csr.c that are reported when building mbed TLS with a config.h that
37+
does not define MBEDTLS_PEM_PARSE_C. Found by omnium21. #562
38+
* Fix incorrect renegotiation condition in ssl_check_ctr_renegotiate() that
39+
would compare 64 bits of the record counter instead of 48 bits as indicated
40+
in RFC 6347 Section 4.3.1. This could cause the execution of the
41+
renegotiation routines at unexpected times when the protocol is DTLS. Found
42+
by wariua. #687
43+
* Fixed multiple buffer overreads in mbedtls_pem_read_buffer() when parsing
44+
the input string in PEM format to extract the different components. Found
45+
by Eyal Itkin.
46+
* Fixed potential arithmetic overflow in mbedtls_ctr_drbg_reseed() that could
47+
cause buffer bound checks to be bypassed. Found by Eyal Itkin.
48+
* Fixed potential arithmetic overflows in mbedtls_cipher_update() that could
49+
cause buffer bound checks to be bypassed. Found by Eyal Itkin.
50+
* Fixed potential arithmetic overflow in mbedtls_md2_update() that could
51+
cause buffer bound checks to be bypassed. Found by Eyal Itkin.
52+
* Fixed potential arithmetic overflow in mbedtls_base64_decode() that could
53+
cause buffer bound checks to be bypassed. Found by Eyal Itkin.
54+
* Fixed heap overreads in mbedtls_x509_get_time(). Found by Peng
55+
Li/Yueh-Hsun Lin, KNOX Security, Samsung Research America.
56+
* Fix potential memory leak in mbedtls_x509_crl_parse(). The leak was caused
57+
by missing calls to mbedtls_pem_free() in cases when a
58+
MBEDTLS_ERR_PEM_NO_HEADER_FOOTER_PRESENT error was encountered. Found and
59+
fix proposed by Guido Vranken. #722
60+
* Fixed the templates used to generate project and solution files for Visual
61+
Studio 2015 as well as the files themselves, to remove a build warning
62+
generated in Visual Studio 2015. Reported by Steve Valliere. #742
63+
* Fix a resource leak in ssl_cookie, when using MBEDTLS_THREADING_C.
64+
Raised and fix suggested by Alan Gillingham in the mbed TLS forum. #771
65+
* Fix 1 byte buffer overflow in mbedtls_mpi_write_string() when the MPI
66+
number to write in hexadecimal is negative and requires an odd number of
67+
digits. Found and fixed by Guido Vranken.
68+
* Fix unlisted DES configuration dependency in some pkparse test cases. Found
69+
by inestlerode. #555
70+
71+
= mbed TLS 2.4.1 branch released 2016-12-13
72+
73+
Changes
74+
* Update to CMAC test data, taken from - NIST Special Publication 800-38B -
75+
Recommendation for Block Cipher Modes of Operation: The CMAC Mode for
76+
Authentication – October 2016
77+
378
= mbed TLS 2.4.0 branch released 2016-10-17
479

580
Security

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,15 @@ Configurations
156156

157157
We provide some non-standard configurations focused on specific use cases in the `configs/` directory. You can read more about those in `configs/README.txt`
158158

159+
Porting mbed TLS
160+
----------------
161+
162+
mbed TLS can be ported to many different architectures, OS's and platforms. Before starting a port, you may find the following knowledge base articles useful:
163+
164+
- [Porting mbed TLS to a new environment or OS](https://tls.mbed.org/kb/how-to/how-do-i-port-mbed-tls-to-a-new-environment-OS)
165+
- [What external dependencies does mbed TLS rely on?](https://tls.mbed.org/kb/development/what-external-dependencies-does-mbedtls-rely-on)
166+
- [How do I configure mbed TLS](https://tls.mbed.org/kb/compiling-and-building/how-do-i-configure-mbedtls)
167+
159168
Contributing
160169
------------
161170

@@ -165,7 +174,7 @@ We gratefully accept bug reports and contributions from the community. There are
165174
- We would ask that contributions conform to [our coding standards](https://tls.mbed.org/kb/development/mbedtls-coding-standards), and that contributions should be fully tested before submission.
166175
- As with any open source project, contributions will be reviewed by the project team and community and may need some modifications to be accepted.
167176

168-
To accept the Contributor’s Licence Agreement (CLA), individual contributors can do this by creating an mbed account and [accepting the online agreement here with a click through](https://developer.mbed.org/contributor_agreement/). Alternatively, for contributions from corporations, or those that do not wish to create an mbed account, a slightly different agreeement can be found [here](https://www.mbed.com/en/about-mbed/contributor-license-agreements/). This agreement should be signed and returned to ARM as described in the instructions given.
177+
To accept the Contributor’s Licence Agreement (CLA), individual contributors can do this by creating an mbed account and [accepting the online agreement here with a click through](https://developer.mbed.org/contributor_agreement/). Alternatively, for contributions from corporations, or those that do not wish to create an mbed account, a slightly different agreement can be found [here](https://www.mbed.com/en/about-mbed/contributor-license-agreements/). This agreement should be signed and returned to ARM as described in the instructions given.
169178

170179
### Making a Contribution
171180

VirgilChangeLog

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
Virgil Security ChangeLog (Sorted per version, date)
22

3+
= Virgil Security 2.0.2 released 2016-03-22
4+
5+
Bugfix
6+
* Update to mbed TLS version 2.4.2
7+
* Return error MBEDTLS_ERR_PK_PASSWORD_REQUIRED if private key is really encrypted
8+
9+
310
= Virgil Security 2.0.1 released 2016-12-07
411

512
Changes

doxygen/input/doc_mainpage.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*/
2222

2323
/**
24-
* @mainpage mbed TLS v2.4.0 source code documentation
24+
* @mainpage mbed TLS v2.4.2 source code documentation
2525
*
2626
* This documentation describes the internal structure of mbed TLS. It was
2727
* automatically generated from specially formatted comment blocks in

doxygen/mbedtls.doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ DOXYFILE_ENCODING = UTF-8
2828
# identify the project. Note that if you do not use Doxywizard you need
2929
# to put quotes around the project name if it contains spaces.
3030

31-
PROJECT_NAME = "mbed TLS v2.4.0"
31+
PROJECT_NAME = "mbed TLS v2.4.2"
3232

3333
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
3434
# This could be handy for archiving the generated documentation or

include/mbedtls/cmac.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,13 @@ struct mbedtls_cmac_context_t
5858
/**
5959
* \brief Set the CMAC key and prepare to authenticate the input
6060
* data.
61-
* Should be called with an initialised cipher context.
61+
* Should be called with an initialized cipher context.
6262
*
63-
* \param ctx Cipher context
63+
* \param ctx Cipher context. This should be a cipher context,
64+
* initialized to be one of the following types:
65+
* MBEDTLS_CIPHER_AES_128_ECB, MBEDTLS_CIPHER_AES_192_ECB,
66+
* MBEDTLS_CIPHER_AES_256_ECB or
67+
* MBEDTLS_CIPHER_DES_EDE3_ECB.
6468
* \param key CMAC key
6569
* \param keybits length of the CMAC key in bits
6670
* (must be acceptable by the cipher)
@@ -115,7 +119,7 @@ int mbedtls_cipher_cmac_finish( mbedtls_cipher_context_t *ctx,
115119
int mbedtls_cipher_cmac_reset( mbedtls_cipher_context_t *ctx );
116120

117121
/**
118-
* \brief Output = Generic_CMAC( hmac key, input buffer )
122+
* \brief Output = Generic_CMAC( cmac key, input buffer )
119123
*
120124
* \param cipher_info message digest info
121125
* \param key CMAC key

include/mbedtls/compat-1.3.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2453,7 +2453,6 @@
24532453
#define ssl_set_arc4_support mbedtls_ssl_conf_arc4_support
24542454
#define ssl_set_authmode mbedtls_ssl_conf_authmode
24552455
#define ssl_set_bio mbedtls_ssl_set_bio
2456-
#define ssl_set_bio mbedtls_ssl_set_bio_timeout
24572456
#define ssl_set_ca_chain mbedtls_ssl_conf_ca_chain
24582457
#define ssl_set_cbc_record_splitting mbedtls_ssl_conf_cbc_record_splitting
24592458
#define ssl_set_ciphersuites mbedtls_ssl_conf_ciphersuites

include/mbedtls/config.h

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1564,7 +1564,7 @@
15641564
* library/pkwrite.c
15651565
* library/x509_create.c
15661566
* library/x509write_crt.c
1567-
* library/mbedtls_x509write_csr.c
1567+
* library/x509write_csr.c
15681568
*/
15691569
#define MBEDTLS_ASN1_WRITE_C
15701570

@@ -1925,7 +1925,7 @@
19251925
*
19261926
* Enable the generic message digest layer.
19271927
*
1928-
* Module: library/mbedtls_md.c
1928+
* Module: library/md.c
19291929
* Caller:
19301930
*
19311931
* Uncomment to enable generic message digest wrappers.
@@ -1937,7 +1937,7 @@
19371937
*
19381938
* Enable the MD2 hash algorithm.
19391939
*
1940-
* Module: library/mbedtls_md2.c
1940+
* Module: library/md2.c
19411941
* Caller:
19421942
*
19431943
* Uncomment to enable support for (rare) MD2-signed X.509 certs.
@@ -1949,7 +1949,7 @@
19491949
*
19501950
* Enable the MD4 hash algorithm.
19511951
*
1952-
* Module: library/mbedtls_md4.c
1952+
* Module: library/md4.c
19531953
* Caller:
19541954
*
19551955
* Uncomment to enable support for (rare) MD4-signed X.509 certs.
@@ -1961,8 +1961,8 @@
19611961
*
19621962
* Enable the MD5 hash algorithm.
19631963
*
1964-
* Module: library/mbedtls_md5.c
1965-
* Caller: library/mbedtls_md.c
1964+
* Module: library/md5.c
1965+
* Caller: library/md.c
19661966
* library/pem.c
19671967
* library/ssl_tls.c
19681968
*
@@ -2055,11 +2055,11 @@
20552055
* library/rsa.c
20562056
* library/x509.c
20572057
* library/x509_create.c
2058-
* library/mbedtls_x509_crl.c
2059-
* library/mbedtls_x509_crt.c
2060-
* library/mbedtls_x509_csr.c
2058+
* library/x509_crl.c
2059+
* library/x509_crt.c
2060+
* library/x509_csr.c
20612061
* library/x509write_crt.c
2062-
* library/mbedtls_x509write_csr.c
2062+
* library/x509write_csr.c
20632063
*
20642064
* This modules translates between OIDs and internal values.
20652065
*/
@@ -2087,9 +2087,9 @@
20872087
* Module: library/pem.c
20882088
* Caller: library/dhm.c
20892089
* library/pkparse.c
2090-
* library/mbedtls_x509_crl.c
2091-
* library/mbedtls_x509_crt.c
2092-
* library/mbedtls_x509_csr.c
2090+
* library/x509_crl.c
2091+
* library/x509_crt.c
2092+
* library/x509_csr.c
20932093
*
20942094
* Requires: MBEDTLS_BASE64_C
20952095
*
@@ -2105,7 +2105,7 @@
21052105
* Module: library/pem.c
21062106
* Caller: library/pkwrite.c
21072107
* library/x509write_crt.c
2108-
* library/mbedtls_x509write_csr.c
2108+
* library/x509write_csr.c
21092109
*
21102110
* Requires: MBEDTLS_BASE64_C
21112111
*
@@ -2135,8 +2135,8 @@
21352135
* Enable the generic public (asymetric) key parser.
21362136
*
21372137
* Module: library/pkparse.c
2138-
* Caller: library/mbedtls_x509_crt.c
2139-
* library/mbedtls_x509_csr.c
2138+
* Caller: library/x509_crt.c
2139+
* library/x509_csr.c
21402140
*
21412141
* Requires: MBEDTLS_PK_C
21422142
*
@@ -2241,8 +2241,8 @@
22412241
*
22422242
* Enable the RIPEMD-160 hash algorithm.
22432243
*
2244-
* Module: library/mbedtls_ripemd160.c
2245-
* Caller: library/mbedtls_md.c
2244+
* Module: library/ripemd160.c
2245+
* Caller: library/md.c
22462246
*
22472247
*/
22482248
#define MBEDTLS_RIPEMD160_C
@@ -2282,8 +2282,8 @@
22822282
*
22832283
* Enable the SHA1 cryptographic hash algorithm.
22842284
*
2285-
* Module: library/mbedtls_sha1.c
2286-
* Caller: library/mbedtls_md.c
2285+
* Module: library/sha1.c
2286+
* Caller: library/md.c
22872287
* library/ssl_cli.c
22882288
* library/ssl_srv.c
22892289
* library/ssl_tls.c
@@ -2298,9 +2298,9 @@
22982298
*
22992299
* Enable the SHA-224 and SHA-256 cryptographic hash algorithms.
23002300
*
2301-
* Module: library/mbedtls_sha256.c
2301+
* Module: library/sha256.c
23022302
* Caller: library/entropy.c
2303-
* library/mbedtls_md.c
2303+
* library/md.c
23042304
* library/ssl_cli.c
23052305
* library/ssl_srv.c
23062306
* library/ssl_tls.c
@@ -2315,9 +2315,9 @@
23152315
*
23162316
* Enable the SHA-384 and SHA-512 cryptographic hash algorithms.
23172317
*
2318-
* Module: library/mbedtls_sha512.c
2318+
* Module: library/sha512.c
23192319
* Caller: library/entropy.c
2320-
* library/mbedtls_md.c
2320+
* library/md.c
23212321
* library/ssl_cli.c
23222322
* library/ssl_srv.c
23232323
*
@@ -2465,9 +2465,9 @@
24652465
* Enable X.509 core for using certificates.
24662466
*
24672467
* Module: library/x509.c
2468-
* Caller: library/mbedtls_x509_crl.c
2469-
* library/mbedtls_x509_crt.c
2470-
* library/mbedtls_x509_csr.c
2468+
* Caller: library/x509_crl.c
2469+
* library/x509_crt.c
2470+
* library/x509_csr.c
24712471
*
24722472
* Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_BIGNUM_C, MBEDTLS_OID_C,
24732473
* MBEDTLS_PK_PARSE_C
@@ -2481,7 +2481,7 @@
24812481
*
24822482
* Enable X.509 certificate parsing.
24832483
*
2484-
* Module: library/mbedtls_x509_crt.c
2484+
* Module: library/x509_crt.c
24852485
* Caller: library/ssl_cli.c
24862486
* library/ssl_srv.c
24872487
* library/ssl_tls.c
@@ -2497,8 +2497,8 @@
24972497
*
24982498
* Enable X.509 CRL parsing.
24992499
*
2500-
* Module: library/mbedtls_x509_crl.c
2501-
* Caller: library/mbedtls_x509_crt.c
2500+
* Module: library/x509_crl.c
2501+
* Caller: library/x509_crt.c
25022502
*
25032503
* Requires: MBEDTLS_X509_USE_C
25042504
*
@@ -2511,7 +2511,7 @@
25112511
*
25122512
* Enable X.509 Certificate Signing Request (CSR) parsing.
25132513
*
2514-
* Module: library/mbedtls_x509_csr.c
2514+
* Module: library/x509_csr.c
25152515
* Caller: library/x509_crt_write.c
25162516
*
25172517
* Requires: MBEDTLS_X509_USE_C

include/mbedtls/rsa.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ int mbedtls_rsa_check_pub_priv( const mbedtls_rsa_context *pub, const mbedtls_rs
206206
* \return 0 if successful, or an MBEDTLS_ERR_RSA_XXX error code
207207
*
208208
* \note This function does NOT take care of message
209-
* padding. Also, be sure to set input[0] = 0 or assure that
209+
* padding. Also, be sure to set input[0] = 0 or ensure that
210210
* input is smaller than N.
211211
*
212212
* \note The input and output buffers must be large

0 commit comments

Comments
 (0)