File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 11mypy==1.10.0
22black==24.4.2
33isort==5.13.2
4- pylint==3.1.1
4+ pylint==3.2.2
55bandit==1.7.8
Original file line number Diff line number Diff line change @@ -165,14 +165,18 @@ def _get_hash_algorithm(public_key: Key) -> str:
165165 if public_key .keytype == "rsa" :
166166 # hash algorithm is encoded as last scheme portion
167167 algo = public_key .scheme .split ("-" )[- 1 ]
168- if public_key .keytype in [
168+ elif public_key .keytype in [
169169 "ecdsa" ,
170170 "ecdsa-sha2-nistp256" ,
171171 "ecdsa-sha2-nistp384" ,
172172 ]:
173173 # nistp256 uses sha-256, nistp384 uses sha-384
174174 bits = public_key .scheme .split ("-nistp" )[- 1 ]
175175 algo = f"sha{ bits } "
176+ else :
177+ raise exceptions .UnsupportedAlgorithmError (
178+ f"Unsupported key type { public_key .keytype } in key { public_key .keyid } "
179+ )
176180
177181 # trigger UnsupportedAlgorithm if appropriate
178182 _ = sslib_hash .digest (algo )
You can’t perform that action at this time.
0 commit comments