Commit Graph

11 Commits (c0bbc5c77f1d91adf473feb05fb76723b0bbf2e7)

Author SHA1 Message Date
Seppo Takalo bdc355f873 Astyle fixes 2018-11-19 15:31:31 +02:00
Seppo Takalo 2229a2f2f5 Need to protect members with MBEDTLS_PK_C and X509_CRT_PARSE flags.
This is dependency to X509_CRT_PARSE but just to make sure
that also the 'mbedtls_pk_context' structure is not used if that
flag is not enabled.
2018-11-19 15:19:49 +02:00
Seppo Takalo 695db63df8 Decrease verbosity of the TLSSocketWrapper 2018-11-19 15:19:49 +02:00
Seppo Takalo d22adbdb26 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.
2018-11-19 15:19:49 +02:00
Cruz Monrreal II 4a5ba7f156 Merge branch 'getpeername' of ssh://github.com/SeppoTakalo/mbed-os into rollup 2018-11-13 17:26:49 -06:00
Seppo Takalo 619bcb5b4e Implement Socket::getpeername() API
This is equivalent of POSIX getpeername() function. It allows to
get remote address associated with the socket.
For example:
socket *s = server.accept();
SocketAddress remote;
s->getpeername(&remote);
2018-11-13 11:02:51 +02:00
Kevin Bracey 913103c34d TLSSocketWrapper: decouple error requirements
* Don't pull in mbedtls_strerror() if trace is not enabled.
* Output error trace even if mbedtls_strerror() is not available.
2018-11-12 13:12:34 +02:00
Martin Kojtal 63160d8c5b netsocket: fix astyle coding style 2018-11-08 08:54:17 +00:00
Seppo Takalo c7643ea9c8 Flag certificate verification functions with MBEDTLS_X509_CRT_PARSE_C.
If Mbed TLS support for X509 is not compiled in, this class would
not compile anymore. However, there might be other uses for it, even
if certificates are not used. Therefore add flagging for X509 only
on specific functions.
2018-10-19 12:32:12 +03:00
Seppo Takalo 5d1cd2552b Check that MBEDTLS_ERROR_C is defined before using mbedtls_strerror().
If MBEDTLS_ERROR_C is not defined, that strerror function does not
exist, or is just dummy definition if MBEDTLS_ERROR_STRERROR_DUMMY is
defined.
2018-10-17 11:45:31 +03:00
Seppo Takalo 7f39bb4453 Implement TLSSocket
Provide TLSSocket implementation. This implementation allows TLSSocket
to wrap around any existing socket. Currently only TLS supported. DTLS
not yet implemented.

Design document also provided with the implementation.

Documentation submitted to Mbed OS handbook.
2018-10-15 13:31:36 +03:00