Liboscore: basic OSCORE client example

Hi everyone,

I’ve been trying to integrate liboscore, but I’m having issues with the client. As the server I’m using the plugtest-server demo. Here’s my client code:

The issue is that the OSCORE option is created with length 0 (so it’s just 0x90), and hence results in an unauthorized error or a no security context found error in logs.

If you would like to run the code, clone the repo with recurse submodules, run ./, and after that in src/coap_oscore/{plugtest-server, client} run make all -j16; PORT=tap0 make term and make all -j16; PORT=tap1 make term.

Any idea on what I’m doing wrong? Thanks.

CC @chrysn

There is a bug in libOSCORE that you stumbled on that applies to the (basically correct) way you are using it; it was already fixed but not put on the right branch to be immediately available.

The current libOSCORE master contains a fix (setting IS_REQUEST in the right place; your debug statements already went in the right direction).

Just beware (and there the docs are not fixed yet) that for many OSCORE applications you need a current libCOSE; should help.