Skip to content

Commit

Permalink
firmly pin in-toto-attestation, fix KindVersion
Browse files Browse the repository at this point in the history
Signed-off-by: William Woodruff <william@trailofbits.com>
  • Loading branch information
woodruffw committed Dec 11, 2023
1 parent ea548a7 commit b24c9b7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dependencies = [
"cryptography >= 39",
"id >= 1.1.0",
"importlib_resources ~= 5.7; python_version < '3.11'",
"in-toto-attestation ~= 0.9",
"in-toto-attestation == 0.9.2",
"pydantic >= 2,< 3",
"pyjwt >= 2.1",
"pyOpenSSL >= 23.0.0",
Expand Down
10 changes: 9 additions & 1 deletion sigstore/sign.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,14 @@ class SigningResult:
A record of the Rekor log entry for the signing operation.
"""

@property
def _kind_version(self) -> KindVersion:
# TODO: This is kind of a hack.
if isinstance(self.content, MessageSignature):
return KindVersion(kind="hashedrekord", version="0.0.1")
else:
return KindVersion(kind="dsse", version="0.0.1")

@property
def b64_signature(self) -> B64Str:
"""
Expand Down Expand Up @@ -398,7 +406,7 @@ def to_bundle(self) -> Bundle:
tlog_entry = TransparencyLogEntry(
log_index=self.log_entry.log_index,
log_id=LogId(key_id=bytes.fromhex(self.log_entry.log_id)),
kind_version=KindVersion(kind="hashedrekord", version="0.0.1"),
kind_version=self._kind_version,
integrated_time=self.log_entry.integrated_time,
inclusion_promise=InclusionPromise(
signed_entry_timestamp=base64.b64decode(
Expand Down

0 comments on commit b24c9b7

Please sign in to comment.