Add x509_sha384 and x509_sha512 guids.

Signed-off-by: Peter Jones <pjones@redhat.com>
Make the efi_guid_t objects we export be declared const.

Signed-off-by: Peter Jones <pjones@redhat.com>
Be a little more precise with our types in read_file()

Based on the bug and patch reported in this thread:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=764386

Signed-off-by: Peter Jones <pjones@redhat.com>
Correctly return error and report errno on read failures.

Based on the bug and patch reported in this thread:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=764386

Signed-off-by: Peter Jones <pjones@redhat.com>
Return ENOMEM if we're going to overrun the buffer in read_file.

I don't actually think this case will ever happen in efivar, since the
paths we're reading from are generated internally and always point at
sysfs or proc and /cannot/ be that large, but it's still the right thing
to do.

Based on the bug and patch reported in this thread:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=764386

Signed-off-by: Peter Jones <pjones@redhat.com>
Make read_file's read loop work correctly with files > 8k.

Since we're not only concerned with boot variables, we need a real
read+alloc loop that continues to work, not that works once.

Based on the bug and patch reported in this thread:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=764386

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