eriptic / uoscore-uedhoc

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

Static analyzer fix: out of bound memory access #53

Closed kamil-kielbasa-aa closed 1 year ago

kamil-kielbasa-aa commented 1 year ago

If initiator side will send empty list with supported cipher suites then responder side will not check this corner case. This result in out of bound memory access on stack by suites_i[-1]. At the end access will be following: suites_i[255] because of uint8_t overflow.

Proposal solution is to return new error value: suites_i_list_empty.