microsoft / ms-tpm-20-ref

Reference implementation of the TCG Trusted Platform Module 2.0 specification.
Other
345 stars 134 forks source link

Table-driven marshalling code is not type-safe #104

Open DemiMarie opened 11 months ago

DemiMarie commented 11 months ago

The table-driven marshalling code is not type-safe: it accepts void * pointers for the data to be marshalled, which is extremely error-prone. This can be solved by using static inline functions instead of #define macros. These functions will be inlined by the compiler and therefore have no run-time overhead.

I cannot fix this as the code generator is not publically available.