OpenShift Merge Robot [Tue, 27 Oct 2020 19:10:58 +0000 (15:10 -0400)]
Merge pull request #2225 from jlebon/pr/clear-timer
lib/fetch-curl: Unref timeout source
Jonathan Lebon [Tue, 27 Oct 2020 15:58:14 +0000 (11:58 -0400)]
lib/fetch-curl: Unref timeout source
The timeout timer should always be one-shot, so let's just always
destroy it in the callback. The main context has its own ref on it, so
it won't be freed behind its back.
This *should* fix a leak that was brought up in
https://bugzilla.redhat.com/show_bug.cgi?id=
1891761.
Reported-by: Milan Crha <mcrha@redhat.com>
Jonathan Lebon [Tue, 27 Oct 2020 15:57:00 +0000 (11:57 -0400)]
lib/fetcher-curl: Use G_SOURCE_REMOVE instead of FALSE
They're equivalent, though I prefer the former because it's more
descriptive and it makes it really obvious that it's a `GSource`
callback.
OpenShift Merge Robot [Fri, 23 Oct 2020 13:05:24 +0000 (09:05 -0400)]
Merge pull request #2188 from alexlarsson/delta-indexes
Add indexes for deltas outside of the summary
Alexander Larsson [Tue, 20 Oct 2020 13:51:08 +0000 (15:51 +0200)]
ostree pull: Add more g_debug spew around fetching deltas
This is useful to debug what is happening when downloading via deltas.
Alexander Larsson [Tue, 20 Oct 2020 06:37:35 +0000 (08:37 +0200)]
Add ostree_repo_gpg_sign_data()
This is similar to ostree_sign_data() but for the old gpg code.
Flatpak will need this to reproduce a signed summary.
Alexander Larsson [Fri, 9 Oct 2020 14:30:29 +0000 (16:30 +0200)]
tests: Add a testcase to ensure we're not using the summary if we don't need it
With deltas outside the summary, if a commit is specified when pulling
we don't download the summary. Verify this.
Alexander Larsson [Fri, 23 Oct 2020 11:05:25 +0000 (13:05 +0200)]
pull: Only download summary if we need it for the pull operation
If we have a commit id for all the refs we're pulling, and if we
don't need the summary to list all the refs when mirroring then the
only reason to download the summary is for the list of deltas.
With the new "indexed-deltas" property in the config file (and mirrored
to the summary file) we can detect when we don't need the summary for
deltas and completely avoid downloading it then.
Alexander Larsson [Fri, 9 Oct 2020 08:55:52 +0000 (10:55 +0200)]
deltas: Set `indexed-deltas` key in the config and summary
Clients can use these during pull and avoid downloading the summary if
needed, or use the indexed-deltas instead of relying on the ones in
the summary which may be left out.
Alexander Larsson [Fri, 9 Oct 2020 08:15:42 +0000 (10:15 +0200)]
deltas: Take a shared repo lock while reindexing deltas
This ensures we're not racing with a prune operation that can be removing
the delta indexes we're relying on.
Alexander Larsson [Tue, 1 Sep 2020 14:00:08 +0000 (16:00 +0200)]
deltas: Add tests for delta indexes
This tests generation of the index as well as using it when pulling
Alexander Larsson [Tue, 1 Sep 2020 12:52:49 +0000 (14:52 +0200)]
deltas: Use delta indexes when pulling
If there is no delta index in the summary, try to fetch the
delta index for the commit we're going to and use that to find the
delta (if any).
Alexander Larsson [Tue, 1 Sep 2020 10:28:17 +0000 (12:28 +0200)]
deltas: Add CLI ops to list and reindex delta-indexes
Alexander Larsson [Mon, 12 Oct 2020 13:57:53 +0000 (15:57 +0200)]
deltas: Make ostree_repo_static_delta_reindex() public
It is useful to be able to trigger this without having to regenerate
the summary. For example, if you are not using summaries, or ar generating
the summaries yourself.
Alexander Larsson [Tue, 1 Sep 2020 10:26:17 +0000 (12:26 +0200)]
deltas: Add and document no-deltas-in-summary config option
By default this is FALSE to keep existing clients working.
Alexander Larsson [Tue, 1 Sep 2020 10:05:36 +0000 (12:05 +0200)]
deltas: Update delta indexes when updating summary
When we update the summary file (and its list of deltas) we also update
all delta indexes. The index format is a single `a{sv}` variant identical
to the metadata-part of the summary with (currently) only the
`ostree.static-deltas` key.
Since we expect most delta indexes to change rarely, we avoid
unnecessary writes when reindexing. New indexes are compared to
existing ones and only the changed ones are written to disk. This
avoids unnecessary write load and mtime changes on the repo server.
Alexander Larsson [Tue, 1 Sep 2020 10:03:40 +0000 (12:03 +0200)]
deltas: Add ostree_repo_list_static_delta_indexes() function
This lists all the available delta indexes.
Alexander Larsson [Tue, 1 Sep 2020 10:00:32 +0000 (12:00 +0200)]
deltas: Add _ostree_get_relative_static_delta_index_path()
This gets the subpath for a delta index file, which is of the form
"delta-indexes/$commit.index", that contains all the deltas going
to the particular commit.
OpenShift Merge Robot [Thu, 22 Oct 2020 22:20:23 +0000 (18:20 -0400)]
Merge pull request #2205 from pwithnall/etags-and-last-modified
Add support for ETag and Last-Modified headers for summary and summary.sig
Philip Withnall [Fri, 16 Oct 2020 16:05:54 +0000 (17:05 +0100)]
tests: Split RFC 2616 date parsing code out and add tests
This makes it testable, and increases its test coverage too 100% of
lines, as measured by `make coverage`.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Philip Withnall [Fri, 9 Oct 2020 17:46:06 +0000 (18:46 +0100)]
ostree/trivial-httpd: Add Last-Modified/ETag support
This is basic support for the
Last-Modified/ETag/If-Modified-Since/If-None-Match headers. It’s not
high performance, and doesn’t support all of the related caching
features (like the If-Match header, etc.).
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Philip Withnall [Fri, 9 Oct 2020 17:34:55 +0000 (18:34 +0100)]
tests: Add simple test for summary file caching
This test would have actually passed before the summary file caching
changes (in the previous few commits) were added, as the `summary.sig`
essentially acted as the ETag for the summary file, and itself wasn’t
updated on disk if it didn’t change when querying the server.
Actually testing that the HTTP caching headers are working to reduce
HTTP traffic would require test hooks into the pull code or the
trivial-httpd server, neither of which I have the time to add at the
moment.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Philip Withnall [Tue, 29 Sep 2020 09:51:26 +0000 (10:51 +0100)]
lib/pull: Hook up HTTP caching headers for summary and summary.sig
As `summary` and `summary.sig` aren’t immutable, HTTP requests to
download them can be optimised by sending the `If-None-Match` and
`If-Modified-Since` headers to avoid unnecessarily re-downloading them
if they haven’t changed since last being checked.
Hook them up to the new support for that in the fetcher.
The `ETag` and `Last-Modified` for each file in the cache are stored as
the `user.etag` xattr and the mtime, respectively. For flatpak, for
example, this affects the cached files in
`~/.local/share/flatpak/repo/tmp/cache/summaries`.
If xattrs aren’t supported, or if the server doesn’t support the caching
headers, the pull behaviour is unchanged from before.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Philip Withnall [Thu, 24 Sep 2020 16:49:48 +0000 (17:49 +0100)]
libostree: Add support for ETag and Last-Modified headers
Add support in the soup and curl fetchers to send the `If-None-Match`
and `If-Modified-Since` request headers, and pass on the `ETag` and
`Last-Modified` response headers.
This currently introduces no functional changes, but once call sites
provide the appropriate integration, this will allow HTTP caching to
happen with requests (typically with metadata requests, where the data
is not immutable due to being content-addressed). That should reduce
bandwidth requirements.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
OpenShift Merge Robot [Tue, 20 Oct 2020 20:48:37 +0000 (16:48 -0400)]
Merge pull request #2222 from fkrull/patch-v2020.7
lib: add missing GI annotation
OpenShift Merge Robot [Mon, 19 Oct 2020 18:11:50 +0000 (14:11 -0400)]
Merge pull request #2221 from kelvinfan001/fix-docs
docs: Fix various typos
Kelvin Fan [Thu, 15 Oct 2020 23:51:44 +0000 (19:51 -0400)]
docs: Fix various typos
Felix Krull [Sat, 17 Oct 2020 20:14:09 +0000 (22:14 +0200)]
lib: fix GI parameter tags
OpenShift Merge Robot [Thu, 15 Oct 2020 20:15:37 +0000 (16:15 -0400)]
Merge pull request #2219 from jlebon/pr/fix-inode-print-format
ostree-prepare-root: print st_dev and st_ino as 64-bit ints
OpenShift Merge Robot [Thu, 15 Oct 2020 19:27:48 +0000 (15:27 -0400)]
Merge pull request #2218 from cgwalters/travis-32bit
travis: Add a 32 bit build
Jonathan Lebon [Thu, 15 Oct 2020 16:05:34 +0000 (12:05 -0400)]
ostree-prepare-root: print st_dev and st_ino as 64-bit ints
This matches what systemd does and should work fine on all platforms.
Possibly resolves: https://bugzilla.redhat.com/show_bug.cgi?id=
1888436
Colin Walters [Thu, 15 Oct 2020 13:35:40 +0000 (09:35 -0400)]
travis: Add a 32 bit build
In the past we've had 32 bit bugs that were caught by
the compiler, let's add this to Travis.
OpenShift Merge Robot [Tue, 13 Oct 2020 22:45:13 +0000 (00:45 +0200)]
Merge pull request #2215 from cgwalters/fd-transfer
deploy: Remove (transfer none) from fd arg
OpenShift Merge Robot [Tue, 13 Oct 2020 22:18:49 +0000 (00:18 +0200)]
Merge pull request #2214 from cgwalters/release-2020-7
Release 2020.7
Colin Walters [Tue, 13 Oct 2020 21:39:18 +0000 (17:39 -0400)]
deploy: Remove (transfer none) from fd arg
GI complains. And in general one needs to assume that file
descriptors aren't stolen.
Colin Walters [Tue, 13 Oct 2020 18:33:14 +0000 (14:33 -0400)]
Post-release version bump
Colin Walters [Tue, 13 Oct 2020 18:31:26 +0000 (14:31 -0400)]
Release 2020.7
OpenShift Merge Robot [Thu, 8 Oct 2020 19:18:34 +0000 (15:18 -0400)]
Merge pull request #2213 from alexlarsson/summary-bugfixes
Various fixes from the indexed-summaries branch
Alexander Larsson [Wed, 16 Sep 2020 13:54:03 +0000 (15:54 +0200)]
signatures: Fix leak in _sign_detached_metadata_append()
This needs to ref_sink the returned variant, as it is used with g_autoptr
in the callers.
Alexander Larsson [Wed, 16 Sep 2020 10:09:41 +0000 (12:09 +0200)]
fetch_summary_with_options: Fix n-network-retries option parsing
"&u" is not a valid gvariant format string, it should just be "u".
Alexander Larsson [Mon, 14 Sep 2020 11:52:10 +0000 (13:52 +0200)]
ostree_repo_find_remotes_async: Fix leak of summary
We were creating a GVariant from a GBytes and storing it in an
g_autoptr without ref_sinking it.
OpenShift Merge Robot [Wed, 7 Oct 2020 19:34:22 +0000 (15:34 -0400)]
Merge pull request #2212 from jlebon/pr/packit-tweak
ci: Make Packit ignore downstream patches
OpenShift Merge Robot [Wed, 7 Oct 2020 19:23:43 +0000 (15:23 -0400)]
Merge pull request #2211 from jlebon/pr/close-fd
lib/deploy: Don't leak fd when checksumming dtbs
Jonathan Lebon [Wed, 7 Oct 2020 19:04:17 +0000 (15:04 -0400)]
ci: Make Packit ignore downstream patches
We don't really carry "Fedora-only" patches in dist-git. So we want to
nuke all the patches which exist there.
Follow-up to #2210.
Jonathan Lebon [Wed, 7 Oct 2020 18:44:25 +0000 (14:44 -0400)]
lib/deploy: Don't leak fd when checksumming dtbs
Likely the root of https://bugzilla.redhat.com/show_bug.cgi?id=
1886149.
OpenShift Merge Robot [Wed, 7 Oct 2020 13:46:14 +0000 (09:46 -0400)]
Merge pull request #2210 from jlebon/pr/packit
Add Packit integration
Jonathan Lebon [Sat, 3 Oct 2020 15:23:49 +0000 (11:23 -0400)]
Add Packit integration
This is a basic `.packit.yaml` integration file which will allow us have
continuous builds of OSTree in cosa and upstream CI. If things go well,
we'll likely deploy this in other build tools like rpm-ostree.
Prompted by wanting to get #2155 out to unblock
https://github.com/coreos/rpm-ostree/pull/2170.
OpenShift Merge Robot [Mon, 5 Oct 2020 20:06:38 +0000 (22:06 +0200)]
Merge pull request #2198 from cgwalters/no-hardlink-zerosize
checkout: Don't hardlink zero sized files
OpenShift Merge Robot [Mon, 5 Oct 2020 19:50:00 +0000 (21:50 +0200)]
Merge pull request #2209 from travier/docs-fixup
docs: Fix URL in Jekyll _config.yml
Timothée Ravier [Mon, 5 Oct 2020 19:10:31 +0000 (21:10 +0200)]
docs: Fix URL in Jekyll _config.yml
OpenShift Merge Robot [Mon, 5 Oct 2020 18:56:35 +0000 (20:56 +0200)]
Merge pull request #2208 from cgwalters/bump-libglnx
libglnx: Bump to master
OpenShift Merge Robot [Mon, 5 Oct 2020 18:19:29 +0000 (20:19 +0200)]
Merge pull request #2207 from travier/docs
docs: Add GitHub Pages support
Colin Walters [Mon, 5 Oct 2020 18:04:21 +0000 (14:04 -0400)]
libglnx: Bump to master
To pull in the fix for `/var/tmp` on NixOS but also
on general principle.
Update submodule: libglnx
```
Colin Walters (1):
xattrs: Add better error prefixing
Rebecca Turner (2):
glnx-fdio: try $TMPDIR if /var/tmp doesn't exist
glnx-fdio: use $TMPDIR if set
```
OpenShift Merge Robot [Fri, 2 Oct 2020 20:41:01 +0000 (16:41 -0400)]
Merge pull request #2155 from jlebon/pr/add-initrds
lib/deploy: Add support for overlay initrds
Timothée Ravier [Fri, 2 Oct 2020 12:40:16 +0000 (14:40 +0200)]
README: Update and mention new docs
Timothée Ravier [Fri, 2 Oct 2020 12:38:20 +0000 (14:38 +0200)]
docs: Move historical README to the docs
Timothée Ravier [Fri, 2 Oct 2020 12:34:33 +0000 (14:34 +0200)]
docs: Move and update pages from the manual
Timothée Ravier [Wed, 30 Sep 2020 17:22:29 +0000 (19:22 +0200)]
docs: Update Contributing and tutorial pages
Colin Walters [Wed, 16 Sep 2020 00:35:33 +0000 (00:35 +0000)]
checkout: Don't hardlink zero sized files
Alternative to https://github.com/ostreedev/ostree/pull/2197
Python's (usually) zero-sized `__init__.py` files can provoke
us hitting the hardlink limits on some filesystems (`EMLINK`).
At least one Fedora rpm-ostree user hit this.
The benefits of hardlinking here are quite marginal; lots
of hardlinks can behave suboptimally in particular filesystems
like BTRFS too.
This builds on prior code which made this an option, introduced
in https://github.com/ostreedev/ostree/commit/
673cacd633f9d6b653cdea530657d3e780a41bbd
Now we just do it uncondtionally.
Also this provoked a different bug in a very obscure user mode checkout
case; when the "real" permissions were different from the "physical"
permissions, we would still hardlink. Fix the test case for this.
OpenShift Merge Robot [Thu, 1 Oct 2020 20:46:29 +0000 (16:46 -0400)]
Merge pull request #2167 from pwithnall/2165-dont-download-config
Avoid need to download remote config when pulling
Timothée Ravier [Mon, 28 Sep 2020 15:02:45 +0000 (17:02 +0200)]
docs: Update Index page
Timothée Ravier [Mon, 28 Sep 2020 14:55:03 +0000 (16:55 +0200)]
docs: Add Jekyll and theme config
Philip Withnall [Mon, 10 Aug 2020 11:07:22 +0000 (12:07 +0100)]
ostree/dump: Fix a memory leak
Re-using the `refs` variable for the main list of refs, plus the
iterated lists, meant that the main list was never freed (although all
the iterated ones were freed correctly).
Fix this by using two variables rather than reusing the one.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Philip Withnall [Mon, 10 Aug 2020 11:06:35 +0000 (12:06 +0100)]
lib/pull: Read mode and tombstone options from summary file if possible
Otherwise, fall back to downloading and reading them from the `config`
file. See the previous commit for details.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Fixes: #2165
Philip Withnall [Mon, 10 Aug 2020 11:05:06 +0000 (12:05 +0100)]
lib/repo: Add mode and tombstone config options to the summary file
Currently, they are set in the `config` file and cause that to be
downloaded on every pull. Given that the client is already pulling the
`summary` file, it makes sense to avoid an additional network round trip
and cache those options in the `summary` file.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Helps: #2165
Jonathan Lebon [Mon, 17 Aug 2020 13:48:18 +0000 (09:48 -0400)]
lib/deploy: Add support for overlay initrds
In FCOS and RHCOS, the need to configure software in the initramfs has
come up multiple times. Sometimes, using kernel arguments suffices.
Other times, it really must be a configuration file. Rebuilding the
initramfs on the client-side however is a costly operation. Not only
does it add complexity to the update workflow, it also erodes a lot of
the value obtained from using the baked "blessed" initramfs from the
tree itself.
One elegant way to address this is to allow specifying multiple
initramfses. This is supported by most bootloaders (notably GRUB) and
results in each initrd being overlayed on top of each other.
This patch allows libostree clients to leverage this so that they can
avoid regenerating the initramfs entirely. libostree itself is agnostic
as to what kind and how much data overlay initrds contain. It's up to
the clients to enforce such boundaries.
To implement this, we add a new ostree_sysroot_stage_overlay_initrd
which takes a file descriptor and returns a checksum. Then users can
pass these checksums when calling the deploy APIs via the new array
option `overlay_initrds`. We copy these files into `/boot` and add them
to the BLS as another `initrd` entry.
Jonathan Lebon [Mon, 17 Aug 2020 13:48:17 +0000 (09:48 -0400)]
lib/deploy: Add deploy/stage APIs with options
And make the `override_kernel_argv` one of those options. This is mostly
a mechanical move here, no functional change otherwise.
Prep for adding a new option.
Jonathan Lebon [Mon, 17 Aug 2020 13:48:16 +0000 (09:48 -0400)]
lib/bootconfig: Add support for multiple initrd keys
Prep for actually teaching the rest of the codebase about this.
We keep the primary initrd in the `options` hash table for backwards
compatibility.
OpenShift Merge Robot [Wed, 30 Sep 2020 17:22:49 +0000 (17:22 +0000)]
Merge pull request #2204 from jlebon/pr/versioning-tweaks
Various minor versioning related tweaks
Jonathan Lebon [Fri, 25 Sep 2020 19:01:09 +0000 (15:01 -0400)]
lib: Minor versioning related fixes
Fix/add the `Since` marker to the new static delta APIs, and update the
symbol versioning templates/comments.
Jonathan Lebon [Fri, 25 Sep 2020 18:59:45 +0000 (14:59 -0400)]
Makefile-libostree.am: Uncomment BUILDOPT_IS_DEVEL_BUILD conditional
We shouldn't have to toggle the conditional itself during release
builds. It should only evaluate to true during devel builds.
OpenShift Merge Robot [Fri, 25 Sep 2020 13:57:33 +0000 (13:57 +0000)]
Merge pull request #2203 from cgwalters/delta-sign-cleanups
delta: Some minor code style fixups
OpenShift Merge Robot [Thu, 24 Sep 2020 22:14:31 +0000 (22:14 +0000)]
Merge pull request #2202 from cgwalters/bootcsum-dtb
deploy: Remove deployment bootcsum assertion
Colin Walters [Thu, 24 Sep 2020 22:12:23 +0000 (22:12 +0000)]
delta: Some minor code style fixups
- Remove some unused variables
- Switch to declare-and-initialize with others
- Fix some indentation from 4 spaces to 2 (GNU style)
Colin Walters [Thu, 24 Sep 2020 19:28:31 +0000 (19:28 +0000)]
deploy: Remove deployment bootcsum assertion
When support for devicetree was added, it created a problem
because old and new ostree versions would compute different
checksums for the "boot data". The scenario here is:
- Have system with ostree < 2020.4
- Reboot into system with ostree 2020.5
- Try to perform an operation that would retain
that previous booted deployment (common)
Currently ostree iterates over all the deployments
that will be retained and calls `install_deployment_kernel()`,
even for the booted one (which is a bit silly), but
just to verify that all boot data for the targeted
deployments are installed.
This then re-computes the checksum and we'd trip this
assertion.
In practice though, we don't strictly require them to match;
the only thing that will happen if they don't is that we'll
end up with another copy of the kernel/initramfs - and
that only temporarily until the previous deployment
gets GC'd.
Longer term, I think what we really want to do anyways
is probably closer to like a little ostree repo for `/boot`
so that we can e.g. still hardlink kernels there even if
the initramfs changes, or hardlink both kernel/initramfs
if just the devicetree changes, etc.
Closes: https://github.com/ostreedev/ostree/issues/2154
OpenShift Merge Robot [Thu, 24 Sep 2020 14:21:16 +0000 (14:21 +0000)]
Merge pull request #1985 from fdanis-oss/wip/fda/sign_delta_metadata
Static-delta's superblock signature support
OpenShift Merge Robot [Wed, 16 Sep 2020 15:58:55 +0000 (17:58 +0200)]
Merge pull request #2199 from cgwalters/no-hardlink-unreadable
checkout: Ensure copies of unreadable usermode checkouts are readable
Colin Walters [Wed, 16 Sep 2020 13:23:04 +0000 (13:23 +0000)]
checkout: Ensure copies of unreadable usermode checkouts are readable
The extreme special case of "zero mode" files like `/etc/shadow`
comes up again. What we want is for "user mode" checkouts to
override it to make the file readable; otherwise when operating
as non-root without `CAP_DAC_OVERRIDE` it becomes very difficult
to work with.
Previously, we were hardlinking these files, but then it intersects
with *another* special case around zero sized files, which is
*also* true for `/etc/shadow`.
Trying to avoid hardlinking there unveiled this bug - when
we go to do a copy checkout, we need to override the mode.
OpenShift Merge Robot [Mon, 14 Sep 2020 14:43:40 +0000 (10:43 -0400)]
Merge pull request #2195 from ostreedev/avoid-shadows
Avoid shadowing local variables
Frédéric Danis [Fri, 21 Aug 2020 15:24:49 +0000 (17:24 +0200)]
tests/delta: Add new tests for applying signed deltas
Add new test to apply offline signed deltas.
Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
Frédéric Danis [Fri, 21 Aug 2020 15:22:40 +0000 (17:22 +0200)]
bin/static-delta: Add signature parameters to apply-offline
This allows to check the delta signature before applying it.
Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
Frédéric Danis [Tue, 25 Aug 2020 07:26:09 +0000 (09:26 +0200)]
lib/deltas: Check signed delta in execute_offline
Add a new function `ostree_repo_static_delta_execute_offline_with_signature`
which takes a signature engine to verify the delta before applying it.
The `ostree_repo_static_delta_execute_offline` is just a wrapper to this
new function, passing a NULL signature engine.
When this function is called without signature engine, but with a sign
delta, it will only fails if `sign-verify-deltas` is set to true in repo
core options.
This commits move signature existence check and delta signature
verification to share common parts between existing APIs and the new
function.
Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
Frédéric Danis [Tue, 3 Dec 2019 10:15:51 +0000 (11:15 +0100)]
tests/delta: new tests for '
ed25519' signed deltas
Add tests to generate signed deltas and verify them using '
ed25519'
signature engine.
Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
Frédéric Danis [Thu, 23 Apr 2020 13:24:53 +0000 (15:24 +0200)]
tests/libtest.sh: Add skip_without_sign_ed25519() function
Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
Frédéric Danis [Fri, 29 Nov 2019 15:17:17 +0000 (16:17 +0100)]
tests/delta: new tests for signed deltas
Add tests to generate signed deltas and verify them using 'dummy'
signature engine.
Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
Frédéric Danis [Thu, 9 Jul 2020 15:35:00 +0000 (17:35 +0200)]
lib/deltas: Support signed delta in dump
This checks if the static delta file is signed or not to be able to
correctly get the superblock to dump.
Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
Frédéric Danis [Thu, 9 Jul 2020 15:34:08 +0000 (17:34 +0200)]
lib/deltas: Support signed delta in execute_offline
This checks if the static delta file is signed or not to be able to
correctly get the superblock to apply.
Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
Frédéric Danis [Fri, 29 Nov 2019 11:40:11 +0000 (12:40 +0100)]
bin/static-delta: Add command to verify delta signature
Add new "static-delta verify" sub-command.
This supports multiple keys to verify the static-delta file.
Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
Frédéric Danis [Thu, 28 Nov 2019 11:18:59 +0000 (12:18 +0100)]
lib/deltas: Add signature check API for static-delta superblock
This retrieves the signatures and pass the static delta block as an array
of bytes to ostree_sign_data_verify().
Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
Frédéric Danis [Tue, 26 Nov 2019 10:20:10 +0000 (11:20 +0100)]
bin/static-delta: Add support to sign superblock
Add signing ability to "static-delta generate" builtin.
Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
Frédéric Danis [Wed, 8 Jul 2020 10:15:15 +0000 (12:15 +0200)]
lib/deltas: Add inline signature for static-delta superblock
While the commits contained in the single static-delta file are signed so
we can check them and operate on trusted data, the superblock isn't signed
in any way, so it end up operating on untrusted data to:
1. actually find where the trusted data is, and
2. check whether the update is fit for the current device by looking at
the collection id stored in the metadata
This commit generates signatures of all static data, and concatenate them
to the existing static delta format, i.e. as a GVariant layout `a{sv}ay`
where
- a{sv}: signatures
- ay: existing delta variant
Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
Phaedrus Leeds [Sat, 12 Sep 2020 21:51:40 +0000 (14:51 -0700)]
Avoid shadowing local variables
This should help with code readability.
Fixes https://github.com/ostreedev/ostree/issues/2194
OpenShift Merge Robot [Sun, 13 Sep 2020 17:00:16 +0000 (13:00 -0400)]
Merge pull request #2196 from cgwalters/commit-shadowing-fix
commit: Tighten scope of two variables
Colin Walters [Sun, 13 Sep 2020 14:56:06 +0000 (14:56 +0000)]
commit: Tighten scope of two variables
Prep for adding `-Wshadow` fixes.
OpenShift Merge Robot [Fri, 11 Sep 2020 15:07:00 +0000 (11:07 -0400)]
Merge pull request #2193 from alexlarsson/preparatory-cleanup
Preparatory cleanup for summary work
Alexander Larsson [Fri, 11 Sep 2020 10:14:05 +0000 (12:14 +0200)]
Update the symbols files to match that we're now on 2020.6
Alexander Larsson [Thu, 10 Sep 2020 09:58:38 +0000 (11:58 +0200)]
ostree-repo-pull.c: Extract mirrorlist generation to helper
This code was duplicated in 3 places, so move it to a single place
to clean things up.
Alexander Larsson [Thu, 10 Sep 2020 09:34:31 +0000 (11:34 +0200)]
Minor cleanup of _ostree_repo_remote_new_fetcher()
Instead of open coding the extra_headers and append_user_agent
setting everywhere we do this in the constructor.
Alexander Larsson [Thu, 10 Sep 2020 09:26:06 +0000 (11:26 +0200)]
Inline repo_remote_fetch_summary
This was only used in one place, and (especially with the simplification
with GMainContextPopDefault) and the one caller doesn't really do
much more than call the helper. Additionally, what little it does (saving
the result in the cache) is inherently tied to how the helper work,
and will become even more so when we support summary indexes.
This is a preparatory cleanup for supporting summary indexes. It
doesn't change any behaviour and passes make check on its own.
Alexander Larsson [Thu, 10 Sep 2020 09:10:01 +0000 (11:10 +0200)]
repo_remote_fetch_summary: Use GMainContextPopDefault
This allows us to drop the "goto out" use and clean up this function.