eriptic / uoscore-uedhoc

C implementations for constrained (and non-constrained) devices of the IETF protocols OSCORE and EDHOC
Other
15 stars 15 forks source link

CoAP Observe implementation in Zephyr is incompatible with uOSCORE #41

Open StefanHri opened 1 year ago

StefanHri commented 1 year ago

Issue received per email:

As I see my problems with Observe in Zephyr stems from the following lines in Zephyr coap.c and the fact “inner observe” with OSCORE is zero: (At least the notifications sent are rejected due to below “age check”)

        age = coap_get_option_int(response, COAP_OPTION_OBSERVE);

        /* handle observed requests only if received in order */

        if (age == -ENOENT || is_newer(r->age, age)) {

            r->age = age;

            r->reply(response, r, from);

        }

I think a work around may be to add an external/outer OSCORE observe value that would pass above check?

StefanHri commented 1 year ago

The problem originates most likely in:

" A client MUST consider the notification with the highest Partial IV as the freshest, regardless of the order of arrival. In order to support existing Observe implementations, the OSCORE client implementation MAY set the Observe option value to the three least significant bytes of the Partial IV. Implementations need to make sure that the notification without Partial IV is considered the oldest."

See 4.1.3.5.2 in rfc8613.