Commit Graph

30 Commits (a1982c1de752c50410d975a03f505a69972539f5)

Author SHA1 Message Date
Tero Heinonen ae4d9dbada Call transaction callback when transactions are deleted (#48)
When secure session is deleted, transaction callback must be called
to inform request sender that response is not going to be received.
2016-11-02 12:10:19 +02:00
Hasnain Virk ff5bc03fd7 Using socket_close() instead of socket_free()
* Pertaining to new socket API changes, socket_free is deprecated.
* socket_close() is used from now on.
* Fixing stubs too.
2016-11-01 17:15:16 +02:00
Tero Heinonen 7f5370e0bf Use default local address, if request is from multicast address (#46)
* Use default local address, if request is from multicast address

If response to multicast request is sent, local address must be set to
default.

* Fix unit tests

Fixed socket_listen stub.
2016-11-01 11:07:59 +02:00
Kevin Bracey 6d263723c1 Fix secure operation; some name and logical tidies
Secure sending code was passing the remote address as the source
address, bizarrely. This records the local address last used as the
destination for incoming packets and uses that.

Other fix-ups:

* dest_addr (ie remote address) removed from internal_socket_t; this isn't
  safe, as one socket talks to multiple remote peers. Use address in
  secure_session_t instead.
* Some renaming: listen_socket->socket, send/receive callbacks,
  remote_address+remote_port -> remote_host
2016-10-28 10:04:03 +03:00
Tero Heinonen 115aa3eee2 Delete all transactions when secure session is closed (#41)
When handshake fails, or DTLS session is closed, all transactions must
be removed from coap protocol retransmission queue. Otherwise coap
retransmission will start new handshake.
2016-10-27 09:42:59 +03:00
Kevin Bracey e6b2d21d1d Allow build without SSL
NS_USE_EXTERNAL_MBED_TLS now controls whether we attempt to include
mbedTLS header files at all, and after including them, we check whether
SSL/TLS is enabled. If not, we provide non-secure operation only.
2016-10-24 10:45:10 +01:00
Kevin Bracey ac8ddafffd Restructure connection and security
Make connection handler deal with all addressing, and hide the internals
of security handler.

Will allow security handler code to be stubbed out if mbed TLS is not
available.
2016-10-24 10:45:10 +01:00
Tero Heinonen 9dfc6f970c Support for setting source address to socket (#40)
When receiving data, destination (own) address is stored and given to
socket when sending reply to make sure respone comes always from same
address where request was sent. This commit supports only real socket to
real socket messages, not virtual socket, or DTLS handshake messages.
2016-10-24 11:58:53 +03:00
Tero Heinonen b3419e058a Fix session lost issue (#36)
This fixes unstability issues. Still need to refactor
coap_security_handler_read()-function to work as specified in mbedTLS
documentation. This commit should be treated as a temporary fix.
2016-10-11 09:30:17 +03:00
Tero Heinonen 70447c3e35 Set link layer security when opening socket. (#30) 2016-08-17 14:30:36 +03:00
Arto Kinnunen ae0579f173 Update content_type to sn_coap_content_format_e (#27)
-Update content_type to be sn_coap_content_format_e instead of uint8_t
 to avoid type conversion (bugs).
-Fix compiler warnings
2016-06-28 10:45:30 +03:00
Tero Heinonen 52fa5e613e Renamed session_start_timestamp to last_contact_time.
Renamed SECURE_SESSION_ALERT_SENT to SECURE_SESSION_CLOSED.
2016-03-14 12:13:36 +02:00
Tero Heinonen 451d773f5f Timer to remove secure sessions after alert is sent but not received. 2016-03-10 15:28:43 +02:00
Tero Heinonen f5f70e2d8b API for changing DTLS handshake message timeouts. 2016-02-19 09:49:45 +02:00
Tero Heinonen 74744cca51 Close and clear session when error received after connection is
established.
2016-02-12 14:52:16 +02:00
Tero Heinonen 6dd666a455 Virtual socket error handling fixed.
Entropy fix reverted to make yotta build working.
This must be fixed properly later.
2016-02-11 13:23:08 +02:00
Tero Heinonen 45daf83135 unittests fixed 2016-02-10 13:02:03 +02:00
Tero Heinonen cf1de55902 CoAP service refactoring:
- mbedtls timer implementation changed to use event timer.
- Connection handler to return all error cases
2016-02-10 11:22:50 +02:00
Tero Heinonen c8794b84f9 Check for return status when opening socket
unittests fixed and added test to new lines.
2016-02-04 13:20:46 +02:00
Deepak Venugopal ad31757f5f added a missing call to socket free 2016-02-03 05:01:28 -08:00
Mika Tervonen 120293c03b Remove Nanostack dependency from service api 2016-01-29 00:08:36 -08:00
Antti Kauppila 3034b1a7c7 Some naming refactored correctly 2016-01-20 13:50:13 +02:00
Antti Kauppila 267c1861dd Cleanup 2016-01-20 11:50:24 +02:00
Antti Kauppila a32c3614b4 Combined security stuff from mbed-client 2016-01-20 11:45:25 +02:00
Seppo Takalo c330fa884c Update copyright headers. 2016-01-14 11:00:29 +02:00
Tero Heinonen 20fa549678 Unused variables removed. 2016-01-12 11:39:15 +02:00
Tero Heinonen 6c6e672630 MbedTLS config file fixing,
small refactoring.
2016-01-11 13:24:28 +02:00
Antti Kauppila 0a6ec9db93 Fixed yotta based unit tests, cleaned useless stubs 2015-12-23 11:19:38 +02:00
Antti Kauppila 1fb3daf346 Added support for closing a secure connection by giving address and port 2015-12-23 10:07:24 +02:00
Antti Kauppila eb5aa4ef59 New CoAP service + unit tests 2015-12-21 10:00:43 +02:00