Commit graph

970 commits

Author SHA1 Message Date
Andres Amaya Garcia a0ea01d273 Fix ret code in pk_encrypt.c 2018-07-10 17:34:24 +01:00
Andres Amaya Garcia 141b4f4526 Fix ret code in pk_encrypt.c 2018-07-10 17:34:24 +01:00
Andres Amaya Garcia 81982c84d4 Fix ret code in ecdh_curve25519.c 2018-07-10 17:34:24 +01:00
Andres Amaya Garcia c899c464f6 Fix ret code in mpi_demo.c 2018-07-10 17:34:24 +01:00
Andres Amaya Garcia 6118adab09 Fix ret code in pem2der.c 2018-07-10 17:34:24 +01:00
Andres Amaya Garcia 73081c3e2f Fix ret code in ssl_cert_test.c 2018-07-10 17:34:24 +01:00
Andres Amaya Garcia 01e3d21350 Fix ret code in udp_proxy.c 2018-07-10 17:34:24 +01:00
Andres Amaya Garcia 12ab7a6884 Fix ret code in req_app.c 2018-07-10 17:34:24 +01:00
Andres Amaya Garcia 8fe4d917f7 Fix ret code in crl_app.c 2018-07-10 17:34:24 +01:00
Andres Amaya Garcia a7ac5ab2ee Fix ret code in cert_write.c 2018-07-10 17:34:24 +01:00
Andres Amaya Garcia 7bd88dc44c Fix ret code in cert_req.c 2018-07-10 17:34:24 +01:00
Andres Amaya Garcia ea14fe76d5 Fix ret code in ssl_mail_client.c 2018-07-10 17:34:24 +01:00
Andres Amaya Garcia e4f79e1902 Fix ret code in ssl_fork_server.c 2018-07-10 17:34:24 +01:00
Andres Amaya Garcia bc1af79add Fix ret code in ssl_client1.c 2018-07-10 17:34:24 +01:00
Andres Amaya Garcia ac0e3e7b11 Fix ret code in gen_random_ctr_drbg.c 2018-07-10 17:34:24 +01:00
Andres Amaya Garcia 43e65fbbca Fix ret code in gen_entropy.c 2018-07-10 17:34:24 +01:00
Andres Amaya Garcia 1b04390e4f Fix ret code in rsa_verify_pss.c 2018-07-10 17:34:24 +01:00
Andres Amaya Garcia 1e36af911b Fix ret code in rsa_verify.c 2018-07-10 17:34:24 +01:00
Andres Amaya Garcia 0b20b4e4cd Fix ret code in rsa_sign_pss.c 2018-07-10 17:34:24 +01:00
Andres Amaya Garcia 39e1964960 Fix ret code in rsa_sign.c 2018-07-10 17:34:24 +01:00
Andres Amaya Garcia a8a96ae42f Fix ret code in rsa_genkey.c 2018-07-10 17:34:24 +01:00
Andres Amaya Garcia aa3291e1fb Fix ret code in key_app_writer.c 2018-07-10 17:34:24 +01:00
Andres Amaya Garcia f57bccf839 Fix ret code in key_app.c 2018-07-10 17:34:24 +01:00
Andres Amaya Garcia 7c55e79f54 Fix ret code in gen_key.c 2018-07-10 17:34:24 +01:00
Andres Amaya Garcia 47c041190c Fix ret code in ecdsa.c 2018-07-10 17:34:23 +01:00
Andres Amaya Garcia 114ba1955e Fix ret code in dh_server.c 2018-07-10 17:34:23 +01:00
Andres Amaya Garcia 74c51e6e64 Fix ret code in dh_genprime.c 2018-07-10 17:34:23 +01:00
Andres Amaya Garcia f842345ac3 Fix ret code in dh_client.c 2018-07-10 17:34:23 +01:00
Andres Amaya Garcia 990900ff40 Fix ret code in crypt_and_hash.c 2018-07-10 17:34:23 +01:00
Andres Amaya Garcia 15cbf61805 Fix ret code in aescrypt2.c 2018-07-10 17:34:23 +01:00
Simon Butcher e21597db32 Merge remote-tracking branch 'public/pr/1794' into mbedtls-2.7 2018-06-28 11:46:16 +01:00
Ron Eldor 9aff65afa4 remove additional zero byte when writing pub der
Remove `- 1` for setting location of output buffer,
which added a leading zero which cause failure in ASN1 parsing.
Fixes #1257
2018-06-26 17:28:07 +03:00
Simon Butcher bb5e1c3973 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-08 11:14:43 +01:00
Jaeden Amero 33be84f679 Merge remote-tracking branch 'upstream-public/pr/1502' into mbedtls-2.7-proposed 2018-04-03 19:16:12 +01:00
Andrzej Kurek ffaee0952c pk_sign: added stdlib include 2018-04-03 04:36:52 -04:00
Andrzej Kurek 350e4dc6df pk_sign: adjust return values 2018-04-03 04:04:36 -04:00
Gilles Peskine 595c84a7b1 Merge remote-tracking branch 'upstream-public/pr/1500' into mbedtls-2.7-proposed 2018-04-01 12:41:29 +02:00
Andres Amaya Garcia 504ac5c884 Make DLEXT var configurable in programs and tests makefiles 2018-03-27 20:04:18 +01:00
Andrzej Kurek d959492797 pk_sign: fix overriding and ignoring return values 2018-03-26 04:13:24 -04:00
Brendan Shanks 968cda12f3 benchmark: Fix incompatibility with C89 compilers
Initializing arrays using non-constant expressions is not permitted in
C89, and was causing errors when compiling with Metrowerks CodeWarrior
(for classic MacOS) in C89 mode. Clang also produces a warning when
compiling with '-Wc99-extensions':

test/benchmark.c:670:42: warning: initializer for aggregate is not a compile-time constant [-Wc99-extensions]
        const unsigned char *dhm_P[] = { dhm_P_2048, dhm_P_3072 };
                                         ^~~~~~~~~~
test/benchmark.c:674:42: warning: initializer for aggregate is not a compile-time constant [-Wc99-extensions]
        const unsigned char *dhm_G[] = { dhm_G_2048, dhm_G_3072 };
                                         ^~~~~~~~~~

Declaring the arrays as 'static' makes them constant expressions.

fixes #1353
2018-03-22 23:21:29 -07:00
Jaeden Amero bec9a9b57a Merge branch 'development' into development-restricted 2018-01-29 12:49:23 +00:00
Jaeden Amero 4d3e1582b0 Merge remote-tracking branch 'upstream-public/pr/1287' into development 2018-01-29 12:49:20 +00:00
Jaeden Amero 784de59ccd Merge remote-tracking branch 'upstream-restricted/pr/410' into development-restricted
- Resolve ChangeLog conflicts
- Update Doxygen warning block in dhm.h to render correctly
- Prefix the exported identifier deprecated_constant_t with mbedtls_
2018-01-26 18:43:04 +00:00
Jaeden Amero 934fb55aa3 Merge remote-tracking branch 'upstream-public/pr/1036' into development 2018-01-26 15:12:43 +00:00
Jaeden Amero 005239e3ed Merge remote-tracking branch 'upstream-public/pr/1294' into development 2018-01-25 14:47:39 +00:00
Manuel Pégourié-Gonnard 4fa619fe56 Fix race condition in error printing in ssl_server2.c
The race goes this way:
1. ssl_recv() succeeds (ie no signal received yet)
2. processing the message leads to aborting handshake with ret != 0
3. reset ret if we were signaled
4. print error if ret is still non-zero
5. go back to net_accept() which can be interrupted by a signal
We print the error message only if the signal is received between steps 3 and
5, not when it arrives between steps 1 and 3.

This can cause failures in ssl-opt.sh where we check for the presence of "Last
error was..." in the server's output: if we perform step 2, the client will be
notified and exit, then ssl-opt.sh will send SIGTERM to the server, but if it
didn't get a chance to run and pass step 3 in the meantime, we're in trouble.

The purpose of step 3 was to avoid spurious "Last error" messages in the
output so that ssl-opt.sh can check for a successful run by the absence of
that message. However, it is enough to suppress that message when the last
error we get is the one we expect from being interrupted by a signal - doing
more could hide real errors.

Also, improve the messages printed when interrupted to make it easier to
distinguish the two cases - this could be used in a testing script wanted to
check that the server doesn't see the client as disconnecting unexpectedly.
2018-01-25 11:27:24 +01:00
Gilles Peskine cb1e5eb326 Merge branch 'pr_1000' into development-proposed 2018-01-23 00:57:34 +01:00
Gilles Peskine 550a2b036b Merge branch 'pr_1163' into development-proposed 2018-01-23 00:57:26 +01:00
Gilles Peskine 9e4f77c606 New MD API: rename functions from _ext to _ret
The _ext suffix suggests "new arguments", but the new functions have
the same arguments. Use _ret instead, to convey that the difference is
that the new functions return a value.
2018-01-22 11:54:42 +01:00
Gilles Peskine d91f2a26cb Merge branch 'development' into iotssl-1251-2.7
Conflict resolution:

* ChangeLog: put the new entries in their rightful place.
* library/x509write_crt.c: the change in development was whitespace
  only, so use the one from the iotssl-1251 feature branch.
2018-01-19 11:25:10 +01:00