nsacyber/paccor

Powershell scripts save json files with extra bytes that break parsing

Closed this issue · 0 comments

Powershell can echo data and pipe it to a file just like on Linux. The difference is that pipe function in Powershell will place two bytes at the beginning of the file (0xFFFE). These two bytes have unknown functionality in Windows. They are not valid in a JSON file and break non-Windows JSON parsers.

The component gathering script was updated a while ago to print the component json file without those extra bytes. The policy and extension scripts were not updated at that time. Until it is fixed, pc_certgen.ps1 will produce a non-functional platform certificate because the policy and extension JSON files are not valid.