sancus-tee / sancus-core

Minimal OpenMSP430 hardware extensions for isolation and attestation
BSD 3-Clause "New" or "Revised" License
20 stars 13 forks source link

Check for illegal NULL-pointer in crypto engine #11

Open jovanbulck opened 7 years ago

jovanbulck commented 7 years ago

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.