Sigtool: fix --diff bugs and add support for '_' in cvd name - #1541
Merged
Conversation
tj-cisco
requested changes
Jul 11, 2025
Sigtool's `--diff CVD_OLD CVD_NEW` feature will fail with preclass_tcfa (or any other CVD with an underscore). Apparently '_' is not a supported character in that code. While debugging this, I found some other issues: * The call to verify the `.script` created with the `--diff` feature fails since adding the .sign digital signature verification code, because I called it wrong. We didn't notice because there are no automated tests for this feature. * The --diff feature assumes you're in the same directory as the CVD files and that it is a relative path. * The --diff feature will change directories to a temp directory to verify the diff and then fail to apply the script because it has a relative path and now in a totally different directory I don't know how (2) or (3) ever worked right. One require absolute paths, while the other didn't provide a buffer big enough for absolute paths. So confused! This commit should make it so relative or absolute paths are fine for the CVD's and the cvd name may now include underscores. CLAM-2815
val-ms
force-pushed
the
CLAM-2815-sigtool-diff
branch
from
July 11, 2025 23:13
0c9ff79 to
b5665f3
Compare
The new feature test found a small leak when making cdiffs
tj-cisco
previously approved these changes
Jul 16, 2025
rasundri
approved these changes
Jul 21, 2025
val-ms
force-pushed
the
CLAM-2815-sigtool-diff
branch
from
July 22, 2025 02:14
c7453a6 to
0d3cd1f
Compare
tj-cisco
previously approved these changes
Jul 22, 2025
rsundriyal
previously approved these changes
Jul 22, 2025
The new Sigtool feature tests are failing on Windows because CMake is providing the CVD_CERTS_DIR environment variable with '/' path separators. My fix is to convert '/' to '\\' when converting paths to UNC paths. I have also changed CMake to provide CVD_CERTS_DIR with native paths. I also made a couple of fixes to the Sigtool tests because Windows wants to make CRLF line endings in Python unless you write byte-strings and Sigtool will get upset when making a diff if a signature file contains CRLF line endings. And putting Windows path separators into 'verify_output()' for the tests gets confused because it is actually a regex string and the backslashes mess it up.
val-ms
force-pushed
the
CLAM-2815-sigtool-diff
branch
from
July 22, 2025 20:15
0d3cd1f to
9208d26
Compare
tj-cisco
approved these changes
Jul 24, 2025
rsundriyal
approved these changes
Jul 24, 2025
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.
Sigtool's
--diff CVD_OLD CVD_NEWfeature will fail with preclass_tcfa (or any other CVD with an underscore).Apparently '_' is not a supported character in that code.
While debugging this, I found some other issues:
The call to verify the
.scriptcreated with the--difffeature fails since adding the .sign digital signature verification code, because I called it wrong. We didn't notice because there are no automated tests for this feature.The --diff feature assumes you're in the same directory as the CVD files and that it is a relative path.
The --diff feature will change directories to a temp directory to verify the diff and then fail to apply the script because it has a relative path and now in a totally different directory
I don't know how (2) or (3) ever worked right.
One require absolute paths, while the other didn't provide a buffer big enough for absolute paths. So confused!
This commit should make it so relative or absolute paths are fine for the CVD's and the cvd name may now include underscores.
CLAM-2815