Open robret77 opened 10 months ago
python's yaml package properly parses this:
{'pcrs': {'sha256': {1: 21079134437794183857440536639578330818725865347780897055713131410320316340765}}}
For untagged nodes spec their is no reason that should be interpreted as float, it should be either string or int.
This is a bug in the parser being used, but I don't disagree everything should be escaped as strings.
The more I look into this, this is a jq
bug. They actually roll their own parser with bison and flex. It never should choose float. Our work on next will correct all the YAML issues we have in a foolproof way, and provide a --canonical
output that will output everything quoted as well as with type information.
The computed PCR values at the end of the tpm2_eventlog YAML output can't be parsed correctly by YAML tools like the yq command line or online YAML formatters. The PCR hex values are transformed to float. It would probably be better to encode them as a strings by surrounding the hex values with double quotes. Tested with the current release 5.6 - 2023-11-08.
Sample output of tpm2_eventlog:
Sample output, parsed by yq and other tools:
Expected output of tpm2_eventlog: