CombinedRequestServer

The server side of the EDHOC + OSCORE request (RFC 9668 §3.3), a decorator of the server's OSCORE layer: a request with the EDHOC option has its message_3 split off and processed by edhoc, which adds the new OSCORE context to its repository, and the rest is verified by oscore as an ordinary OSCORE request. Requests without the EDHOC option go to oscore directly.

oscore is any ServerMessageSecurity that verifies OSCORE requests against the contexts edhoc adds: kcoap-oscore's OscoreServer on the same repository, or a decorator of it.

val contexts = InMemoryContextRepository()
val edhoc = EdhocServer(responderConfig, crypto, contexts)
val security = CombinedRequestServer(edhoc, OscoreServer(contexts))

Errors follow the RFC: a malformed combined request is answered with 4.00, a failed EDHOC step with an EDHOC error message (Content-Format application/edhoc+cbor-seq) in a 4.00, or in a 5.00 when edhoc failed on its own side (RFC 9528 Appendix A.2.3), and a failed OSCORE step with the OSCORE errors of RFC 8613 §8.2. A rebuilt request that oscore does not take as protected (null) is malformed as well: it carried the EDHOC option without being an OSCORE request.

Constructors

Link copied to clipboard
constructor(edhoc: EdhocServer, oscore: ServerMessageSecurity)

Functions

Link copied to clipboard
open suspend override fun unprotectRequest(request: CoapMessage, peer: Endpoint): UnprotectedRequest?