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

Add ContainerReader utility check_container() #9

Closed
pakal opened this issue Aug 5, 2020 · 5 comments
Closed

Add ContainerReader utility check_container() #9

pakal opened this issue Aug 5, 2020 · 5 comments

Comments

@pakal
Copy link
Member

pakal commented Aug 5, 2020

This utility loops on container data like decrypt_data() ; it checks that everything is fine in the container (proper algo codes, data structures, presence of the offladed data file near the container if needed...).

It returns a list of error messages (translatable), for all problems encountered.

@pakal
Copy link
Member Author

pakal commented Aug 26, 2020

"Create a function def check_container(container_filepath)" which does this:

  • load container using load_container_from_filesystem(container_filepath, include_data_ciphertext=False)
  • loop on the different parts of the file, by ASSUMING that all are of the proper type (no need for isinstance() calls)
  • check that enumeration values are correct, for example that "key_encryption_algo" belongs to "ASYMMETRIC_KEY_TYPES_REGISTRY or SHARED_SECRET_MARKER", same thing for key types, signature types etc.
  • when an error is encountered, add it as a properly formatted English error message to an "errors" list (e.g. something like "Invalid signature type %r encountered" % signature_type )
  • return that errors list at the end

TEST this function by creating a broken encrypted container which has 1 error of each type, and checking it, to ensure that it returns a list with all proper errors.
Also test that a valid container (created with encrypt_bytestring()) returns an EMPTY list of errors.

@pakal
Copy link
Member Author

pakal commented Sep 19, 2020

This will need to use type validation tools of ticket #15

@pakal
Copy link
Member Author

pakal commented Nov 4, 2021

Security checks should be added like, number of layers in data-encryption and key-encryption

@pakal
Copy link
Member Author

pakal commented Jun 3, 2022

For now we have check_cryptainer_sanity() and check_cryptoconf_sanity(), which do not aggregate errors, but check types and enumerations properly.

What remains to be done : "Security checks should be added like, number of layers in data-encryption and key-encryption"

@pakal
Copy link
Member Author

pakal commented Feb 17, 2023

Superseded by #41

@pakal pakal closed this as completed Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant