Remove schema checks in securesystemslib.gpg #775
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
blocks on #772 (commits are included in this PR)In preparation for the removal of schema.py (#183), this patch removes schema checks in the following modules of the
securesystemslib.gpgsubpackage:internal modules
rsa,dsa,eddsa,common. These checks are redundant with schema checks that are already performed in the calling functions of thefunctionsmodule.in previously public
functionsmodule:create_signatureandexport_pubkeyfunctionsverify_signaturefunctionThis is okay for two reasons:
the preferred way of interacting with
securesystemslib.gpg.functionsis viaGPGSigner, which controls the format of the passed arguments to some extentsecuresystemslib.gpg still raises meaningful and even more consistent errors for invalid arguments anyway, than it did before. E.g. a keyid passed to
export_pubkeythat doesn't conform to the previously checked hex schema, now raises aKeyNotFoundError.Other changes include:
GPG_HASH_ALGORITHM_STRINGfromsecuresystemslib.schemato the better suitedsecureystemslib.gpg.constantsmodule.