Commit Graph
12 Commits
Author SHA1 Message Date
Lucien Zuercher 855d53ef10 oscore: enable external credential storage and safe recipient cleanup
Add reference counting to recipient contexts so they can be safely removed
while still in use by active sessions. Expose callback hooks for credential
lookup, echo, and sequence storage to allow custom backends.
Expand example server to demonstrate the external storage via a simple
file based database. Expand coap_oscore_rcp_conf_t to enable settings
preconfigured echo value, sequence counter and window value as uint64
Enable temporary credentials returned by the find function and are destroyed
after use.
2026-05-20 13:09:24 +01:00
Jon Shallow 77929465d3 OSCORE: Support complex sender and recipient configurations
Also supports silent_server configuration for recipient definitions.
2026-04-14 10:42:41 +01:00
Jon Shallow 152f6a8a58 Includes: Remove unnecessary include files
Include common system header files in coap_internal.h based on HAVE_*H
definitions.

Remove these system header files from include/*/*.h.

Add in system header files where appropriate in various apps.
2026-02-02 10:09:17 +00:00
Jon Shallow ea01661faf Zephyr: Support C++ builds
Some of the Zephyr include files need to be C++, not C based. The 'extern "C"'
wrapper in include/coap3/coap.h means that all #include are treated as being C.

Remove 'extern "C"' wrapper from include/coap3/coap.h and add wrapper to
include files after #include and before any function / structure definitions.

Add in a C++ build test for CI.
2025-08-21 12:17:41 +01:00
Jon Shallow d328fc5330 OSCORE: Handle extended tokens when Echo option is returned for B.1.2 2025-06-03 21:35:56 +01:00
Jon Shallow 466f1e0b5c coap_oscore.c: Process queued OSCORE Observe responses after de-registration
If an Observe is de-registered, but an unsolicited Observe response is received
before the de-register response is received, then the unsolicited response
failed to get decrypted.
2024-10-28 14:33:34 +00:00
Jon Shallow ca1e4098b0 pre-commit: Include re-styled OSCORE files to checks 2023-07-05 10:50:25 +01:00
Jon Shallow b3ec5b83c3 Windows: Fix resolve issues / remove warnings
Handle Windows x68 size_t being only 32 bits.
2023-06-09 12:07:10 +01:00
Jon Shallow ca609d221c Persist: Support tracking observe information over server restarts
Add in optional callbacks for when dynamic resources are setup and deleted.

Add in optional callbacks for when observe subscriptions start and stop.

Add in optional callbacks for when the observe counter is updated (can be
ratelimited) for a resource as well as track when a resource is deleted.

Add is support for new functions

Main functions with libcoap tracking support are
 coap_persist_startup()
 coap_persist_stop()

coap-server has -t option to track observe information.

UDP sessions supported, as well as OSCORE over UDP.

Documentation updated

libcoap tracking support (as opposed to application tracking) is configurable.
2023-04-22 11:07:21 +01:00
Jon Shallow 621fd20c2b CBOR: Check for buffer overruns when reading in CBOR data 2023-04-13 10:16:38 +01:00
hasheddan 3133a1e4b7 oscore.h: Fix misspelling of Environment
Fixes a misspelling of Environment.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2023-04-11 20:54:53 +01:00
Jon Shallow dac6bd3b60 RFC8613: Add in OSCORE support
Based on work done in https://gitlab.informatik.uni-bremen.de/obergman/libcoap

New directories with files
 include/oscore
 src/oscore

New files
 include/coap3/coap_oscore.h
 include/coap3/coap_crypto_internal.h
 include/coap3/coap_oscore_internal.h
 man/coap-oscore-conf.txt.in
 man/coap_oscore.txt.in
 src/coap_oscore.c
 tests/test_oscore.c
 tests/test_oscore.h

Supported by new option (enabled by default)
 ./configure --enable-oscore
 cmake .. -DENABLE_OSCORE=ON

Requires a TLS library configured to do the OSCORE encryption and hashing.
2023-01-14 10:26:20 +00:00