Find a file
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
docs docs: Create man pages for sbvarsign & sbsiglist 2012-08-13 15:10:21 +08:00
lib autoconfiscate 2012-05-28 22:35:48 +08:00
src sbvarsign: fix "EFI_VARIABLE_AUTHENTICATION_2.TimeStamp.Year" assignment 2020-01-09 09:21:25 -08:00
tests Fix Fedora Build 2018-02-20 15:36:19 -05:00
.gitmodules Move ccan submodule 2012-05-24 15:17:18 +08:00
autogen.sh Update the PE checksum field using the somewhat-underdocumented 2016-01-27 11:38:00 -08:00
configure.ac Version 0.9.2 2019-01-09 16:09:37 -08:00
COPYING license: Add OpenSSL exception to GPLv3 terms 2012-06-28 15:06:31 +08:00
LICENSE.GPLv3 license: Add OpenSSL exception to GPLv3 terms 2012-06-28 15:06:31 +08:00
Makefile.am Move sources to src/ subdirectory 2012-08-13 15:10:21 +08:00
NEWS sbkeysync: change default efivarfs mountpoint to /sys/.../efivars/ 2012-10-08 12:07:43 +08:00
README autoconfiscate 2012-05-28 22:35:48 +08:00

sbsigntool - Signing utility for UEFI secure boot

  Copyright (C) 2102 Jeremy Kerr <jeremy.kerr@canonical.com>

  Copying and distribution of this file, with or without modification,
  are permitted in any medium without royalty provided the copyright
  notice and this notice are preserved.

See file ./INSTALL for building and installation instructions.

Main git repository:
  git://kernel.ubuntu.com/jk/sbsigntool.git

sbsigntool is free software.  See the file COPYING for copying conditions.