Skip to content

Conversation

@tetlowgm
Copy link
Contributor

@tetlowgm tetlowgm commented Dec 7, 2024

The pipeline to update the embedded openssl tree has a logic error and cannot checkout a tag that isn't in the local repository. This errors out causing the embedded tree to never be updated.

To reproduce checkout an older tree (3.0.14) and see how it doesn't properly update:

$ rm -rf openssl
$ git clone --depth 1 -b openssl-3.0.14 https://github.com/openssl/openssl ./openssl
<cloning messages here>
$ make opensslpull
...
error: pathspec 'openssl-3.0.15' did not match any file(s) known to git

This change properly fetches the new tag and will then properly check it out. With the updated Makefile:

$ rm -rf openssl
$ git clone --depth 1 -b openssl-3.0.14 https://github.com/openssl/openssl ./openssl
<cloning messages here>
$ make opensslpull
<happy fetching messages>
From https://github.com/openssl/openssl
 * [new tag]           openssl-3.0.15 -> openssl-3.0.15
Previous HEAD position was 9cff14fd Prepare for release of 3.0.14
HEAD is now at c523121f Prepare for release of 3.0.15

I'm maintaining the shallow clone behavior and doing the fetch with --depth 1 which makes it about as minimal as possible. Updating from 3.0.14 to 3.0.15 transferred 64KiB on the wire, according to git.

Due to the shallow clone, the existing openssl tree never updates as the
tag we are attempting to move to does not exist in our tree causing the
"git checkout" command to fail the pipeline.

Instead, if the latest blessed version of the upstream (as defined by the
regex we used to decide which openssl version we support) is different than
our local tree, use "git fetch" to grab the new tag and then use "git
checkout" to move our local tree to it.

Tested on:	Way too many trees of openssl in different states
@rbsec
Copy link
Owner

rbsec commented Jan 18, 2025

Good catch - thanks!

@rbsec rbsec merged commit 7c3a9db into rbsec:master Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants