libspdm icon indicating copy to clipboard operation
libspdm copied to clipboard

Document libspdm requirements and assumptions for target compiler and system

Open steven-bellock opened this issue 4 years ago • 3 comments

This is more to raise awareness rather than fix a bug, although we could fix the bug too since this is security-critical code. spdm_init_context zeros out spdm_context via zero_mem(spdm_context, sizeof(spdm_context_t)); Later on checks are performed such as if (spdm_context->local_context.local_cert_chain_provision[slot_id] == NULL) The C language does not guarantee that a pointer that has been memset to 0 evaluate to NULL. At the very least we should document this in a "language implementation decisions" document.

steven-bellock avatar Aug 31 '21 23:08 steven-bellock

Need a document in the doc/ folder that goes over assumptions.

steven-bellock avatar Sep 13 '21 14:09 steven-bellock

libspdm also assumes that the underlying encoding of character constants is ASCII.

steven-bellock avatar Jul 17 '22 19:07 steven-bellock

libspdm also assumes that the compiler supports pragma pack.

steven-bellock avatar Jul 18 '22 14:07 steven-bellock

libspdm assumes little endian architecture. Once that has been documented then this can be closed.

steven-bellock avatar Feb 27 '23 15:02 steven-bellock