generate_hash(): make check_size() set an error, and verify SecDir size.
generate_hash(): make check_size() set an error, and verify SecDir size.

Currently generate_hash() attempts to include any trailing data at the
end of the binary in the resulting digest, but it won't include such
data if the size computed is wrong because context->SecDir->Size is
invalid.  In this case the return code is EFI_SUCCESS, and the hash will
match any a binary as if the Attribute Certificate Table and anything
after it are missing.  This is wrong.

Signed-off-by: Peter Jones <2e0a021e603479ff81838c00c3b770daca4e0214@redhat.com>

rhinstaller/shim,rhinstaller/shim,rhinstaller/shim