Fix various things around signatures and their use in rust#3527
Merged
cgwalters merged 4 commits intoostreedev:mainfrom Sep 26, 2025
Merged
Fix various things around signatures and their use in rust#3527cgwalters merged 4 commits intoostreedev:mainfrom
cgwalters merged 4 commits intoostreedev:mainfrom
Conversation
When the gvariant is G_VARIANT_TYPE_BYTESTRING we need to duplicate the data we get from g_variant_get_fixed_array(), otherwise we will double-free it when we later free sign->secret_key.
This adds api docs to ostree_blob_reader_read_blob() so that we can mark the return value as nullable. This is needed, because this function can return NULL without setting error, and this needs to be handled in bindings (such as the rust ones).
This adds GLib.VariantDict, which is needed for ostree_repo_commit_add_composefs_metadata(), and OSTree.BlobReader which are needed for ostree_sign_read_sk(). With these we can sign ostree commits with composefs digests in them.
This adds the new bindings for signing and composefs use.
There was a problem hiding this comment.
Code Review
This pull request introduces a memory safety fix for signature handling and updates the Rust bindings. The changes in ostree_sign_ed25519.c and ostree_sign-spki.c address a potential use-after-free vulnerability by copying secret key data. The Rust bindings are regenerated to expose Ostree.BlobReader and GLib.VariantDict, and to correctly handle the nullable return from ostree_blob_reader_read_blob. My review of the changes did not identify any issues.
47f36ff to
3d4a8a5
Compare
alexlarsson
added a commit
to alexlarsson/rpm-ostree
that referenced
this pull request
Sep 26, 2025
This adds a new --sign-commit CLI option to `rpm-ostree experimental compose build-chunked-oci` which signs the embedded ostree commit. With this, it is possible (with some care) to layer a signed bootc image that uses old-school signed ostree/composefs support. Note, this relies on the double free fix for ostree_sign_set_sk() in ostreedev/ostree#3527 to work.
alexlarsson
added a commit
to alexlarsson/rpm-ostree
that referenced
this pull request
Sep 26, 2025
This adds a new --sign-commit CLI option to `rpm-ostree experimental compose build-chunked-oci` which signs the embedded ostree commit. With this, it is possible (with some care) to layer a signed bootc image that uses old-school signed ostree/composefs support. Note, this relies on the double free fix for ostree_sign_set_sk() in ostreedev/ostree#3527 to work.
cgwalters
approved these changes
Sep 26, 2025
Member
Author
|
@cgwalters How do we get 0.20.5 rust bindings released? |
Member
alexlarsson
added a commit
to alexlarsson/rpm-ostree
that referenced
this pull request
Oct 3, 2025
This adds a new --sign-commit CLI option to `rpm-ostree experimental compose build-chunked-oci` which signs the embedded ostree commit. With this, it is possible (with some care) to layer a signed bootc image that uses old-school signed ostree/composefs support. Note, this relies on the double free fix for ostree_sign_set_sk() in ostreedev/ostree#3527 to work.
alexlarsson
added a commit
to alexlarsson/rpm-ostree
that referenced
this pull request
Oct 3, 2025
This adds a new --sign-commit CLI option to `rpm-ostree experimental compose build-chunked-oci` which signs the embedded ostree commit. With this, it is possible (with some care) to layer a signed bootc image that uses old-school signed ostree/composefs support. Note, this relies on the double free fix for ostree_sign_set_sk() in ostreedev/ostree#3527 to work.
alexlarsson
added a commit
to alexlarsson/rpm-ostree
that referenced
this pull request
Oct 15, 2025
This adds a new --sign-commit CLI option to `rpm-ostree experimental compose build-chunked-oci` which signs the embedded ostree commit. With this, it is possible (with some care) to layer a signed bootc image that uses old-school signed ostree/composefs support. Note, this relies on the double free fix for ostree_sign_set_sk() in ostreedev/ostree#3527 to work.
alexlarsson
added a commit
to alexlarsson/rpm-ostree
that referenced
this pull request
Oct 15, 2025
This adds a new --sign-commit CLI option to `rpm-ostree experimental compose build-chunked-oci` which signs the embedded ostree commit. With this, it is possible (with some care) to layer a signed bootc image that uses old-school signed ostree/composefs support. Note, this relies on the double free fix for ostree_sign_set_sk() in ostreedev/ostree#3527 to work.
alexlarsson
added a commit
to alexlarsson/rpm-ostree
that referenced
this pull request
Oct 15, 2025
This adds a new --sign-commit CLI option to `rpm-ostree experimental compose build-chunked-oci` which signs the embedded ostree commit. With this, it is possible (with some care) to layer a signed bootc image that uses old-school signed ostree/composefs support. Note, this relies on the double free fix for ostree_sign_set_sk() in ostreedev/ostree#3527 to work.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'm working on some changes in rpm-ostree (will link later) that uses the signature support and the composefs digest. This is a set of changes that: