Hanno Becker
ad17fe9c37
Fix overly strict bounds check in ssl_parse_certificate_request()
2018-08-16 15:51:34 +01:00
Manuel Pégourié-Gonnard
19c62f90e4
Add test for session resumption
2018-08-16 10:50:39 +02:00
Manuel Pégourié-Gonnard
7e89c17788
Fix two typos in comments
2018-08-16 10:01:47 +02:00
Manuel Pégourié-Gonnard
b747c6cf9b
Add basic first tests for MTU setting
...
For now, just check that it causes us to fragment. More tests are coming in
follow-up commits to ensure we respect the exact value set, including when
renegotiating.
2018-08-16 10:01:47 +02:00
Manuel Pégourié-Gonnard
637e234d9f
Merge remote-tracking branch 'public/pr/1915' into iotssl-165-dtls-hs-fragmentation-new
...
* public/pr/1915:
Adapt ChangeLog
Fix mbedtls_ssl_get_record_expansion() for ChaChaPoly and CBC
2018-08-16 10:01:21 +02:00
Manuel Pégourié-Gonnard
9468ff1966
Implement support for MTU setting
2018-08-16 10:01:10 +02:00
Manuel Pégourié-Gonnard
0b1d9b2c75
Declare ssl_conf_mtu()
2018-08-16 10:01:10 +02:00
Manuel Pégourié-Gonnard
2cb17e201b
Make handshake fragmentation follow max_frag_len
...
Note: no interop tests in ssl-opt.sh for now, as some of them make us run into
bugs in (the CI's default versions of) OpenSSL and GnuTLS, so interop tests
will be added later once the situation is clarified. <- TODO
2018-08-16 10:01:10 +02:00
Manuel Pégourié-Gonnard
28f4beab1c
Start implementing fragmentation
2018-08-16 10:01:10 +02:00
Manuel Pégourié-Gonnard
87a346f64e
Always save flight first, (re)send later
...
This will allow fragmentation to always happen in the same place, always from
a buffer distinct from ssl->out_msg, and with the same way of resuming after
returning WANT_WRITE
2018-08-16 10:01:10 +02:00
Manuel Pégourié-Gonnard
9c3a8caa92
Clarify code a bit in write_handshake_msg()
...
- take advantage of the fact that we're only called for first send
- put all sanity checks at the top
- rename and constify shortcut variables
- improve comments
2018-08-16 10:00:35 +02:00
Manuel Pégourié-Gonnard
31c1586893
Start separating handshake from record writing
2018-08-16 10:00:27 +02:00
Hanno Becker
7864090ec1
Reset session_in/out pointers in ssl_session_reset_int()
...
Fixes #1941 .
2018-08-13 16:35:15 +01:00
Ron Eldor
d1a4762adb
Use mbedtls_printf instead of printf
...
Replace usages of `printf()` with `mbedtls_printf()` in `aria.c`
which were accidently merged. Fixes #1908
2018-08-13 13:49:52 +03:00
Jaeden Amero
d8f41698d2
Merge remote-tracking branch 'upstream-public/pr/1598' into development
...
Add a Changelog entry
2018-08-10 11:23:15 +01:00
Jaeden Amero
cac0c1a250
Merge remote-tracking branch 'upstream-public/pr/1378' into development
2018-08-10 10:59:53 +01:00
Hanno Becker
5b559ac7ab
Fix mbedtls_ssl_get_record_expansion() for ChaChaPoly and CBC
...
`mbedtls_ssl_get_record_expansion()` is supposed to return the maximum
difference between the size of a protected record and the size of the
encapsulated plaintext.
It had the following two bugs:
(1) It did not consider the new ChaChaPoly ciphersuites, returning
the error code #MBEDTLS_ERR_SSL_INTERNAL_ERROR in this case.
(2) It did not correctly estimate the maximum record expansion in case
of CBC ciphersuites in (D)TLS versions 1.1 and higher, in which
case the ciphertext is prefixed by an explicit IV.
This commit fixes both bugs.
2018-08-03 10:07:35 +01:00
k-stachowiak
9f7798ed3f
Revert change of a return variable name
2018-07-31 16:52:32 +02:00
Ron Eldor
1b9b217abf
enforce input and output of ccm selftest on stack
...
In `mbedtls_ccm_self_test()`, enforce input and output
buffers sent to the ccm API to be contigous and aligned,
by copying the test vectors to buffers on the stack.
2018-07-30 11:29:26 +03:00
Angus Gratton
608a487b9c
Fix memory leak in ecp_mul_comb() if ecp_precompute_comb() fails
...
In ecp_mul_comb(), if (!p_eq_g && grp->T == NULL) and then ecp_precompute_comb() fails (which can
happen due to OOM), then the new array of points T will be leaked (as it's newly allocated, but
hasn't been asigned to grp->T yet).
Symptom was a memory leak in ECDHE key exchange under low memory conditions.
2018-07-27 09:15:34 +10:00
Jaeden Amero
193c86425e
Update version to 2.12.0
2018-07-25 15:42:26 +01:00
Simon Butcher
37b9fd5df6
Merge remote-tracking branch 'restricted/pr/490' into development
2018-07-24 23:40:37 +01:00
Simon Butcher
2c92949e0a
Merge remote-tracking branch 'public/pr/1198' into development
2018-07-24 17:20:17 +01:00
Simon Butcher
c88c627fba
Merge remote-tracking branch 'public/pr/1658' into development
2018-07-24 17:19:10 +01:00
Ron Eldor
9ab746c7c9
Add selftests
...
Add selftests for key wrapping
2018-07-24 16:43:20 +01:00
Ron Eldor
cb349ac279
Implement the KW and KWP algorithm
...
1. Add kw to the Makefiles
2. Implement the algorithms as defined in SP800-38F, and RFC 3394.
2018-07-24 16:43:20 +01:00
Ron Eldor
466a57fbbe
Key wrapping API definition
...
Define the Key Wrapping API
2018-07-24 16:43:20 +01:00
Simon Butcher
dad05b7fc9
Merge remote-tracking branch 'public/pr/1844' into development
2018-07-24 13:05:09 +01:00
k-stachowiak
c9a5f02eab
Move comment to a separate line
2018-07-24 13:53:31 +02:00
Simon Butcher
116ac43d00
Merge remote-tracking branch 'public/pr/1852' into development
2018-07-24 12:18:59 +01:00
k-stachowiak
463928a74b
Fix code formatting
2018-07-24 12:50:59 +02:00
Simon Butcher
fced1f2fb3
Merge remote-tracking branch 'public/pr/1854' into development
2018-07-24 10:26:46 +01:00
Brian J Murray
ca2ea4e217
Fix issue if salt = NULL and salt_len !=0 in mbedtls_hkdf_extract()
2018-07-23 10:34:47 -07:00
Angus Gratton
1a7a17e548
Check for invalid short Alert messages
...
(Short Change Cipher Spec & Handshake messages are already checked for.)
2018-07-20 23:09:29 +01:00
Angus Gratton
34817929ea
TLSv1.2: Treat zero-length fragments as invalid, unless they are application data
...
TLS v1.2 explicitly disallows other kinds of zero length fragments (earlier standards
don't mention zero-length fragments at all).
2018-07-20 23:09:29 +01:00
Angus Gratton
b512bc1d29
CBC mode: Allow zero-length message fragments (100% padding)
...
Fixes https://github.com/ARMmbed/mbedtls/issues/1632
2018-07-20 23:09:29 +01:00
Simon Butcher
922bd1efb2
Merge remote-tracking branch 'public/pr/1752' into development
2018-07-20 14:33:18 +01:00
Simon Butcher
df15356259
Merge remote-tracking branch 'public/pr/1663' into development
2018-07-19 19:48:10 +01:00
k-stachowiak
21feae58cb
Update change log
2018-07-11 17:34:55 +02:00
k-stachowiak
a47911cb70
Fix memory leak in ssl_setup
2018-07-11 17:26:07 +02:00
Dawid Drozd
0e2c07e83e
Remove unnecessary mark as unused #1098
...
`ret` is used always at line 1305 in statement:
`if( ( ret = pk_parse_key_pkcs8_unencrypted_der( pk, key, keylen ) ) == 0 )`
2018-07-11 15:16:53 +02:00
Manuel Pégourié-Gonnard
8744a02357
Clarify a few comments
...
The "+" sign could be misinterpreted as addition.
2018-07-11 12:30:40 +02:00
Simon Butcher
e7aeef09ee
Merge remote-tracking branch 'public/pr/536' into development
2018-07-10 15:24:26 +01:00
Simon Butcher
32b074720e
Merge remote-tracking branch 'public/pr/1737' into development
2018-07-10 14:57:50 +01:00
Simon Butcher
cdbb2f2168
Merge remote-tracking branch 'public/pr/1563' into development
2018-07-10 12:49:26 +01:00
Simon Butcher
6331cb0607
Fix some whitespace issues in ChangeLog and CMakeLists.txt
...
Stray tab in library/CMakeLists.txt and incorrect formatting in ChangeLog.
2018-07-10 11:48:42 +01:00
Simon Butcher
d21bd31759
Merge remote-tracking branch 'public/pr/1567' into development
2018-07-10 11:43:06 +01:00
Manuel Pégourié-Gonnard
6a25cfae2a
Avoid debug message that might leak length
...
The length to the debug message could conceivably leak through the time it
takes to print it, and that length would in turn reveal whether padding was
correct or not.
2018-07-10 11:15:36 +02:00
k-stachowiak
a5fbfd7cd8
Enable snprintf on FreeBSD
2018-07-08 13:22:11 +01:00
Brian J Murray
a61d123e0e
Minor changes to comments in hkdf.c
2018-07-06 10:02:39 -07:00