Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement DTLSSocket and fix non-blocking connections on TLSSocket #8659

Merged
merged 12 commits into from
Nov 24, 2018

Conversation

SeppoTakalo
Copy link
Contributor

Description

Implement DTLSSocketWrapper and fix non-blocking connections on TLSSocket

DTLSSocketWrapper is equivalent of TLSSocketWrapper but uses datagram mode
and timers for handling Mbed TLS timeouts.

Non-blocking connections were not working earlier, now fixed for both
secure socket modes.

This requires changes once #8651 goes in, so pending for that one, or if we merge this before, I need to rework the #8651

Pull request type

[ ] Fix
[ ] Refactor
[ ] Target update
[X] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

@SeppoTakalo
Copy link
Contributor Author

@kjbracey-arm Please review

@cmonr
Copy link
Contributor

cmonr commented Nov 13, 2018

@kjbracey-arm When you get the chance, this needs a review.
@SeppoTakalo When you get a chance, this'll need a rebase.

@cmonr
Copy link
Contributor

cmonr commented Nov 13, 2018

@SeppoTakalo We'll be aiming to take in #8651 first since its last test failures were not due to the PR.

Copy link
Contributor

@kjbracey kjbracey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine, just formatting nits and note for the future.

close();
}

#endif // MBEDTLS_SSL_CLI_C
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing newline. Same in lots of other files


if (context->_timer_event_id == 0) {
return -1;
} else if (context->_timer_expired) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems current implementation of mbed TLS doesn't rely on the intermediate delay, but nothing in the documentation says you can skip it. I'd suggest putting it in for completeness in a later patch.

@SeppoTakalo
Copy link
Contributor Author

SeppoTakalo commented Nov 14, 2018

  • Unittests added and fixed.
  • whitespace/line endings fixed
  • rebased on top of master
  • Added comparison for intermediate timeouts
  • Manually tested against DTLS server from Mbed TLS
  • unittests passing.
  • Refactored the DTLSSocket to use UDPSocket::getpeername() instead of having copy of the endpoint address.
+---------------+---------+-------------+-------------+-----------+-----------+
| Testcase      | Verdict | Fail Reason | Skip Reason | platforms |  duration |
+---------------+---------+-------------+-------------+-----------+-----------+
| DTLS          |   pass  |             |             |    K64F   | 11.730098 |
| DTLS_NONBLOCK |   pass  |             |             |    K64F   | 12.998959 |
+---------------+---------+-------------+-------------+-----------+-----------+

@cmonr
Copy link
Contributor

cmonr commented Nov 14, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Nov 14, 2018

Build : SUCCESS

Build number : 3629
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/8659/

Triggering tests

/morph test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Nov 15, 2018

@cmonr
Copy link
Contributor

cmonr commented Nov 15, 2018

Export falures do not appear to be due to PR.
(Jenkins Nodes dropped)

Will restart when able.

@mbed-ci
Copy link

mbed-ci commented Nov 15, 2018

@SeppoTakalo
Copy link
Contributor Author

Unrelated test failure:
tests-mbed_hal-rtc_time_conv

@cmonr
Copy link
Contributor

cmonr commented Nov 15, 2018

@SeppoTakalo Yup. Will restart when able.

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 15, 2018

This failure is tracked in the issues and one potentional fix was created as I understood. We will restart CI as soon as possible (one rollup now in there). We might create another rollup of few 5.11 unrelated PR (this would be a good candidate to be included).

@cmonr
Copy link
Contributor

cmonr commented Nov 15, 2018

@SeppoTakalo Fyi, in trying to create #8760 (Rollup PR) with this PR (to expidite retesting while keeping CI load low), I found that a merge conflict is created when this PR is merged with #8647.

I've put 8647 in instead of this PR because 1) the other PR is a day older, and 2) I suspect that rebase resolution will be more straightforward with this PR than for 8647.

TL;DR: Once #8760 passes and is merged, this PR will need a rebase because of a merge conflict with #8647.

@0xc0170 0xc0170 reopened this Nov 19, 2018
@SeppoTakalo
Copy link
Contributor Author

will add.. just a sec

@SeppoTakalo
Copy link
Contributor Author

@0xc0170 fixed!

@mbed-ci
Copy link

mbed-ci commented Nov 19, 2018

Build : FAILURE

Build number : 3676
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/8659/

@mbed-ci
Copy link

mbed-ci commented Nov 19, 2018

Copy link
Contributor

@0xc0170 0xc0170 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build failures look related, there are unrecognized tokens reported in 2 header files

@@ -0,0 +1,22 @@
#ifndef DTLSSOCKETWRAPPER_H
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file misses the license header

@SeppoTakalo
Copy link
Contributor Author

Oh nice... UTF-8.
This means is not the same as   first one is space, second one is non-breaking space. You can easily enter non-breaking space when you hold the same keys as when you produce | (alt-space on Mac)

Both issues fixed now.

100% tests passed, 0 tests failed out of 43



Total Test time (real) =   0.57 sec

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 20, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Nov 20, 2018

Build : SUCCESS

Build number : 3683
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/8659/

Triggering tests

/morph test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Nov 20, 2018

@mbed-ci
Copy link

mbed-ci commented Nov 20, 2018

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 20, 2018

^^ known failures , still investigating

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 22, 2018

Info: This PR has been re-bundled into a new rollup PR (#8838 ).

No further work is needed here, as once that PR is merged, this PR will also be closed and marked as merged.
If any more commits are made in this PR, this PR will remain open and have to go through CI on its own.

@0xc0170 0xc0170 merged commit 5459a7b into ARMmbed:master Nov 24, 2018
@0xc0170 0xc0170 removed the needs: CI label Nov 24, 2018
@cmonr cmonr removed the rollup PR label Nov 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants