Commit Graph

1445 Commits

Author SHA1 Message Date
Tamas K Lengyel
ba06a4362d Add REQUIRE_TPM flag to treat TPM related errors as critical
Currently TPM related errors are being silently discarded.

Signed-off-by: Tamas K Lengyel <lengyelt@ainfosec.com>
2018-03-06 14:42:32 -05:00
Tamas K Lengyel
555ef92650 Measure into the TPM even if SecureBoot is off in shim_lock verify
Signed-off-by: Tamas K Lengyel <lengyelt@ainfosec.com>
2018-03-06 14:37:07 -05:00
Tamas K Lengyel
829d3c8265 Log measurements in PCR4 for applications being verified through shim_lock
Currently the only measurement the shim logs in the TPM is that of the EFI
application it directly loads. However, there are no measurements being taken
of application that are being verified through the shim_lock protocol. In this
patch we extend PCR4 for any binary for which Verify is being called through
the shim_lock protocol.

Signed-off-by: Tamas K Lengyel <lengyelt@ainfosec.com>
2018-03-06 14:37:07 -05:00
Tamas K Lengyel
3d93263198 Add -m64 compiler flag to allow cross-compiling to 64-bit version on 32-bit system
Signed-off-by: Tamas K Lengyel <lengyelt@ainfosec.com>
2018-03-06 14:33:19 -05:00
Peter Jones
0da5fb8c9d ident: We don't actually need the hostname or kernel version, and it makes the builds differ.
Signed-off-by: Peter Jones <pjones@redhat.com>
2018-02-28 15:01:07 -05:00
cdadmin
5f4fd53641 Add proxy dhcp support 2018-02-28 14:56:10 -05:00
Gary Lin
bc3b6525d8 Cryptlib: replace CryptPem with CryptPemNull
We don't need the functions in CryptPem.c.

Signed-off-by: Gary Lin <glin@suse.com>
2018-02-28 14:47:18 -05:00
Gary Lin
62d8397202 httpboot: include console.h
in_protocol is declared in console.h, so httpboot.c has to include the
header.

Signed-off-by: Gary Lin <glin@suse.com>
2018-02-28 14:47:15 -05:00
Gary Lin
736af67122 httpboot: fix the infinite loop
We should get out of the loop once the uri node is not the last node in
the device path.

Signed-off-by: Gary Lin <glin@suse.com>
2018-02-28 14:47:12 -05:00
Gary Lin
a752290c38 httpboot: Amend the device path matching rule
Originally, we check if the last 2 nodes in the device path are
IPv4()/Uri() or IPv6()/Uri() to determine whether httpboot is used or
not. However, since UEFI 2.7, the DNS node will be inserted between the
IP node and the URI node if the server provides the DNS server address.
This commit changes the matching rule to search IP node and URI node
and ignore any node between those two nodes.

Signed-off-by: Gary Lin <glin@suse.com>
2018-02-28 14:47:12 -05:00
Mathieu Trudel-Lapierre
c8ca1c5696 Uninstall shim protocols before re-installing them
Make sure if we chainload things, a chainloaded bootloader will be able to use
the latest systab replacements and protocols. They need to match for things
to validate correctly.

Signed-off-by: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>
2018-02-01 13:50:44 -05:00
Peter Jones
02e2fc61bd Bump the version to 14
Signed-off-by: Peter Jones <pjones@redhat.com>
2017-12-19 16:52:01 -05:00
Peter Jones
0f50328189 Don't allow undefined symbols at all.
Signed-off-by: Peter Jones <pjones@redhat.com>
2017-12-19 16:52:01 -05:00
Peter Jones
97a3f6cf94 "in_protocol" is used in more than shim.o; make it not static.
Signed-off-by: Peter Jones <pjones@redhat.com>
2017-12-19 16:52:01 -05:00
Peter Jones
b9e81483bb Don't let openssl() try to call an external abort()
Signed-off-by: Peter Jones <pjones@redhat.com>
2017-12-19 16:36:55 -05:00
Mathieu Trudel-Lapierre
d1d148eac9 releasing package shim version 13-0ubuntu2 2017-11-07 10:19:35 -05:00
Mathieu Trudel-Lapierre
d49114cbb9 Clean up old patches. 2017-11-07 10:18:58 -05:00
Mathieu Trudel-Lapierre
81b34c1631 debian/patches/abort_abort_abort.patch: signtool.exe isn't happy with some of the structure of our binary, partly because abort() is thought to be an external symbol, which causes some relocalisations to appear. 2017-11-06 09:18:08 -05:00
Mathieu Trudel-Lapierre
4a3efbe436 releasing package shim version 13-0ubuntu1 2017-09-29 15:11:42 -04:00
Mathieu Trudel-Lapierre
dbbe142c74 Don't need to clean after .signed files, upstream Makefile does it now.
Signed-off-by: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>
2017-09-29 11:29:25 -04:00
Mathieu Trudel-Lapierre
560a356bc7 Drop buildid_write_return.patch; no longer needed.
Signed-off-by: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>
2017-09-29 11:26:01 -04:00
Mathieu Trudel-Lapierre
04acbb3ee3 Don't need to set -Wno-error=unused-variable anymore
Signed-off-by: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>
2017-09-29 11:24:56 -04:00
Mathieu Trudel-Lapierre
2f7a1c0b68 New upstream release: 13 2017-09-29 11:22:09 -04:00
Mathieu Trudel-Lapierre
6215e920e7 New upstream version 13 2017-09-29 11:20:57 -04:00
Mathieu Trudel-Lapierre
f9f6966262 Updated version 13 from 'upstream/13'
with Debian dir e38346a2ee
2017-09-29 11:20:57 -04:00
Mathieu Trudel-Lapierre
81250bb1a1 Updated version 13~z1 from 'upstream/13_z1'
with Debian dir e38346a2ee
2017-09-29 11:18:56 -04:00
Mathieu Trudel-Lapierre
6025103c25 New upstream version 13~z1 2017-09-29 11:18:56 -04:00
Peter Jones
5e827007b3 Bump the version to 13
shim 13:
- OpenSSL reverted to 1.0.2k to make the cert chaining of existing deployments stay working
- Better PCR usage for TPM
- TPM documentation in README.tpm
- More configurable build via make variables:
  ENABLE_SHIM_CERT
  ENABLE_SHIM_HASH
  ENABLE_SBSIGN
  LIBDIR
  EFIDIR
  VENDOR_CERT_FILE
  VENDOR_DB_FILE
- Better MoK documentation in MokVars.txt
- Better debuginfo generation
- Lots of minor bug fixes.

Signed-off-by: Peter Jones <pjones@redhat.com>
2017-09-29 11:10:49 -04:00
Mathieu Trudel-Lapierre
cc08ed0e28 buildid: Check the return values of write() calls
Signed-off-by: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>
2017-09-29 11:10:32 -04:00
Peter Jones
dca65ca254 Make shim_cert.h able to be included more safely.
If you build with ENABLE_SHIM_CERT=1, the include chain right now winds
up meaning shim_cert is defined in a header that gets included in
netboot.c as well, which never uses it:

  In file included from shim.h:125:0,
                   from netboot.c:36:
  shim_cert.h:1:14: error: ‘shim_cert’ defined but not used [-Werror=unused-variable]
   static UINT8 shim_cert[] = {
                ^~~~~~~~~
  cc1: all warnings being treated as errors

So make that okay by adding __attribute__((__unused__)) to the variable
decl.

Signed-off-by: Peter Jones <pjones@redhat.com>
2017-09-29 11:10:32 -04:00
Peter Jones
d8f4773408 buildid: make 'make clean' remove it. 2017-09-29 11:10:32 -04:00
Mathieu Trudel-Lapierre
a9cd148a1e New upstream snapshot: 13~git1506531982.23ce039 2017-09-27 13:10:32 -04:00
Mathieu Trudel-Lapierre
77e5c6e480 Updated version 13~git1506531982.23ce039 from 'upstream/13_git1506531982.23ce039'
with Debian dir bc85d2ed9d
2017-09-27 13:09:42 -04:00
Mathieu Trudel-Lapierre
ecc2922605 New upstream version 13~git1506531982.23ce039 2017-09-27 13:09:42 -04:00
Mathieu Trudel-Lapierre
e85582f4ca We don't really need libnss3-tools. 2017-09-27 12:55:12 -04:00
Mathieu Trudel-Lapierre
926d947690 debian/control: add Breaks: for the previous shim-signed builds given that shim will now build and ship BOOT.CSV by itself. 2017-09-27 12:54:05 -04:00
Mathieu Trudel-Lapierre
52b46c08f6 Ignore unused-variable errors. 2017-09-27 12:46:14 -04:00
Mathieu Trudel-Lapierre
21fbf908f7 New upstream snapshot: 13~git1505328971.0780644a 2017-09-27 12:45:29 -04:00
Peter Jones
23ce039c43 Use iconv for UCS-2 encoding.
Cyphermox discovered that when you run this:

  ( printf "\xff\x00\xfe\x00" ; echo "shimx64.efi,foo,,This is the boot entry for foo" ) | sed -z 's/./&\x00/g'

on some debian machines, printf(1) doesn't interpret the \x.. characters,
and that results in this being the encoded text:

00000000  5c 78 66 66 5c 78 66 65  73 00 68 00 69 00 6d 00  |\xff\xfes.h.i.m.|
00000010  78 00 36 00 34 00 2e 00  65 00 66 00 69 00 2c 00  |x.6.4...e.f.i.,.|
00000020  66 00 6f 00 6f 00 2c 00  2c 00 54 00 68 00 69 00  |f.o.o.,.,.T.h.i.|

which... yeah, that's wrong.  So instead, use iconv instead of
printf+sed to encode it in UCS-2.  Unfortunately, that means we don't
get endian markers, because for some reason iconv(1) doesn't have any way
to say it should include them.  But that's okay; fallback already
handles not having them and just assumes the second byte being \x00
means UCS-2LE.

Signed-off-by: Peter Jones <pjones@redhat.com>
2017-09-26 11:16:45 -04:00
Peter Jones
49e9775e07 Fix an LDFLAGS issue on arm and aarch64
Commit 1e71734992 inadvertantly switched ARM's
LDFLAGS+=--defsym=EFI_SUBSYSTEM=$(SUBSYSTEM) to be before LDFLAGS is set,
and so it got clobbered away.

Signed-off-by: Peter Jones <pjones@redhat.com>
2017-09-19 14:58:51 -04:00
Peter Jones
51c497b8db Try to do a slightly better job at 'make clean'
Signed-off-by: Peter Jones <pjones@redhat.com>
2017-09-19 14:58:51 -04:00
Mathieu Trudel-Lapierre
51d5bbcb24 New upstream version 13~git1505328971.0780644a 2017-09-14 17:48:49 -07:00
Mathieu Trudel-Lapierre
695f919503 Updated version 13~git1505328971.0780644a from 'upstream/13_git1505328971.0780644a'
with Debian dir 8d0dcc2dc4
2017-09-14 17:48:49 -07:00
Mathieu Trudel-Lapierre
35fd2c170c Don't build shim_cert.h in parallel with other targets.
shim_cert.h is required by other pieces (such as netboot.o, cert.o) and
might not be built by the time these targets are reached. In that case the
build would fail as it can't find a required header.

Signed-off-by: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>
2017-09-14 18:07:10 -04:00
Mathieu Trudel-Lapierre
b71838a35a Clean up after BOOT$(ARCH).CSV.
It should not be left around after clean since it's a generated file.

Signed-off-by: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>
2017-09-14 18:07:10 -04:00
Peter Jones
25f6fd08cd try to show errors more usefully.
Signed-off-by: Peter Jones <pjones@redhat.com>
2017-09-13 15:18:28 -04:00
Peter Jones
00753a0a28 Add some debugging data to the last malformed binary check...
Signed-off-by: Peter Jones <pjones@redhat.com>
2017-09-13 15:16:43 -04:00
Mathieu Trudel-Lapierre
1bb5cf18d0 New upstream snapshot: 13~git1505328970.9c1c35c5 2017-09-13 12:12:27 -07:00
Mathieu Trudel-Lapierre
544696f3ad Drop PHONY fix patch; merged upstream. 2017-09-13 12:11:21 -07:00
Mathieu Trudel-Lapierre
b6f94dbeac New upstream version 13~git1505328970.9c1c35c5 2017-09-13 12:09:40 -07:00