You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sigtool: fix --diff bugs and add support for '_' in cvd name
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
Copy file name to clipboardExpand all lines: sigtool/sigtool.c
+95-57Lines changed: 95 additions & 57 deletions
Original file line number
Diff line number
Diff line change
@@ -70,6 +70,9 @@
70
70
71
71
#defineMAX_DEL_LOOKAHEAD 5000
72
72
73
+
// global variable for the absolute path of the --cvdcertsdir option
74
+
char*g_cvdcertsdir=NULL;
75
+
73
76
// struct s_info info;
74
77
shortrecursion=0, bell=0;
75
78
shortprintinfected=0, printclean=1;
@@ -1069,8 +1072,6 @@ static int verify(const struct optstruct *opts)
1069
1072
char*target=NULL;
1070
1073
char*sign_file_name=NULL;
1071
1074
1072
-
char*cvdcertsdir=NULL;
1073
-
1074
1075
char*signer_name=NULL;
1075
1076
boolverify_result= false;
1076
1077
FFIError*verify_file_error=NULL;
@@ -1081,8 +1082,9 @@ static int verify(const struct optstruct *opts)
1081
1082
target=optget(opts, "verify")->strarg;
1082
1083
if (NULL==target) {
1083
1084
mprintf(LOGG_ERROR, "verify: No target file specified.\n");
1084
-
mprintf(LOGG_ERROR, "To verify a file signed with sigtool, you must specify a target file. You may also override the default certificates directory using --cvdcertsdir.\n");
0 commit comments