diff --git a/Makefile b/Makefile index 6903976..665c63c 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ $(PYTHON_DIR): . $(abspath $(VENVDIR)/bin/activate) && pip install --upgrade pip . $(abspath $(VENVDIR)/bin/activate) && pip install --upgrade wheel . $(abspath $(VENVDIR)/bin/activate) && pip install --upgrade in-toto - . $(abspath $(VENVDIR)/bin/activate) && pip install --upgrade in-toto-attestation>=0.9.2 + . $(abspath $(VENVDIR)/bin/activate) && pip install --upgrade in-toto-attestation>=0.9.3 . $(abspath $(VENVDIR)/bin/activate) && pip install --upgrade ./python $(VENVDIR): diff --git a/examples/gcc-helloworld/run-example.sh b/examples/gcc-helloworld/run-example.sh index 4c22682..5d23118 100755 --- a/examples/gcc-helloworld/run-example.sh +++ b/examples/gcc-helloworld/run-example.sh @@ -3,7 +3,6 @@ # Copyright 2023 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -VENV_DIR="${VENVDIR:=../../scai-venv}" EXAMPLE_DIR=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) # ----------------------------------------------------------------- @@ -12,8 +11,6 @@ EXAMPLE_DIR=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) mkdir -p ${EXAMPLE_DIR}/metadata -source ${VENV_DIR}/bin/activate - echo RUN GCC gcc -fstack-protector -o ${EXAMPLE_DIR}/hello-world ${EXAMPLE_DIR}/hello-world.c diff --git a/python/scai_generator/cli/gen_attr_assertion.py b/python/scai_generator/cli/gen_attr_assertion.py index 69ebd2a..7f88598 100644 --- a/python/scai_generator/cli/gen_attr_assertion.py +++ b/python/scai_generator/cli/gen_attr_assertion.py @@ -28,8 +28,6 @@ import google.protobuf.json_format as pb_json -from securesystemslib.util import get_file_hashes - def Main(): parser = argparse.ArgumentParser(allow_abbrev=False) diff --git a/python/scai_generator/cli/gen_resource_desc.py b/python/scai_generator/cli/gen_resource_desc.py index 6e47774..1930829 100644 --- a/python/scai_generator/cli/gen_resource_desc.py +++ b/python/scai_generator/cli/gen_resource_desc.py @@ -23,7 +23,7 @@ from scai_generator.utility import load_json_file from in_toto_attestation.v1.resource_descriptor import ResourceDescriptor -from securesystemslib.util import get_file_hashes +from securesystemslib.hash import digest_filename import google.protobuf.json_format as pb_json def Main(): @@ -57,7 +57,10 @@ def Main(): resource_digest_set = {} if options.digest and resource_file_path: - resource_digest_set = get_file_hashes(resource_file_path) + # we're ok with using the default hash algorithm (sha256) + hash_obj = digest_filename(resource_file_path) + # convert the hash object into a digest set + resource_digest_set.update({hash_obj.name: hash_obj.hexdigest()}) resource_bytes = bytes() if options.content and resource_file_path: