tpm2-software.github.io icon indicating copy to clipboard operation
tpm2-software.github.io copied to clipboard

Do we need types in the Fapi Policy Generator

Open williamcroberts opened this issue 5 years ago • 1 comments

For things like numbers, why do we need the type selectors of hex or UINT32? These seem to do nothing as the data is dropped as is and quoted in the JSON policy. So it ends up as a string anyways. Wouldn't something like "0x30", "48", and "060" convert the same with strtoul semantics and base set to 0? If you want the type to be input natively as a json number I think only base10 is allowed so the tool can just take the value as a string, plop it through strtoul with base 0 and then output it in the json unquoted.

why-types

williamcroberts avatar Nov 18 '20 21:11 williamcroberts

The Question is, what happens when someone pastes an existing JSON policy containing a JSON-INT into the bottom field and hit's "update editor", since in that case the pasted JSON policy would be invalid wrt the schema. Need to be tested though...

P.S. In the spec we specified that JSON-INT would be the "normal form", so that's what fapi will produce on export.

AndreasFuchsTPM avatar Nov 19 '20 09:11 AndreasFuchsTPM