]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sbsign: Don't set bit in SpcPeImageData->flags
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 21 Feb 2025 21:41:26 +0000 (22:41 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Sat, 22 Feb 2025 00:05:25 +0000 (01:05 +0100)
Neither sbsign nor pesign set this flag in SpcPeImageData->flags,
which is about which resources should be included specifying "Which
portions of the Windows PE file are hashed." according to the
authenticode spec. However, this is followed by "Although flags is
always present, it is ignored when calculating the file hash for both
signing and verification purposes". So as it doesn't seem to do
anything useful and the other tools don't set any of these flags
either, let's follow suite and not set this flag ourselves either.

src/sbsign/sbsign.c

index a7e4047054c793edb4acf56d5830aa70f4d030ab..db4216c7e5e251694bf125081c31cc18cb60890f 100644 (file)
@@ -298,9 +298,6 @@ static int verb_sign(int argc, char *argv[], void *userdata) {
         if (!peid)
                 return log_oom();
 
-        if (ASN1_BIT_STRING_set_bit(peid->flags, 0, 1) == 0)
-                return log_oom();
-
         peid->file = TAKE_PTR(link);
 
         _cleanup_free_ uint8_t *peidraw = NULL;