-
Notifications
You must be signed in to change notification settings - Fork 452
Description
Is your feature request related to a problem? Please describe.
For the OSCORE integration on server side, there seems to be only the option to
configure the credentials into server via the coap_new_oscore_conf() function.
This credential is in text format and is converted from text -> oscore_conf_t -> oscore_ctx_t.
For embedded devices, there is optimisation potential to save on ram (multiple conversions) and
storage (storing text vs. optimized credentials storage options).
On servers with more resources, the current solution would expect that libcoap stores and manages
the OSCORE credentials currently as linked list. For a large number of connections, other storage formats
might be better suited. Therefor I would like to propose some alternative approaches / improvements.
Describe the solution you would like
The solution would ideally provide following:
- Prevent the need to store a text format
- Enable customizing the credentials storage depending on the requirements and/or enabling
optimization to the available hardware.- storage and retrieval optimisation, aka. linked list vs array vs hashmap etc.
- size optimisation, by storing duplicate information etc.
- Prevent the need of conversion
Describe alternatives you have considered
- Provide getter / setter functions for attributes of
coap_oscore_conf_t
(+) Non intrusive and minimal change
(+) Allows direct providing of information without convertion text data
(-) Does not allow customized / optimized OSCORE credential storage
(-) Requires the conversion from oscore_conf_t -> oscore_ctx_t
- Provide getter / setters for an interface directly to
oscore_ctx_t
(+) Non intrusive and minimal internal code change
(+) Enables direct configuration of credentials, alternative option for text convertions
(-) Does not allow customized / optimized OSCORE credential storage
- Provide a callback to be called in
oscore_find_contextfor each request / response.
This callback would need to provide a subset or all options for
coap_oscore_confin combination with (1) oroscore_ctx_tin combination with (2)
(+) Allow the application to optimize the OSCORE credential storage
(+) Depending of how the callback signature looks like, removes the need of data convertion
(+/-) Could mean potential code optimisations
(-) Depending on approach, most likely more intrusive
- Add an option to skip internal OSCORE to handle it on application level. I am aware, compile time disabling
is possible, but if a shared library is used, it has benefits if the OSCORE check can be disabled on runtime
(+) Allow custom OSCORE handling and therefore no credential storage dependency on libcoap
(-) Requires handling the OSCORE decoding / encoding in handler, which requires the application to have a custom OSCORE library
Additional context
Generally in my opinion, i see following ranking:
(3) would be the best option but also brings the most work with.
(4) is non intrusive and easy implemented, allowing the application to choose. So the decision is up to the application / integration
(2) possible, but would not solve the customizing of the security storage, and therefore brings its issue on embedded and scalable systems due to storage etc.
(1) seems like a bandage, and not really an option
I am happy to expand on the needs, options and discuss further API options in case (3) is taken into consideration.
Thank you