Commit Graph
33 Commits
Author SHA1 Message Date
obgm 282fd96fc3 Merge pull request #192 from cquijano/dtls_event_on_error
coap_tinydtls.c: On DTLS error, fire and event that could be catch by upper layers
2018-05-31 10:43:12 +02:00
Carlos Quijano 491964e9c4 coap_tinydtls.c: On DTLS error, fire and event that can be caught by upper layers 2018-05-31 10:33:56 +02:00
Jon Shallow 25a8414105 src/*.c: Remove cast-qual compiler warnings
Where appropriate in general

Replace 'unsigned char' with 'const uint8_t'
Replace 'str' with 'coap_str_c_t'
Replace str with coap_string_t
Prefix with 'const' some type casts
Remove unnecessary type casting
Remove unneeded WITH_LWIP wrappers to select coap_malloc_type() or memp_malloc()
as underlying  coap_malloc_type() is correctly selected in include/coap/mem.h

src/block.c:
Replace coap_opt_const_value() with coap_opt_value()

src/coap_io.c:
Due to the definations of struct iovec and struct msghdr, and const parameters
getting passed in, as this is a write of data function, the pointers are
copied into the 2 structures to get around the cast-qual warnings

src/net.c:
Release any sessions (so that they may get freed off) in coap_free_context()

src/option.c:
coap_option_filter_get() had to be downgraded as coap_option_filter_op() is
used by set functions as well.

src/pdu.c:
Remove const out of next_option_safe() parameters

As coap_resource_init() has a const uri_path parameter passed into it, it is not
possible to have these values legally freed off if flags is set to
COAP_RESOURCE_FLAGS_RELEASE_URI.

coap_resource_init_release() has been created to handle this.  However, as it
is likely to be called with a coap_string_t generated from a call to
coap_get_uri_path(), the string must be correctly freed off.  Hence the
use of coap_string_t as a parameter.

coap_add_attr_release() has been added in as well, using coap_string_t* as
parameters, to allow the coap_string_t to be freed off correctly.

Add in coap_log warning if the functions coap_resource_init*() and
coap_add_attr*() are called incorrectly.

Update src
2018-05-25 16:38:07 +01:00
Jon Shallow ac7d223d02 src/coap_tinydtls.c: Fix compiler unused parameter warning 2018-05-17 18:58:16 +01:00
Olaf Bergmann 4280e75a0c coap_tinydtls.c: fix compiler warning for printf() format string 2018-04-20 10:50:48 +02:00
Jon Shallow 675edad34c coap_notls.c, coap_tinydtls.c: Fix stub functions coap_dtls_context_set_pki() 2018-02-14 21:59:21 +00:00
Jon Shallow 047c9fb082 Fix coap_notls.c, coap_tinydtls.c: after update merge from obgm/develop
Conficts created by Pull request #134
2018-02-14 19:24:58 +00:00
Jon Shallow aaa43301b7 coap_tinydtls.c: Add in PKI stub functions
Update #includes and add in stub functions
coap_dtls_context_set_pki
coap_dtls_context_set_psk
coap_dtls_context_check_keys_enabled
2018-02-12 09:50:32 +00:00
Jon Shallow 30794440af coap_tinydtls.c: Add in coap_get_tls_library_version() function
Add in coap_get_tls_library_version() for determining TLS build base + version
2018-02-10 19:38:08 +00:00
jcmichelou c93f535d4a openssl, session: Fix memory leaks. 2017-11-04 23:38:02 +01:00
jcmichelou e125888ded openssl: Handshake can also complete in SSL_accept and SSL_connect. 2017-10-21 19:16:23 +02:00
jcmichelou e713e77f54 notls, tinydtls: Add stubs for unused TLS functions. 2017-10-21 16:11:15 +02:00
jcmichelou dfff930805 io, net: Add TCP accept/connect/read/write 2017-10-21 16:11:12 +02:00
jcmichelou bcfd7a0753 pdu: add support for TCP-style headers
Make coap_pdu-t independent of the header style.
Use C99 sized types when applicable.
Use transaction ids in host byte order in the library.
Make coap_pdu_t payload storage grow on demand.
Add parsing and encoding of PDUs with UDP or TCP style headers.
Adapt examples and unit tests to the new PDU format.
2017-10-21 16:11:11 +02:00
jcmichelou 25732fc8e6 coap_session.[ch], net.c: Add handler for lost CON messages.
Add a slot for storing application-specifc data in session object.
Make the library resilient against client session released in a callback.
2017-09-08 20:02:22 +02:00
jcmichelou 87126f35c1 Add minimum timeout of 100ms for global DTLS timeout. Remove the peer from tinydtls retransmit list when the coap session is reset. 2017-07-01 17:09:14 +02:00
jcmichelou 1d2e985364 Fix missing pointer. 2017-06-30 19:26:55 +02:00
jcmichelou 42f68764f1 Safely separate the coap_address_t type from the tinydtls session_t type. 2017-06-30 19:15:00 +02:00
jcmichelou 699cf5d138 Fix handling of session events in tinydtls to call the handler only when it is safe to destroy the session object. 2017-06-30 15:08:40 +02:00
jcmichelou ab04f3924f Fix compilation warnings with gcc. 2017-06-29 19:20:39 +02:00
jcmichelou 7fb4ace2b7 Fix for the signedness warning with gcc.
Compact coap_address_t.
Use coap_queue_t for all queues.
OpenSSL warning for close alert should be info level.
Fix OpenSSL log level not working.
Use the application defined MTU in OpenSSL.
coap_log() optimization to avoid generating the log message text before testing the log level.
coap_can_exit() should check the new retransmit queues.
Fix retransmit time sometimes not correctly computed relative to sendqueue_basetime.
Add coap_write() API call for applications with their own main loop.
2017-06-29 18:12:46 +02:00
jcmichelou b2fe4a64de Make MTU configurable.
Use static or stack storage for coap_packet_t.
2017-06-26 17:34:01 +02:00
jcmichelou ca597b6986 Fix typo in coap_tindydtls 2017-06-24 16:21:28 +02:00
jcmichelou d0974cacd5 A TLS fatal alert shall always disconnect the session. 2017-06-23 16:06:04 +02:00
jcmichelou f6047c8e77 Fix gcc warning messages. 2017-06-22 16:13:38 +02:00
jcmichelou 0a0cd1fb4e Make retransmit timeout relative in tinydtls. 2017-06-22 16:06:11 +02:00
jcmichelou 9490a0c8ab Fix bug in setting the OpenSSL log level make its use consistent with tinydtls
Rename session.c and session.h to coap_session.c and coap_session.h
Use length to PSK hint and identity
Improve packet loss testing
2017-06-22 16:02:03 +02:00
jcmichelou 99925a1a97 Add init function for DTLS library.
Match dummy functions in coap_notls.c with their prototypes.
2017-06-21 20:57:12 +02:00
jcmichelou adf1238eae Add DTLS retransmit and recovery.
Add lossy networks debug option in examples.
2017-06-21 20:40:15 +02:00
jcmichelou 2f24ee8cdd Call dtls_close when session is closed to send a notify alert to the remote peer. 2017-06-21 15:45:02 +02:00
jcmichelou ae13e5127b Compile with tinydtls and remove warning message with gcc. 2017-06-19 20:37:11 +02:00
jcmichelou b389a5f6aa Add skeleton support for tinydtls with new API. 2017-06-19 16:58:12 +02:00
jcmichelou 8353417afb Added session management with simpler DTLS lib API.
Added DTLS support with OpenSSL.
2017-06-18 20:09:47 +02:00