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

Cryptography module, integrity checking commands and small fixes #108

Merged
merged 17 commits into from
Jul 26, 2022

Conversation

lud0v1c
Copy link
Contributor

@lud0v1c lud0v1c commented Jul 17, 2022

This PR adds a "cryptography" module in order to support more advanced security features, such as integrity checking, and later on, digitally Signed Packs. The implementation is based on the ongoing discussion for a Signed Packs feature, started in #8. Checksum support has also been requested before (#91).

Currently only the "sha256" digest is supported, which is the industry standard for most cases. The new commands are:

  • cpackget checksum-create takes a local .pack and creates a .checksum file, similar to the typical digest files (like .sha256). It contains a list of all the pack files and their digest, whose cryptographic hash function is provided in the filename (e.g: TheVendor.ThePack.1.2.3.sha256.checksum).
  • cpackget-verify takes that .checksum file and verifies the integrity of a local .pack, assuming it was generated with the other command.

It also includes small fixes regarding issues #85 and #93.

lud0v1c and others added 5 commits June 22, 2022 16:40
Prints CMSIS_PACK_ROOT value in the index and update-index command descriptions, with a different output based on OS.

Addresses Open-CMSIS-Pack#93.
This patch adds a new cryptography module, and two new commands to verify pack integrity.

'cpackget checksum-create' takes a local .pack and creates a .checksum file, similar to the typical digest files (like .sha256). It contains a list of all the pack files and their digest, whose cryptographic hash function is provided in the filename ('TheVendor.ThePack.1.2.3.sha256.checksum', for example).

'cpackget-verify' takes that .checksum file and verifies the integrity of a .pack, assuming it was generated with the other command.
cmd/commands/checksum.go Outdated Show resolved Hide resolved
cmd/commands/checksum.go Outdated Show resolved Hide resolved
cmd/commands/checksum.go Outdated Show resolved Hide resolved
cmd/commands/checksum.go Outdated Show resolved Hide resolved
cmd/cryptography/checksum.go Outdated Show resolved Hide resolved
cmd/cryptography/checksum.go Outdated Show resolved Hide resolved
cmd/cryptography/checksum.go Outdated Show resolved Hide resolved
cmd/cryptography/checksum.go Outdated Show resolved Hide resolved
cmd/cryptography/checksum.go Outdated Show resolved Hide resolved
@chaws
Copy link
Contributor

chaws commented Jul 18, 2022

It looks good! I left a few nit-pick comments and one major concern about speed (regarding decompressing etc). Tests are also missing, but I talked to Luis earlier today and he's working on that.

Good work!

@lud0v1c
Copy link
Contributor Author

lud0v1c commented Jul 22, 2022

Cleaned up function descriptions a bit, but should be good to go.

cmd/cryptography/checksum.go Outdated Show resolved Hide resolved
cmd/cryptography/checksum.go Outdated Show resolved Hide resolved
@chaws chaws merged commit d8e084f into Open-CMSIS-Pack:main Jul 26, 2022
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

Successfully merging this pull request may close these issues.

None yet

2 participants