sbvarsign: WIN_CERTIFICATE.dwLength should include the header size

Despite what the Authenticode spec says ("dwLength is set to the length
of bCertificate"), the MS var sign tool and EDK2 sources include the
header in the dwLength size.

Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com>
This commit is contained in:
Jeremy Kerr 2012-08-22 16:50:04 +08:00
parent feddcb4f4f
commit fd553e841a

View file

@ -273,7 +273,7 @@ static int add_auth_descriptor(struct varsign_context *ctx)
auth = talloc_size(ctx, sizeof(*auth) + len); auth = talloc_size(ctx, sizeof(*auth) + len);
auth->TimeStamp = timestamp; auth->TimeStamp = timestamp;
auth->AuthInfo.Hdr.dwLength = len + sizeof(EFI_GUID); auth->AuthInfo.Hdr.dwLength = len + sizeof(auth->AuthInfo);
auth->AuthInfo.Hdr.wRevision = 0x0200; auth->AuthInfo.Hdr.wRevision = 0x0200;
auth->AuthInfo.Hdr.wCertificateType = 0x0EF1; auth->AuthInfo.Hdr.wCertificateType = 0x0EF1;
auth->AuthInfo.CertType = cert_pkcs7_guid; auth->AuthInfo.CertType = cert_pkcs7_guid;