Commit Graph
2248 Commits
Author SHA1 Message Date
obgm ab416bfb69 Merge pull request #695 from mrdeep1/dup_obj
examples: Fix RPM Package Manager complaining about duplicate objects
2021-06-08 10:11:26 +02:00
Jon Shallow 7cff27fb7a examples: Fix RPM Package Manager complaining about duplicate objects
For example (when building OpenSSL variant), coap-client and
coap-client-openssl are identically built and debug information is being
abstracted, it complains that the two binaries are identical.

Make coap-server, coap-client and coap-rd non-installable, (they still need
to be built in the examples directory, so cannot use check_PROGRAMS) and then
soft-link them as appropriate in the target $(bindir).
2021-06-08 09:00:33 +01:00
obgm ccefb06c03 Merge pull request #697 from mrdeep1/issue_tidy
config.yml: Tidy up / Clarify documentation
2021-06-08 09:33:31 +02:00
Jon Shallow 9357720646 config.yml: Tidy up / Clarify documentation 2021-06-04 12:02:57 +01:00
obgm 570ff6bc68 Merge pull request #696 from mrdeep1/issue_templates
Issue Reporting: Add in Issue Templates to get better Issue information
2021-06-04 12:07:24 +02:00
Jon Shallow 25f4f24477 Issue Reporting: Add in Issue Templates to get better Issue information 2021-06-04 10:02:11 +01:00
obgm b7f7e61b83 Merge pull request #693 from mrdeep1/trailing_blanks
test_pdu.c: Remove unwanted trailing blank
2021-06-03 18:03:53 +02:00
Jon Shallow 3730437b05 test_pdu.c: Remove unwanted trailing blank 2021-06-03 12:42:09 +01:00
obgm 25fe796cab Merge pull request #692 from mrdeep1/blocked_response
man pages: Update to use the coap_block(3) functions
2021-06-03 11:05:40 +02:00
obgm 027907a658 Merge pull request #691 from mrdeep1/raising_issues
man pages: Indicate where to raise issues
2021-06-03 11:03:33 +02:00
obgm 7bfbba9895 Merge pull request #688 from mrdeep1/coap_send
coap_send(): Consolidate coap_send() and coap_send_large() for applications
2021-06-03 11:02:58 +02:00
Jon Shallow 8d73044579 coap_send(): Consolidate coap_send() and coap_send_large() for applications
As it is not that intuitive when to use coap_send() or coap_send_large()
in applications, rename libcoap usage of coap_send() to coap_send_internal()
and then all usages of coap_send_large() to coap_send() so that only
coap_send() is required in applications.

Documentation updated accordingly.
2021-05-29 14:08:00 +01:00
Jon Shallow 3a68e8eefc man pages: Update to use the coap_block(3) functions
Use the updated functions that cause libcoap to do all of the
RFC7959 work in the man examples.
2021-05-29 13:45:25 +01:00
obgm 62b2be4da1 Merge pull request #667 from mrdeep1/dtls_default
configure.ac: Add in --enable-add-default-names option
2021-05-28 18:06:24 +02:00
Jon Shallow 7816b767ba man pages: Indicate where to raise issues
Document where to raise an issue for the examples inline with the other man
pages.
2021-05-28 14:55:32 +01:00
obgm 3c1db6c309 Merge pull request #687 from mrdeep1/check_critical
net.c: coap_option_check_critical() not updating 'unknown' by ref
2021-05-28 08:10:20 +02:00
Jon Shallow 58fca65ceb net.c: coap_option_check_critical() not updating 'unknown' by ref
'unknown' is updated by coap_option_check_critical if there is a critical
option, but as it is not passed in by reference, any caller does not see
any change to 'unknown'.

Pass in 'unknown' by reference.

Issue got missed in change e2e7830
2021-05-26 14:57:48 +01:00
obgm 2ffce0464b Merge pull request #686 from mrdeep1/mem_leak
coap_gnutls.c: Fix memory leak in cert_verify_gnutls()
2021-05-25 13:33:38 +02:00
Jon Shallow a9a0a3a729 coap_gnutls.c: Fix memory leak in cert_verify_gnutls()
Make sure that san_or_cn is freed off before returning from
cert_verify_gnutls().
2021-05-25 11:08:55 +01:00
Olaf Bergmann 73628f5f2f coap_mbedtls.c: Remove redundant NULL pointer check
As ssl_data is set to the address of the ssl_data component of m_env,
there is no need for a NULL pointer check here.

This fixes CID 1504920.
2021-05-25 11:23:13 +02:00
Olaf Bergmann 90537d143a resource.c: Fix memory leak in coap_add_observer()
If no observer exists, a new cache key is created and storage for a
new subscription may be allocated. If this fails, the newly created
cache key must be released.

This fixes CID 1504918.
2021-05-25 10:25:00 +02:00
obgm ead82c4049 Merge pull request #684 from mrdeep1/self_signed
coap_gnutls.c: Fix if typo causing certificate not to be checked
2021-05-25 09:56:06 +02:00
obgm 98e924b08a Merge pull request #683 from mrdeep1/insert_option
pdu.c: Fix coap_insert_option()
2021-05-25 09:24:00 +02:00
Jon Shallow b71674e0c0 coap_gnutls.c: Fix if typo causing certificate not to be checked
Include {} for if statement.
Issue introduced in c987bee
2021-05-24 12:10:46 +01:00
Jon Shallow cc1a61d304 pdu.c: Fix coap_insert_option()
Handle correctly the case when inserting before the last option and the last
option has a large delta and size that takes it over 5 bytes. Correctly
define the remainder of option space when calling coap_opt_parse().
2021-05-23 18:35:20 +01:00
obgm f4e90cd38b Merge pull request #675 from mrdeep1/fetch_observe
Observe: Support FETCH with data for triggered responses
2021-05-21 15:29:54 +02:00
Jon Shallow 587f7e574c coap-server: Add in FETCH example 2021-05-21 13:52:45 +01:00
Jon Shallow f726d0460a Observe: Support FETCH with data for triggered responses
The original requesting PDU is now kept with the Observe request along with
its data and used whenever an additional response needs to be generated.

Abstracted information from the requesting PDU is no longer kept in
coap_subscription_t as it can be obtained from the kept PDU.

No longer any need to check for request PDU in request handlers as it is now
always provided.

coap_resource_notify_observers() now ignores the query parameter, as a
cache_key is now used for request matching.
2021-05-21 13:08:11 +01:00
Jon Shallow 7cd5bfa638 configure.ac: Add in --enable-add-default-names option
If --enable-add-default-names is set (the default), then the installed default
libraries and installed default example executables will point to the
appropriate object that has the (D)TLS library type in the name.  E.g.

libcoap-3.so -> libcoap-3-openssl.so
coap-client -> coap-client-openssl

If --enable-add-default-names is not set, then this will not happen.

As well as the libraries, the example binaries are now created with the (D)TLS
library extension in all cases.
2021-05-20 16:33:28 +01:00
Olaf Bergmann 2991da5547 doc/Makefile.am: Fix target dist
Ensure that EXTRA_DIST contents are included in make dist even
if configured without documentation. CLEANFILES is also set
outside the conditional area to enable proper cleanup.
2021-05-20 17:27:02 +02:00
obgm 425704599b Merge pull request #679 from mrdeep1/coap_rd
coap-rd: Remove requirement for uthash.h
2021-05-20 17:24:13 +02:00
Jon Shallow 939f7d4380 examples/Makefile.am: Revert commit f6eede8077
It is no longer needed now that uthash.h is no longer required by coap_rd.
2021-05-20 13:28:44 +01:00
Jon Shallow b694c4f5e5 coap-rd: Fix coap_str_const_t deallocate errors
Fix calls to coap_resource_init() and coap_add_attr() where proper
coap_str_const_t * were not being passed in that were safe to free off.
2021-05-20 13:28:44 +01:00
Jon Shallow fb40a231a4 coap-rd: Remove requirement for uthash.h
Add rd_t information as user data to the resource (which has hashed lookup)
rather than maintaining a separate hash within coap-rd.
2021-05-20 13:24:49 +01:00
obgm 46c4315e17 Merge pull request #678 from mrdeep1/pkcs11_logging
TLS Support: Move common TLS support descriptions into libcoap
2021-05-20 13:50:26 +02:00
obgm a8df0adf2f Merge pull request #671 from mrdeep1/rpk_check
RPK: Support verification of peer certificate
2021-05-20 12:57:19 +02:00
Jon Shallow c987bee475 RPK: Support verification of peer certificate
Implement CN and SNI call-back checks for GnuTLS.  The validate_cn_call_back
function provides "RPK" for the common name and the ASN1 of the peers
certificate.

Update coap-server and coap-client to enable validate_cn_call_back and
validate_sni_call_back for RPK.
2021-05-19 13:27:09 +01:00
obgm d60583d38a Merge pull request #670 from mrdeep1/pkcs11_fixes
PKCS11: Fix -C ca option
2021-05-19 09:50:06 +02:00
Jon Shallow 4999f81ad9 PKCS11: Fix -C ca option
For OpenSSL, correct typo in src/coap_openssl.c

For GnuTLS, make sure that the PKCS11 CA Certificate is trusted.
Updated HOWTO.pkcs11 for how to do this. Unfortunatately, this cannot be
done using pkcs11-tool.

The coap-server -n option (don't check peer) is no longer a requirement, so
removed from the HOWTO.
2021-05-12 18:07:03 +01:00
Jon Shallow aaf4d874d4 TLS Support: Move common TLS support descriptions into libcoap
Added new function coap_string_tls_support() for outputting what key types the
TLS library supports to remove duplicated code out of the examples.
2021-05-12 18:02:37 +01:00
obgm 77b73517fa Merge pull request #674 from mrdeep1/license_install
LICENSE: Install in documentation root (--docdir)
2021-05-12 09:40:53 +02:00
Jon Shallow bddb1c5989 LICENSE: Install in documentation root (--docdir)
Include README and COPYING as well, so that they can be a part of a library
distribution.

Make this optional with ./configure --enable-license-install
which is enabled by default.
2021-05-11 22:06:26 +01:00
obgm b4f9302b21 Merge pull request #672 from mrdeep1/examples
examples: Provide standalone source and simple Makefile for examples
2021-05-11 15:46:50 +02:00
Jon Shallow feb8c15b45 examples: Provide standalone source and simple Makefile for examples
Install in PREFIX/share/libcoap/examples the source for coap-client.c and
coap-server.c with a standalone Makefile for ease of standalone code
development.

Add in configure option --enable-examples-source.

Included is a README, LICENSE and COPYING.
2021-05-11 14:35:23 +01:00
obgm 7b26b2e7ba Merge pull request #676 from mrdeep1/tinydtls_asn1_fix
coap_tinydtls.c: Fix ASN1 when calling validate_cn_call_back
2021-05-11 15:16:32 +02:00
Jon Shallow 7e917725ce coap_tinydtls.c: Fix ASN1 when calling validate_cn_call_back
Remove the initial size of the ASN1 information and tidy up some #define.
2021-05-07 14:30:52 +01:00
obgm 30fead8cf7 Merge pull request #669 from mrdeep1/cleanup
autogen.sh: Remove tests/test_common.h on cleanup
2021-05-03 09:25:00 +02:00
Jon Shallow 8c0af50d64 autogen.sh: Remove tests/test_common.h on cleanup 2021-04-30 13:41:19 +01:00
Olaf Bergmann 4214760117 update release version to rc3 in configuration 2021-04-30 09:46:10 +02:00
obgm 832477845f Merge pull request #668 from mrdeep1/truncation
examples: Fix truncated usage() output
v4.3.0-rc3
2021-04-29 15:10:55 +02:00