[virt-tools-list] [PATCH virtio-win-pkg-scripts] cpdrivers: accept unsigned binaries

Cole Robinson crobinso at redhat.com
Mon Feb 22 19:14:48 UTC 2016


On 02/20/2016 08:57 AM, Roman Kagan wrote:
> PE binaries included in the driver package (.sys, .dll, etc) may contain
> no internal signatures; in that case their digest in the catalog is
> calculated till the end of the file.
> 
> Signed-off-by: Roman Kagan <rkagan at virtuozzo.com>
> ---
>  util/cpdrivers.py | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/util/cpdrivers.py b/util/cpdrivers.py
> index 305b3ae..f4b1d6e 100644
> --- a/util/cpdrivers.py
> +++ b/util/cpdrivers.py
> @@ -65,6 +65,8 @@ def calcPEHash(data, hashobj):
>          0x20b: 168     # PE32+
>          }[pemagic]
>      sec, seclen = struct.unpack_from("2I", data, secdir)
> +    if sec == 0:
> +        sec = len(data)
>      # signature is always the tail part
>      assert sec + seclen == len(data)
>  
> 

Thanks, pushed now

- Cole




More information about the virt-tools-list mailing list