Currently, sancus_wrap assumes some arguments (e.g., associated data) are valid non-NULL pointers. This can result in weird bugs from 0x0+offset memory writes.
While this is not a security issue, as trusted intra-SM code should never invoke sancus_wrap with incorrect arguments, and crypto memory accesses are subject to the usual memory protection checks, we could easily detect illegal arguments and fail with an error code return value.
Currently, sancus_wrap assumes some arguments (e.g., associated data) are valid non-NULL pointers. This can result in weird bugs from 0x0+offset memory writes.
While this is not a security issue, as trusted intra-SM code should never invoke sancus_wrap with incorrect arguments, and crypto memory accesses are subject to the usual memory protection checks, we could easily detect illegal arguments and fail with an error code return value.