Skip to content

Commit

Permalink
net: lwm2m: Don't allow operations on security object
Browse files Browse the repository at this point in the history
In spec:
The LwM2M Client MUST reject any LwM2M Server operation on
the Security Object (ID: 0) with an "4.01 Unauthorized" response
 code.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
  • Loading branch information
SeppoTakalo authored and carlescufi committed Sep 21, 2023
1 parent d8d81a8 commit b0303f5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions subsys/net/lib/lwm2m/lwm2m_message_handling.c
Original file line number Diff line number Diff line change
Expand Up @@ -2330,6 +2330,11 @@ int handle_request(struct coap_packet *request, struct lwm2m_message *msg)
goto error;
}
#endif
if (msg->path.obj_id == LWM2M_OBJECT_SECURITY_ID && !msg->ctx->bootstrap_mode) {
r = -EACCES;
goto error;
}

switch (msg->operation) {

case LWM2M_OP_READ:
Expand Down

0 comments on commit b0303f5

Please sign in to comment.