We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9f20e28 commit fe29ba8Copy full SHA for fe29ba8
sigstore/_utils.py
@@ -159,11 +159,11 @@ def key_id(key: PublicKey) -> KeyID:
159
160
return KeyID(hashlib.sha256(public_bytes).digest())
161
162
-def hazmat_digest_to_bundle(algo: str):
163
- lookup = {"sha256": HashAlgorithm.SHA2_256}
+def hazmat_digest_to_bundle(algo: str) -> HashAlgorithm:
+ lookup = {hashes.SHA256().name: HashAlgorithm.SHA2_256}
164
if algo in lookup:
165
- return lookup[algo]
166
- return algo
+ return HashAlgorithm(lookup[algo])
+ return ValueError(f"unknown digest algorithm {algo}")
167
168
def get_digest(
169
input_: IO[bytes],
0 commit comments