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.gpg
subpackage:internal modules
rsa
,dsa
,eddsa
,common
. These checks are redundant with schema checks that are already performed in the calling functions of thefunctions
module.in previously public
functions
module:create_signature
andexport_pubkey
functionsverify_signature
functionThis is okay for two reasons:
the preferred way of interacting with
securesystemslib.gpg.functions
is 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_pubkey
that doesn't conform to the previously checked hex schema, now raises aKeyNotFoundError
.Other changes include:
GPG_HASH_ALGORITHM_STRING
fromsecuresystemslib.schema
to the better suitedsecureystemslib.gpg.constants
module.