sbsigntools/src
Laszlo Ersek 2ed8eebcc5 sbvarsign: fix "EFI_VARIABLE_AUTHENTICATION_2.TimeStamp.Year" assignment
According to UEFI-2.8, section 8.3 "Time Services" / GetTime(), the
"EFI_TIME.Year" field must be in the range [1900, 9999] (both bounds
inclusive). It is not stated or even implied that "EFI_TIME.Year" would
not be an absolute year number.

According to POSIX, the "tm_year" field of "struct tm" is defined as
"Years since 1900". In other words, "tm_year" is relative to 1900.

In set_timestamp(), time() and gmtime() are suitable for populating
"EFI_VARIABLE_AUTHENTICATION_2.TimeStamp", as the UEFI spec specifically
requires a stamp expressed in the GMT (UTC) zone. But we still need to
offset "tm->tm_year" by 1900 for filling in "timestamp->Year". So let's do
that now.

While this issue does not seem to affect upstream edk2, SetVariable()
calls with payloads containing an invalid
"EFI_VARIABLE_AUTHENTICATION_2.TimeStamp.Year" value do seem to be
rejected at least on some Dell Inspiron machines (using a UEFI
implementation from AMI).

Reported-by: Eugene Khoruzhenko <ekhoruzhenko@absolute.com>
Reported-by: Paulo Henrique Lacerda de Amorim <phlamorim@riseup.net>
Ref: https://edk2.groups.io/g/devel/message/49402
Fixes: 953b00481f
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2020-01-09 09:21:25 -08:00
..
coff sbsigntool: add support for ARM and Aarch64 PE/COFF images 2016-01-27 11:50:19 -08:00
efivars.h sbvarsign: Improve default GUID choice 2012-08-24 20:57:00 +08:00
fileio.c sbsign, sbvarsign: support engine based private keys 2017-10-28 14:21:24 +01:00
fileio.h sbsign, sbvarsign: support engine based private keys 2017-10-28 14:21:24 +01:00
idc.c Move sources to src/ subdirectory 2012-08-13 15:10:21 +08:00
idc.h Move sources to src/ subdirectory 2012-08-13 15:10:21 +08:00
image.c Fix PE/COFF checksum calculation 2019-07-27 15:20:49 -07:00
image.h sbsign, sbattach, sbverify: add multiple signature support 2014-12-19 16:42:37 -08:00
libcoff.h Move sources to src/ subdirectory 2012-08-13 15:10:21 +08:00
Makefile.am sbkeysync: read & print signature databases 2012-08-24 20:00:52 +08:00
sbattach.c Add OPENSSL_config(NULL) to each binary to load openssl.cnf 2017-10-19 10:45:41 -07:00
sbkeysync.c Update OpenSSL API usage to support OpenSSL 1.1 2017-10-19 10:45:58 -07:00
sbsiglist.c Move EFI_CERT types to efivars.h 2012-08-24 20:00:15 +08:00
sbsign.c sbsign, sbvarsign: support engine based private keys 2017-10-28 14:21:24 +01:00
sbvarsign.c sbvarsign: fix "EFI_VARIABLE_AUTHENTICATION_2.TimeStamp.Year" assignment 2020-01-09 09:21:25 -08:00
sbverify.c Fix Debian 8 and Leap_42.1 builds 2017-10-19 11:09:41 -07:00
verify.c Move sources to src/ subdirectory 2012-08-13 15:10:21 +08:00