Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate format of downloaded content #155

Open
flit opened this issue Nov 23, 2020 · 0 comments
Open

Validate format of downloaded content #155

flit opened this issue Nov 23, 2020 · 0 comments

Comments

@flit
Copy link
Member

flit commented Nov 23, 2020

In certain cases, the .pdsc file that is downloaded has turned out to not be XML in the PDSC schema. CPM should validate that downloaded .pdsc files are indeed XML. It doesn't need to run a full verification against the schema; simply checking for <?xml version="1.0" encoding="UTF-8"?> and the opening <package> element are sufficient.

CPM should also verify that downloaded .pack files are indeed Zip archives. It can probably use a very simple test of the magic number (see the Wikipedia article). While not completely reliable, it should hopefully be sufficient for CPM's needs due to the pack format being constrained (not arbitrary zip files).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant