Skip to content

Commit

Permalink
Merge pull request #814 from secure-systems-lab/dependabot/pip/test-a…
Browse files Browse the repository at this point in the history
…nd-lint-dependencies-39b6280e92

build(deps): bump pylint from 3.1.1 to 3.2.2 in the test-and-lint-dependencies group
  • Loading branch information
jku authored May 21, 2024
2 parents 323d572 + f61cf1a commit bc6f882
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion requirements-lint.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
mypy==1.10.0
black==24.4.2
isort==5.13.2
pylint==3.1.1
pylint==3.2.2
bandit==1.7.8
6 changes: 5 additions & 1 deletion securesystemslib/signer/_gcp_signer.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,18 @@ def _get_hash_algorithm(public_key: Key) -> str:
if public_key.keytype == "rsa":
# hash algorithm is encoded as last scheme portion
algo = public_key.scheme.split("-")[-1]
if public_key.keytype in [
elif public_key.keytype in [
"ecdsa",
"ecdsa-sha2-nistp256",
"ecdsa-sha2-nistp384",
]:
# nistp256 uses sha-256, nistp384 uses sha-384
bits = public_key.scheme.split("-nistp")[-1]
algo = f"sha{bits}"
else:
raise exceptions.UnsupportedAlgorithmError(
f"Unsupported key type {public_key.keytype} in key {public_key.keyid}"
)

# trigger UnsupportedAlgorithm if appropriate
_ = sslib_hash.digest(algo)
Expand Down

0 comments on commit bc6f882

Please sign in to comment.