Commit Graph
1113 Commits
Author SHA1 Message Date
jcmichelou c93f535d4a openssl, session: Fix memory leaks. 2017-11-04 23:38:02 +01:00
Olaf Bergmann e5064a47e7 client.c: removed dead code in message_handler()
Coverity scan has detected dead code that has been removed in this
change. (CID 1382575)
2017-11-03 15:15:06 +01:00
Olaf Bergmann 9bf7032232 coap_session.c: additional NULL pointer check
Coverity scan CID 1458386 has detected a potential NULL pointer
being dereferenced in coap_session_free().
2017-11-03 15:05:48 +01:00
Olaf Bergmann 6fb2e671d1 async.c: added missing check for NULL in coap_free_async()
Coverity scan has detected a possible NULL pointer being dereferenced
before it is checked, see CID 1458391.
2017-11-03 14:55:33 +01:00
Olaf Bergmann 1f51ba7636 coap_openssl.c: removed dead code from coap_dgram_ctrl()
The dead code detected by Coverity scan in CID 1458395 has been
replaced with explicitly setting the return value to 1 (the default
that has previously been used).
2017-11-03 14:42:05 +01:00
Olaf Bergmann a569e16584 coap_time.h: cast COAP_TICKS_PER_SECOND to coap_tick_t for type safety
CID 1458396 detected by Coverity scan points out that integer
arithmetics may lead to an overflow without the typecast to
coap_tick_t.
2017-11-03 14:29:49 +01:00
Olaf Bergmann 4b52182b8d net.c: fix possible NULL pointer dereference
Fixes CID 1458397 detected by Coverity scan.
2017-11-03 14:22:32 +01:00
Olaf Bergmann edca08249b coap-server.c: fixed memory leak in get_context()
When getaddrinfo() failed, the context object was not released before
returning NULL. Coverity scan has detected this with CID 1458398.
2017-11-03 14:18:19 +01:00
Olaf Bergmann 29692faa86 coap-server.c: fix use after free in check_async()
As coap_send() automatically releases the specified pdu, it must
not be accessed after coap_send() has returned.

This change fixes CID 1458399 reported by Coverity scan.
2017-11-03 14:12:22 +01:00
Olaf Bergmann 67a9210dbd net.c: fixed memory leak in coap_send()
coap_send() always takes the ownership of the pdu that is passed
as argument to send, i.e., the memory will be released automatically
when the pdu is not needed anymore.
2017-11-03 14:07:16 +01:00
Olaf Bergmann 027d9601eb net.c: always initialize bytes_read
In CID 1459612, Coverity scan has complained about uninitialized use
of the variable bytes_read. Although this is a false positive here,
it seems to be more safe to always initialize bytes_read.
2017-11-03 13:54:07 +01:00
Olaf Bergmann 313a655a9a pdu.c: fix explicit NULL pointer dereference
Fixes CID 1459615 found by Coverity scan.
2017-11-03 13:37:56 +01:00
Olaf Bergmann 5cc5273867 Doxyfile.in: decrease verbosity of doxygen output
To avoid cluttering the build output with lots of doxygen messages
the QUIET parameter now has been set to YES.
2017-11-03 13:36:24 +01:00
Olaf Bergmann 6a3abd257e coap_session.c: fixed default port selection for client TCP session
In coap_session_create_client(), the default port for TCP did not
correctly distinguish between TCP and TLS as pointed out in [1] by
Joan Shallow. This change applies the suggested fix.

[1] https://sourceforge.net/p/libcoap/mailman/message/36092184/
2017-11-03 10:41:05 +01:00
obgm a5dd017ec1 Merge pull request #114 from spinetix/spx-observe
Fix issues #90, #91 and #92
2017-10-30 09:31:18 +01:00
jcmichelou 3f77c117ea resource: Fix issues #90, #91 and #92
The value of the observe option is kept for each resource rather than being global to the context.
The value of the observe option must wrap to be stay below 2^24.
The value of the observe option must be different from the initial value when a notification is sent.
2017-10-25 20:22:01 +02:00
obgm 3630436499 Merge pull request #113 from spinetix/tcp-tls
Add support for TCP and TLS transports
2017-10-24 09:47:52 +02:00
jcmichelou e125888ded openssl: Handshake can also complete in SSL_accept and SSL_connect. 2017-10-21 19:16:23 +02:00
jcmichelou 1c4d6913af net.c, symbols: fix gcc warning and regenerate symbol files 2017-10-21 18:26:40 +02:00
jcmichelou 3340f10541 net.c: Correct payload size for wellknown response. 2017-10-21 17:35:43 +02:00
jcmichelou 68a9ea045d pdu: Use defines for TCP variable header message size constants. 2017-10-21 17:24:56 +02:00
jcmichelou d89c99f5f8 uri: Add coap+tcp:// and coaps+tcp:// schemes. 2017-10-21 16:52:02 +02:00
jcmichelou 8923d4de50 openssl: TLS session can be connected both on read and write. 2017-10-21 16:34:18 +02:00
jcmichelou 75d89ab295 openssl, io: Fix linux compatibility 2017-10-21 16:11:16 +02:00
jcmichelou e901714c74 net.c: Call nack handler for all transports. 2017-10-21 16:11:16 +02:00
jcmichelou fa52273f59 coap_session.c: Remove observers and delete TLS object on disconnect. 2017-10-21 16:11:15 +02:00
jcmichelou cd804ba3bf client.c: Make observation timeout work with TCP. 2017-10-21 16:11:15 +02:00
jcmichelou e713e77f54 notls, tinydtls: Add stubs for unused TLS functions. 2017-10-21 16:11:15 +02:00
jcmichelou 854cc3147f openssl, session: Add TLS encryption. 2017-10-21 16:11:14 +02:00
jcmichelou 9bb8396b23 coap_session, net.c: Add debug messages on TCP RX/TX. 2017-10-21 16:11:14 +02:00
jcmichelou 6bf4856e4c net.c: buffer socket I/O for performance. 2017-10-21 16:11:14 +02:00
jcmichelou 58766a137e coap_dtls.h, openssl: Add function prototypes for TLS support. 2017-10-21 16:11:13 +02:00
jcmichelou 140580f0df session, pdu, option: Use exact message size calculation for TCP PDU. 2017-10-21 16:11:13 +02:00
jcmichelou f81cb43fd3 session, pdu: Enforce maximum message size. 2017-10-21 16:11:12 +02:00
jcmichelou c592c9d11f session, net, debug: Add TCP signaling messages. 2017-10-21 16:11:12 +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
Olaf Bergmann 95a97c349e Dockerfile: use pre-built image and cleanup unused packets 2017-10-16 18:02:01 +02:00
Olaf Bergmann bea82fef30 build.sh: disable documentation to speedup continuous integration 2017-10-16 17:53:00 +02:00
Olaf Bergmann ca3a88c5e4 Dockerfile: added packages for documentation, exuberant-ctags 2017-10-16 14:44:24 +02:00
Olaf Bergmann 2d987aee39 Dockerfile: added missing packages for documentation build process 2017-10-16 14:19:44 +02:00
Olaf Bergmann f9d7507431 .travis.yml: invoke docker with build script 2017-10-16 14:13:31 +02:00
Olaf Bergmann 9db50812d2 .travis.yml: changed travis configuration to use docker 2017-10-16 13:49:07 +02:00
Olaf Bergmann dcfef0a615 Dockerfile: added Dockerfile for travis continuous integration 2017-10-16 13:48:32 +02:00
Olaf Bergmann ff84892817 .gitignore: added TAGS file to ignored files 2017-10-06 09:50:45 +02:00
Olaf Bergmann 073016ebea coap_io.c: fix time propagation when removing node from sendqueue
PR #100 has fixed the propagation of elapsed time in coap_pop_next()
which affects the next node in the respective send queue. This fix
is also required for platform POSIX.
2017-10-06 09:46:56 +02:00
obgm 6ee35e4a37 Merge pull request #100 from Trilliant/Trilliant/feature/fixLwipRelativeTimeOnExpiration
Set relative time 't' to zero when it actually expire
2017-10-05 17:21:47 +02:00
obgm c1254c1be8 Merge pull request #111 from spinetix/build-fixes
Assorted build fixes
2017-09-21 12:48:10 +02:00
Olaf Bergmann 89c617ad46 .travis.yml: temporarily switch off contiki and lwip
As the current develop head does not support the recent API
changes, the platforms Contiki and LwIP cannot be built properly
by Travis (see https://travis-ci.org/obgm/libcoap/). Until this
has been fixed, these platforms are disabled.
2017-09-20 11:18:49 +02:00
Diego Santa Cruz cfb9575e01 libcoap-1.pc.in: do not unnecessarily expose DTLS libs to users
The SSL lib used to implement DTLS is only used internally
by libcoap, so it is not necessary and sometimes harmful to
expose it via the pkg-config file. Only when doing static
linking is it necessary to link the SSL lib, this is done
via the "Libs.private: pkg-config directive.
2017-09-20 10:57:46 +02:00