File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -135,11 +135,15 @@ static int pefile_strip_sig_wrapper(const void *pebuf,
135
135
pr_debug ("sig wrapper = { %x, %x, %x }\n" ,
136
136
wrapper .length , wrapper .revision , wrapper .cert_type );
137
137
138
- /* Both pesign and sbsign round up the length of certificate table
139
- * (in optional header data directories) to 8 byte alignment.
138
+ /* sbsign rounds up the length of certificate table (in optional
139
+ * header data directories) to 8 byte alignment. However, the PE
140
+ * specification states that while entries are 8-byte aligned, this is
141
+ * not included in their length, and as a result, pesign has not
142
+ * rounded up since 0.110.
140
143
*/
141
- if (round_up (wrapper .length , 8 ) != ctx -> sig_len ) {
142
- pr_debug ("Signature wrapper len wrong\n" );
144
+ if (wrapper .length > ctx -> sig_len ) {
145
+ pr_debug ("Signature wrapper bigger than sig len (%x > %x)\n" ,
146
+ ctx -> sig_len , wrapper .length );
143
147
return - ELIBBAD ;
144
148
}
145
149
if (wrapper .revision != WIN_CERT_REVISION_2_0 ) {
You can’t perform that action at this time.
0 commit comments