1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-16 07:21:53 +03:00
Commit Graph

7238 Commits

Author SHA1 Message Date
a8332637d7 Fix ret code in rsa_verify_pss.c 2018-06-14 22:59:57 +01:00
0a860f6301 Fix ret code in rsa_verify.c 2018-06-14 22:59:57 +01:00
3c41e564f8 Fix ret code in rsa_sign_pss.c 2018-06-14 22:59:57 +01:00
1a66056c77 Fix ret code in rsa_sign.c 2018-06-14 22:59:57 +01:00
70e1ffdacd Fix ret code in rsa_genkey.c 2018-06-14 22:59:57 +01:00
ed68488e28 Fix ret code in key_app_writer.c 2018-06-14 22:59:57 +01:00
0faf1a5c01 Fix ret code in key_app.c 2018-06-14 22:59:57 +01:00
208c217dfa Fix ret code in gen_key.c 2018-06-14 22:59:57 +01:00
2602a1fbc5 Fix ret code in ecdsa.c 2018-06-14 22:59:57 +01:00
03a992c817 Fix ret code in dh_server.c 2018-06-14 22:59:57 +01:00
d6bfeff289 Fix ret code in dh_genprime.c 2018-06-14 22:59:57 +01:00
898841dc71 Fix ret code in dh_client.c 2018-06-14 22:59:57 +01:00
4c47df6f3f Fix ret code in crypt_and_hash.c 2018-06-14 22:59:57 +01:00
388c1b124e Fix ret code in aescrypt2.c 2018-06-14 22:59:57 +01:00
ace05929e8 Fix harmless use of uninitialized memory in ssl_parse_encrypted_pms
In ssl_parse_encrypted_pms, some operational failures from
ssl_decrypt_encrypted_pms lead to diff being set to a value that
depended on some uninitialized unsigned char and size_t values. This didn't
affect the behavior of the program (assuming an implementation with no
trap values for size_t) because all that matters is whether diff is 0,
but Valgrind rightfully complained about the use of uninitialized
memory. Behave nicely and initialize the offending memory.
2018-06-14 13:26:52 +02:00
c306a059d1 SSL async tests: add a few test cases for error in decrypt
The code paths in the library are different for decryption and for
signature. Improve the test coverage by doing some error path tests
for decryption in addition to signature.
2018-06-14 13:26:52 +02:00
4481744538 Fix memory leak in ssl_server2 with SNI + async callback
In ssl_server2, the private key objects are normally local variables
of the main function. However this does not hold for private keys in
the SNI configuration. When async callbacks are used, the test code
transfers the ownership of the private keys to the async callbacks.
Therefore the test code must free the SNI private keys through the
async callbacks (but it must not free the straight private keys this
way since they are not even heap-allocated).
2018-06-14 13:26:52 +02:00
e247989061 SNI + SSL async callback: make all keys async
When testing async callbacks with SNI, make all the keys async, not
just the first one. Otherwise the test is fragile with respect to
whether a key is used directly or through the async callbacks.
2018-06-14 13:26:52 +02:00
2636fade52 ssl_async_resume: free the operation context on error 2018-06-14 13:26:52 +02:00
f5a9996088 ssl_server2: get op_name from context in ssl_async_resume as well 2018-06-14 13:26:52 +02:00
ef30742a27 Clarify "as directed here" in SSL async callback documentation 2018-06-14 13:26:51 +02:00
7457933a04 SSL async callbacks documentation: clarify resource cleanup
Clarify when resume must clean up resources and when cancel is called.
2018-06-14 13:26:51 +02:00
3dae1cfa3a Async callback: use mbedtls_pk_check_pair to compare keys
In the current test code, the object that is used as a public key in
the certificate also contains a private key. However this is because
of the way the stest code is built and does not demonstrate the API in
a useful way. Use mbedtls_pk_check_pair, which is not what real-world
code would do (since the private key would typically be in an external
cryptoprocessor) but is a more representative placeholder.
2018-06-14 13:26:51 +02:00
a668c60186 Rename mbedtls_ssl_async_{get,set}_data for clarity
Rename to mbedtls_ssl_get_async_operation_data and
mbedtls_ssl_set_async_operation_data so that they're about
"async operation data" and not about some not-obvious "data".
2018-06-14 13:26:51 +02:00
02b86d0415 Fix copypasta in the async callback documentation 2018-06-14 13:26:51 +02:00
166ce748cf SSL async callback: cert is not always from mbedtls_ssl_conf_own_cert
The certificate passed to async callbacks may not be the one set by
mbedtls_ssl_conf_own_cert. For example, when using an SNI callback,
it's whatever the callback is using. Document this, and add a test
case (and code sample) with SNI.
2018-06-14 13:26:51 +02:00
d6fbfde994 ssl_async_set_key: detect if ctx->slots overflows 2018-06-14 13:26:51 +02:00
07981585d3 Fix missing continuation indicator in ssl-opt.sh 2018-06-14 13:26:51 +02:00
20e2bdf4b0 SSL async tests: tighten a few log checks in some test cases 2018-06-14 13:26:51 +02:00
94e153af77 Improve documentation of the async callback's crypto parameters 2018-06-14 13:26:51 +02:00
37d417561d Add test case for SSL async resume after resume
Add a test case for SSL asynchronous signature where f_async_resume is
called twice. Verify that f_async_sign_start is only called once.

This serves as a non-regression test for a bug where f_async_sign_start
was only called once, which turned out to be due to a stale build
artifacts with mismatched numerical values of
MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS.
2018-06-14 13:26:51 +02:00
4d9ec4dcf7 Fix uninitialized variable in ssl_server2 2018-06-14 13:26:51 +02:00
6331d78675 Don't use the printf format %zd
We target C89 libc, so don't use %zd or %zu. Just use %u, and make
slot numbers `unsigned` for simplicity.
2018-06-14 13:26:51 +02:00
03af7f6ae7 Change boolean bitfield to unsigned
Reminder to self: 1 is not a valid value in a 1-bit bitfield. It's
undefined behavior and gcc -ansi -pedantic helpfully complains about it.
2018-06-14 13:26:51 +02:00
ff2f493432 config: List cipher modes in alphabetical order
Keeping the cipher modes list in alphabetical order makes it easier to
find things. Move OFB and XTS to their appropriate locations in the
list.
2018-06-14 11:42:27 +01:00
4ab8acd696 Merge remote-tracking branch 'public/pr/1075' into development 2018-06-14 10:34:44 +01:00
6ac1cf6f5f Merge remote-tracking branch 'public/pr/1182' into development 2018-06-14 10:33:29 +01:00
e5cd86874e Add ChangeLog entry for PR #1555
Adds ChangeLog entry for PR #1555, 'Only redefine _WIN32_WINNT macro when <
0x0501'
2018-06-14 10:30:19 +01:00
c1bf1aaee5 Merge remote-tracking branch 'public/pr/1555' into development 2018-06-14 10:24:56 +01:00
73a4b80475 Merge remote-tracking branch 'public/pr/1672' into development 2018-06-14 10:24:02 +01:00
9a8db56959 Merge remote-tracking branch 'public/pr/1730' into development 2018-06-14 10:23:29 +01:00
2ff0e52087 Fix missing preprocessor condition in AES self-test
The AES OFB self-test made use of a variable `offset` but failed to have a
preprocessor condition around it, so unless CTR and CBC were enabled, the
variable would be undeclared.
2018-06-14 09:57:07 +01:00
c03059db42 Simplify code in mbedtls_x509_csr_parse 2018-06-14 07:35:11 +02:00
0a8352b4c2 Fix harmless use of uninitialized memory in ssl_parse_encrypted_pms
In ssl_parse_encrypted_pms, some operational failures from
ssl_decrypt_encrypted_pms lead to diff being set to a value that
depended on some uninitialized unsigned char and size_t values. This didn't
affect the behavior of the program (assuming an implementation with no
trap values for size_t) because all that matters is whether diff is 0,
but Valgrind rightfully complained about the use of uninitialized
memory. Behave nicely and initialize the offending memory.
2018-06-13 18:21:25 +02:00
725f1cb6bd SSL async tests: add a few test cases for error in decrypt
The code paths in the library are different for decryption and for
signature. Improve the test coverage by doing some error path tests
for decryption in addition to signature.
2018-06-13 18:10:41 +02:00
3f3ada8839 Fix memory leak in ssl_server2 with SNI + async callback
In ssl_server2, the private key objects are normally local variables
of the main function. However this does not hold for private keys in
the SNI configuration. When async callbacks are used, the test code
transfers the ownership of the private keys to the async callbacks.
Therefore the test code must free the SNI private keys through the
async callbacks (but it must not free the straight private keys this
way since they are not even heap-allocated).
2018-06-13 18:09:28 +02:00
157f6d8f74 SNI + SSL async callback: make all keys async
When testing async callbacks with SNI, make all the keys async, not
just the first one. Otherwise the test is fragile with respect to
whether a key is used directly or through the async callbacks.
2018-06-13 18:06:51 +02:00
d906b818f3 tests: cipher: Allocate enough space for XTS keys
XTS keys can be double the size, since XTS uses two keys concatenated
together as a key (one for the tweak, one for encryption).
2018-06-13 12:16:25 +01:00
09317083b5 benchmark: Add comma at end of help message
The help message was missing a comma after "hmac_drbg". Add the missing
comma.
2018-06-13 12:16:25 +01:00
f4474e79ef ChangeLog: Add an entry for AES-XTS 2018-06-13 12:14:41 +01:00