]> git.proxmox.com Git - efi-boot-shim.git/log
efi-boot-shim.git
10 years agoMerge signature.h into efiauthenticated.h and guid.h
Gary Ching-Pang Lin [Thu, 4 Jul 2013 09:41:51 +0000 (17:41 +0800)]
Merge signature.h into efiauthenticated.h and guid.h

Conflicts:
shim.c

10 years agoMerge two PeImage.h into one
Peter Jones [Thu, 26 Sep 2013 15:09:16 +0000 (11:09 -0400)]
Merge two PeImage.h into one

Conflicts:
Makefile

10 years agoFree unused memory space
Gary Ching-Pang Lin [Fri, 5 Jul 2013 02:57:16 +0000 (10:57 +0800)]
Free unused memory space

10 years agoAdjust the result of gmtime() to fit the definition
Gary Ching-Pang Lin [Tue, 9 Jul 2013 09:30:02 +0000 (17:30 +0800)]
Adjust the result of gmtime() to fit the definition

10 years agoRand: check the status of the pseudorandom number generator
Gary Ching-Pang Lin [Thu, 4 Jul 2013 08:12:30 +0000 (16:12 +0800)]
Rand: check the status of the pseudorandom number generator

10 years agoMokManager: check the suffix of the key file
Gary Ching-Pang Lin [Fri, 26 Jul 2013 07:44:49 +0000 (15:44 +0800)]
MokManager: check the suffix of the key file

10 years agoMokManager: fetch more info from X509 name
Gary Ching-Pang Lin [Fri, 26 Jul 2013 04:44:42 +0000 (12:44 +0800)]
MokManager: fetch more info from X509 name

10 years agoMokManager: reboot the system after clearing MOK password
Gary Ching-Pang Lin [Wed, 24 Jul 2013 06:39:39 +0000 (14:39 +0800)]
MokManager: reboot the system after clearing MOK password

10 years agoMokManager: enhance the password prompt for SB state
Gary Ching-Pang Lin [Thu, 27 Jun 2013 07:04:07 +0000 (15:04 +0800)]
MokManager: enhance the password prompt for SB state

10 years agoMokManager: rearrange the output of MOK info
Gary Ching-Pang Lin [Thu, 27 Jun 2013 04:28:08 +0000 (12:28 +0800)]
MokManager: rearrange the output of MOK info

10 years agoDisable floating points in b_print
Gary Ching-Pang Lin [Thu, 27 Jun 2013 04:03:14 +0000 (12:03 +0800)]
Disable floating points in b_print

The long double declaration will enable SSE and cause a compilation
error. Disabling everything related to floating points avoids the
error.

10 years agoEnable openssl bio_printf()
Gary Ching-Pang Lin [Thu, 27 Jun 2013 03:59:09 +0000 (11:59 +0800)]
Enable openssl bio_printf()

bio_printf() was replaced with a dummy function and this made
several openssl functions useless. This commit adds the print
functions back, so that we don't have to implement our own
ASN1 time print function.

10 years agoMokManager: enhance the password prompt
Gary Ching-Pang Lin [Wed, 26 Jun 2013 07:21:35 +0000 (15:21 +0800)]
MokManager: enhance the password prompt

10 years agoMokManager: remove the duplicate get_keystroke()
Gary Ching-Pang Lin [Wed, 26 Jun 2013 04:23:26 +0000 (12:23 +0800)]
MokManager: remove the duplicate get_keystroke()

10 years agoMokManager: draw the countdown screen
Gary Ching-Pang Lin [Thu, 18 Apr 2013 09:13:12 +0000 (17:13 +0800)]
MokManager: draw the countdown screen

10 years agoMokManager: Remove the unnecessary string duplication
Gary Ching-Pang Lin [Thu, 30 May 2013 06:22:43 +0000 (14:22 +0800)]
MokManager: Remove the unnecessary string duplication

10 years agoCorrect the certificate count of the signature list
Gary Ching-Pang Lin [Fri, 8 Mar 2013 06:44:50 +0000 (14:44 +0800)]
Correct the certificate count of the signature list

10 years agoSince different distros name grub*.efi differently, make it compile-time.
Peter Jones [Tue, 24 Sep 2013 15:48:32 +0000 (11:48 -0400)]
Since different distros name grub*.efi differently, make it compile-time.

Basically, if you don't want grub.efi, you do:

make 'DEFAULT_LOADER=\\\\grubx64.efi'

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoDefine the PXE 2nd stage loader in the beginning of the file
Gary Ching-Pang Lin [Thu, 7 Mar 2013 03:59:44 +0000 (11:59 +0800)]
Define the PXE 2nd stage loader in the beginning of the file

Make it easier to change the PXE 2nd stage loader.

Conflicts:
netboot.c

10 years agoRemove double-separators from the bootpath
Gary Ching-Pang Lin [Fri, 1 Mar 2013 10:04:06 +0000 (18:04 +0800)]
Remove double-separators from the bootpath

10 years agoFix the broken bootpath
Gary Ching-Pang Lin [Thu, 21 Feb 2013 09:49:29 +0000 (17:49 +0800)]
Fix the broken bootpath

- The file path from DevicePathToStr may use slash as the file
  seperator. Change all slashes to backslashes to avoid the strange
  bootpath.
- Remove the redundant backslashes.
- ImagePath no longer requires the leading backslash.
- Fix a memory leak

Based on the patch from Michal Marek <mmarek@suse.com>

10 years agoMokManager: support Tradition DES hash
Gary Ching-Pang Lin [Tue, 29 Jan 2013 09:10:10 +0000 (17:10 +0800)]
MokManager: support Tradition DES hash

10 years agoMokManager: support MD5-based crypt() hash
Gary Ching-Pang Lin [Tue, 29 Jan 2013 04:09:34 +0000 (12:09 +0800)]
MokManager: support MD5-based crypt() hash

10 years agoMokManager: support blowfish-based crypt() hash
Gary Ching-Pang Lin [Fri, 17 May 2013 07:10:57 +0000 (15:10 +0800)]
MokManager: support blowfish-based crypt() hash

Conflicts:
Makefile

10 years agoMokManager: support SHA512-based crypt() hash
Gary Ching-Pang Lin [Thu, 24 Jan 2013 10:24:49 +0000 (18:24 +0800)]
MokManager: support SHA512-based crypt() hash

10 years agoMokManager: support crypt() password hash
Gary Ching-Pang Lin [Tue, 15 Jan 2013 10:01:41 +0000 (18:01 +0800)]
MokManager: support crypt() password hash

The password format is introduced for the password hash generated by crypt(),
so that the user can import the password hash from /etc/shadow. The packager,
especially those who packages 3rd party drivers, can utilize this feature to
import a 3rd party certificate without interfering the package installation.

This commit implements the sha256-based crypt() hash function.

Conflicts:
Makefile
MokManager.c

10 years agoMake EFI_PATH easily resettable from the build command line.
Peter Jones [Wed, 29 May 2013 09:56:45 +0000 (17:56 +0800)]
Make EFI_PATH easily resettable from the build command line.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoClean lib/, too
Gary Ching-Pang Lin [Thu, 30 May 2013 06:10:56 +0000 (14:10 +0800)]
Clean lib/, too

10 years agosimple_file: Allocate buffers for file entries
Gary Ching-Pang Lin [Thu, 30 May 2013 06:05:59 +0000 (14:05 +0800)]
simple_file: Allocate buffers for file entries

The dir filter appends L'/' to the directory entries without
allocating a new buffer, and this could crash the whole program.

10 years agoPort MokManager to Linux Foundation loader UI code
Matthew Garrett [Sun, 19 May 2013 17:13:01 +0000 (18:13 +0100)]
Port MokManager to Linux Foundation loader UI code

This is the first stage of porting the MokManager UI to the UI code used
by the Linux Foundation UEFI loader.

10 years agoPort MokManager to Linux Foundation loader UI code
Peter Jones [Thu, 26 Sep 2013 15:57:51 +0000 (11:57 -0400)]
Port MokManager to Linux Foundation loader UI code

This is the first stage of porting the MokManager UI to the UI code used
by the Linux Foundation UEFI loader.

Conflicts:
MokManager.c

10 years agoWe have to declare SHIM_LOCK_GUID here as well.
Peter Jones [Thu, 26 Sep 2013 15:56:52 +0000 (11:56 -0400)]
We have to declare SHIM_LOCK_GUID here as well.

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

10 years agoIgnore tarballs.
Peter Jones [Thu, 26 Sep 2013 13:55:54 +0000 (09:55 -0400)]
Ignore tarballs.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoMokManager needs to disable the graphics console.
Peter Jones [Thu, 26 Sep 2013 13:44:50 +0000 (09:44 -0400)]
MokManager needs to disable the graphics console.

Without this patch, on some machines we never see MokManager's UI.  This
protocol has never (I think?) been officially published, and yet I still
have new hardware that needs it.

If you're looking for a reference, look at:

EdkCompatibilityPkg/Foundation/Protocol/ConsoleControl/ConsoleControl.c

in the edk2 tree from Tiano.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoFix a memory leak
Steve Langasek [Mon, 23 Sep 2013 06:11:26 +0000 (23:11 -0700)]
Fix a memory leak

10 years agoCorrect limits on the length of ipv6 addresses
Steve Langasek [Mon, 23 Sep 2013 05:45:26 +0000 (22:45 -0700)]
Correct limits on the length of ipv6 addresses

The maximum length of a string representation of an ipv6 address is 39
characters (8 groups of 4 hex chars, with 7 colons in between).  So don't
allocate more room than this - and more importantly, don't blindly accept
strings from the server that are longer than our buffer...

10 years agoMore consistent types, fewer casts
Steve Langasek [Mon, 23 Sep 2013 05:25:47 +0000 (22:25 -0700)]
More consistent types, fewer casts

10 years agoMisc allocation cleanups
Steve Langasek [Mon, 23 Sep 2013 05:21:49 +0000 (22:21 -0700)]
Misc allocation cleanups

10 years agoFix an off-by-one error
Steve Langasek [Fri, 20 Sep 2013 22:06:33 +0000 (17:06 -0500)]
Fix an off-by-one error

We don't need to add one because our end pointer is already off the end of
the string we want to copy.

10 years agoFix nul termination errors in filenames passed to tftp
Steve Langasek [Fri, 20 Sep 2013 18:03:57 +0000 (13:03 -0500)]
Fix nul termination errors in filenames passed to tftp

Fix various errors in the tftp string handling, to ensure we always have
properly nul-terminated strings.

10 years agoBuild with -Werror to catch future prototype mismatches.
Steve Langasek [Fri, 20 Sep 2013 18:01:19 +0000 (13:01 -0500)]
Build with -Werror to catch future prototype mismatches.

10 years agoPass the right arguments to EFI_PXE_BASE_CODE_TFTP_READ_FILE
Steve Langasek [Fri, 20 Sep 2013 16:29:23 +0000 (11:29 -0500)]
Pass the right arguments to EFI_PXE_BASE_CODE_TFTP_READ_FILE

A wrong pointer was being passed to EFI_PXE_BASE_CODE_TFTP_READ_FILE,
preventing us from getting the file size back from the tftp call, ensuring
that we don't have enough information to properly secureboot-validate the
retrieved image.

10 years agoAdd MokListRT option rom entry.
Peter Jones [Mon, 23 Sep 2013 17:24:32 +0000 (13:24 -0400)]
Add MokListRT option rom entry.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoUpdate TODO with missing description.
Peter Jones [Mon, 23 Sep 2013 15:04:48 +0000 (11:04 -0400)]
Update TODO with missing description.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoMade TODO represent the present.
Peter Jones [Mon, 23 Sep 2013 14:40:18 +0000 (10:40 -0400)]
Made TODO represent the present.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoMake SHIM_LOCK_GUID a first-class object with a symbol.
Peter Jones [Mon, 23 Sep 2013 14:22:48 +0000 (10:22 -0400)]
Make SHIM_LOCK_GUID a first-class object with a symbol.

Right now the CA is checking if shim builds expose a particular version
of the shim protocol.  To do this, they're looking for SHIM_LOCK_GUID's
value in the resulting binary.

Currently, with SHIM_LOCK_GUID as a macro that gets assigned to local
variables, that means they have to compensate for mov instructions mixed
in with the actual value.  This is completely absurd, so promote it to a
first-class object with a symbol to make it both easy to find and
continuous.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoDon't print things on the screen by default when everything works.
Peter Jones [Thu, 25 Jul 2013 14:51:05 +0000 (10:51 -0400)]
Don't print things on the screen by default when everything works.

There's no point to this text, and it generally confuses people.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoDon't print that fallback isn't found in should_use_fallback()
Peter Jones [Thu, 20 Jun 2013 16:41:14 +0000 (12:41 -0400)]
Don't print that fallback isn't found in should_use_fallback()

The call can simply fail if it isn't found - which will be the case on
removeable install media.

Signed-off-by: Peter Jones <pjones@redhat.com>
11 years agoFix some pointer casting issues.
Peter Jones [Tue, 11 Jun 2013 18:58:25 +0000 (14:58 -0400)]
Fix some pointer casting issues.

This also fixes the size of an empty vendor_cert or dbx_cert.

Signed-off-by: Peter Jones <shim-owner@fedoraproject.org>
11 years agoBump version to 0.4
Peter Jones [Mon, 10 Jun 2013 21:44:16 +0000 (17:44 -0400)]
Bump version to 0.4

Since I've finally merged in the "sections" branch, best to increment
the version number.

Signed-off-by: Peter Jones <pjones@redhat.com>
11 years agoMake DBX be included in build if the environment is set right.
Peter Jones [Mon, 10 Jun 2013 21:48:33 +0000 (17:48 -0400)]
Make DBX be included in build if the environment is set right.

Signed-off-by: Peter Jones <pjones@redhat.com>
11 years agoMake .vendor_cert get the right flags set.
Peter Jones [Mon, 10 Jun 2013 21:27:48 +0000 (17:27 -0400)]
Make .vendor_cert get the right flags set.

Signed-off-by: Peter Jones <pjones@redhat.com>
11 years agoadd a .gitignore
Peter Jones [Tue, 4 Jun 2013 13:22:11 +0000 (09:22 -0400)]
add a .gitignore

Signed-off-by: Peter Jones <pjones@redhat.com>
11 years agoMove embedded certificates to their own section.
Peter Jones [Wed, 20 Mar 2013 17:18:34 +0000 (13:18 -0400)]
Move embedded certificates to their own section.

With this change, the embedded certificate and dbx lists (vendor_cert,
vendor_cert_size, vendor_dbx, and vendor_dbx_size) wind up being in a
section named .vendor_cert, and so will look something like:
------
fenchurch:~/devel/github.com/shim$ objdump -h shim.efi

shim.efi:     file format pei-x86-64

Sections:
Idx Name          Size      VMA               LMA               File off  Algn
  0 .eh_frame     000174a8  0000000000005000  0000000000005000  00000400  2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  1 .text         000aa7e1  000000000001d000  000000000001d000  00017a00  2**4
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  2 .reloc        0000000a  00000000000c8000  00000000000c8000  000c2200  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  3 .data         00031228  00000000000c9000  00000000000c9000  000c2400  2**5
                  CONTENTS, ALLOC, LOAD, DATA
  4 .vendor_cert  00000375  00000000000fb000  00000000000fb000  000f3800  2**0
                  CONTENTS, READONLY
  5 .dynamic      000000f0  00000000000fc000  00000000000fc000  000f3c00  2**3
                  CONTENTS, ALLOC, LOAD, DATA
  6 .rela         0002afa8  00000000000fd000  00000000000fd000  000f3e00  2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  7 .dynsym       0000f1f8  0000000000128000  0000000000128000  0011ee00  2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
------

This simplifies a security audit, because it means that different
versions of shim with substantially the same code with different keys
will be more easily comperable, and therefore logic differences may be
more easily identified.

This also means that if there's a trusted build you want to use, you can
remove the certificates, implant new ones, and have it signed, and the
code sections won't change.

Signed-off-by: Peter Jones <pjones@redhat.com>
11 years agovendor_cert_size's size in the binary should be 4, not -4.
Peter Jones [Wed, 20 Mar 2013 17:16:08 +0000 (13:16 -0400)]
vendor_cert_size's size in the binary should be 4, not -4.

The thing about subtraction is that the minuend needs to be before the
subtrahend in the text.

Signed-off-by: Peter Jones <pjones@redhat.com>
11 years agoRemove FALLBACK_OBJS during clean as well.
Peter Jones [Mon, 10 Jun 2013 21:30:14 +0000 (17:30 -0400)]
Remove FALLBACK_OBJS during clean as well.

Signed-off-by: Peter Jones <pjones@redhat.com>
11 years agoMake sure all the Makefiles use the same arguments for mmx/sse/ms_abi.
Peter Jones [Mon, 10 Jun 2013 20:38:05 +0000 (16:38 -0400)]
Make sure all the Makefiles use the same arguments for mmx/sse/ms_abi.

Signed-off-by: Peter Jones <pjones@redhat.com>
11 years agoEFI_PXE_BASE_CODE_DHCPV6_PACKET is in gnu-efi-3.0t
Peter Jones [Thu, 30 May 2013 21:23:19 +0000 (17:23 -0400)]
EFI_PXE_BASE_CODE_DHCPV6_PACKET is in gnu-efi-3.0t

11 years agoDon't use MMX and SSE registers, they aren't initialized.
Peter Jones [Fri, 31 May 2013 19:22:37 +0000 (15:22 -0400)]
Don't use MMX and SSE registers, they aren't initialized.

GCC 4.8.0 will try to use these by default, and you'll wind up looping
across the (uninitialized!) trap handler for uninitialized instructions.

Signed-off-by: Peter Jones <pjones@redhat.com>
11 years agoBump version to 0.3
Peter Jones [Thu, 16 May 2013 15:03:25 +0000 (11:03 -0400)]
Bump version to 0.3

Signed-off-by: Peter Jones <pjones@redhat.com>
11 years agoUse MS ABI instead of terrible wrappers.
Peter Jones [Thu, 16 May 2013 14:09:46 +0000 (10:09 -0400)]
Use MS ABI instead of terrible wrappers.

This means that we now require gnu-efi 3.0s

Signed-off-by: Peter Jones <pjones@redhat.com>
11 years agoUse the correct define on Open.
Peter Jones [Wed, 15 May 2013 17:38:44 +0000 (13:38 -0400)]
Use the correct define on Open.

The value here doesn't actually change any, but we should still use the
right name.

Signed-off-by: Peter Jones <pjones@redhat.com>
11 years agoAdd some error messages when things don't work.
Peter Jones [Wed, 15 May 2013 17:38:27 +0000 (13:38 -0400)]
Add some error messages when things don't work.

Signed-off-by: Peter Jones <pjones@redhat.com>
11 years agoRemove some unnecessary code.
Peter Jones [Wed, 15 May 2013 17:38:00 +0000 (13:38 -0400)]
Remove some unnecessary code.

Signed-off-by: Peter Jones <pjones@redhat.com>
11 years agoFix some minor type errors.
Peter Jones [Wed, 15 May 2013 17:36:31 +0000 (13:36 -0400)]
Fix some minor type errors.

Signed-off-by: Peter Jones <pjones@redhat.com>
11 years agoPass parameters correctly when booting.
Peter Jones [Tue, 14 May 2013 17:10:34 +0000 (13:10 -0400)]
Pass parameters correctly when booting.

Signed-off-by: Peter Jones <pjones@redhat.com>
11 years ago[fallback] Try to execute the first new boot option.
Peter Jones [Tue, 30 Apr 2013 14:30:04 +0000 (10:30 -0400)]
[fallback] Try to execute the first new boot option.

I'm told rebooting is sometimes unreliable when called here, and we'll
get bootx64.efi loaded anyway.  I'll just assume that's true and try to
load the first option, since it's clearly what we'd prefer happens next.

Signed-off-by: Peter Jones <pjones@redhat.com>
11 years agoExplain byte order handling better.
Peter Jones [Tue, 30 Apr 2013 14:58:59 +0000 (10:58 -0400)]
Explain byte order handling better.

Signed-off-by: Peter Jones <pjones@redhat.com>
11 years agoDon't update BootOrder until all csv files are processed
Gary Ching-Pang Lin [Tue, 30 Apr 2013 09:04:16 +0000 (17:04 +0800)]
Don't update BootOrder until all csv files are processed

11 years agoReset the system after restoring the boot entries
Gary Ching-Pang Lin [Tue, 30 Apr 2013 06:16:11 +0000 (14:16 +0800)]
Reset the system after restoring the boot entries

11 years agoFix crash due to memory allocation
Gary Ching-Pang Lin [Tue, 30 Apr 2013 03:58:51 +0000 (11:58 +0800)]
Fix crash due to memory allocation

11 years agoGet rid of extra "continue".
Peter Jones [Fri, 26 Apr 2013 18:10:34 +0000 (14:10 -0400)]
Get rid of extra "continue".

It's confusing, and it doesn't actually accomplish anything when applied
to *either* loop.

Signed-off-by: Peter Jones <pjones@redhat.com>
11 years agoFix error checking on AllocateZeroPool() in update_boot_order()
Peter Jones [Fri, 26 Apr 2013 17:57:36 +0000 (13:57 -0400)]
Fix error checking on AllocateZeroPool() in update_boot_order()

Signed-off-by: Peter Jones <pjones@redhat.com>
11 years agoMake shim use fallback when appropriate.
Peter Jones [Fri, 26 Apr 2013 16:14:51 +0000 (12:14 -0400)]
Make shim use fallback when appropriate.

If we're called as /BOOT/EFI/BOOT*.EFI, and /BOOT/EFI/FALLBACK.EFI exists,
give it a shot.

Signed-off-by: Peter Jones <pjones@redhat.com>
11 years agoAdd a fallback loader for when shim is invoked as BOOTX64.EFI
Peter Jones [Fri, 15 Mar 2013 16:40:47 +0000 (12:40 -0400)]
Add a fallback loader for when shim is invoked as BOOTX64.EFI

If shim is invoked as \EFI\BOOT\BOOT*.EFI and a file exists named
\EFI\BOOT\FALLBACK.EFI, try it instead of our second stage.  So don't
put fallback.efi on your install media in \EFI\BOOT, because that won't
do whatever it is you're hoping for, unless you're hoping not to start
the installer.

So here's the process for using this:
in /EFI/fedora/ (or whichever directory you happen to own), you put:
  shim.efi
  grub.efi
  boot.csv - format is: shim.efi,Nice Label,cmdline arguments,comments
           - filenames refer only to files in this directory, with no
     leading characters such as L"./" or L"/EFI/fedora/"
           - note that while this is CSV, the character encoding is
     UCS-2

and if /EFI/BOOT/BOOTX64.EFI doesn't already exist, then in /EFI/BOOT:
  shim.efi as BOOTX64.EFI
  fallback.efi

Signed-off-by: Peter Jones <pjones@redhat.com>
11 years agoAdd StrCSpn()
Peter Jones [Fri, 26 Apr 2013 16:09:01 +0000 (12:09 -0400)]
Add StrCSpn()

Signed-off-by: Peter Jones <pjones@redhat.com>
11 years agoAdopt the UEFI shell style LoadOptions
Gary Ching-Pang Lin [Mon, 14 Jan 2013 08:53:19 +0000 (16:53 +0800)]
Adopt the UEFI shell style LoadOptions

The previous commit, 14d4b8e, caused shim failed to parse the name
of the 2nd stage loader in UEFI shell. Amend parsing of the name the
2nd stage loader to be compatible with UEFI shell.

To create an boot entry for elilo.efi:

 # efibootmgr -c -L "shim elilo" -l "efi\\shim.efi" -u "shim.efi elilo.efi"

11 years agoGet rid of extra label.
Peter Jones [Fri, 26 Apr 2013 15:29:37 +0000 (11:29 -0400)]
Get rid of extra label.

Signed-off-by: Peter Jones <pjones@redhat.com>
11 years agoDon't put the directory in the file path twice.
Peter Jones [Fri, 26 Apr 2013 15:38:10 +0000 (11:38 -0400)]
Don't put the directory in the file path twice.

Sometimes when we're creating paths, the ImagePath can contain the
directory name already.  If that happens, don't add it in again.

Signed-off-by: Peter Jones <pjones@redhat.com>
11 years agoUEFI Shell sticks the UCS2 of li->FilePath in li->LoadOptions. Ignore it.
Peter Jones [Fri, 26 Apr 2013 15:31:40 +0000 (11:31 -0400)]
UEFI Shell sticks the UCS2 of li->FilePath in li->LoadOptions. Ignore it.

If li->LoadOptions tells us to execute our own binary, it's clearly not
what we want to do for the second stage.  So simply ignore that case.

Signed-off-by: Peter Jones <pjones@redhat.com>
11 years agoMake sure the menu shows when the callback fails
Gary Ching-Pang Lin [Wed, 26 Dec 2012 03:44:46 +0000 (11:44 +0800)]
Make sure the menu shows when the callback fails

Since Pause() doesn't clear the key from the input queue, the next
ReadKeyStroke reads the queued key instead of the new one. If the
user presses "Enter", MokManager exits directly without showing
the menu again.

11 years agoAdd support for deleting specific keys
Gary Ching-Pang Lin [Fri, 21 Dec 2012 09:59:31 +0000 (17:59 +0800)]
Add support for deleting specific keys

11 years agoMOK doesn't include the signature owner
Gary Ching-Pang Lin [Fri, 21 Dec 2012 07:02:09 +0000 (15:02 +0800)]
MOK doesn't include the signature owner

11 years agoAdd a general function for password matching
Gary Ching-Pang Lin [Thu, 20 Dec 2012 09:02:35 +0000 (17:02 +0800)]
Add a general function for password matching

11 years agoReboot the system after enrolling/erasing keys
Gary Ching-Pang Lin [Mon, 10 Dec 2012 10:24:45 +0000 (18:24 +0800)]
Reboot the system after enrolling/erasing keys

11 years agoClear the screen before erasing keys
Gary Ching-Pang Lin [Mon, 10 Dec 2012 09:54:05 +0000 (17:54 +0800)]
Clear the screen before erasing keys

11 years agoGet the second stage loader from the Load Options
Gary Ching-Pang Lin [Thu, 6 Dec 2012 09:47:26 +0000 (17:47 +0800)]
Get the second stage loader from the Load Options

This commit replaces the 2nd stage loader path with the first
argument in the Load Options and moves the rest arguments (if any)
to the Load Options for the 2nd stage loader.

For example, to make shim to load elilo.efi, just create a new
boot entry with efibootmgr:

 # efibootmgr -c -L "shim elilo" -l "efi\\shim.efi" -u "elilo.efi"

11 years agoRemove debug code
Matthew Garrett [Wed, 28 Nov 2012 04:52:27 +0000 (23:52 -0500)]
Remove debug code

secure_mode() was altered to always return true for debug purposes, and this
accidentally got committed to mainline. Fix that.

11 years agoSign MokManager with a locally-generated key
Matthew Garrett [Sat, 24 Nov 2012 05:07:11 +0000 (00:07 -0500)]
Sign MokManager with a locally-generated key

shim needs to verify that MokManager hasn't been modified, but we want to
be able to support configurations where shim is shipped without a vendor
certificate. This patch adds support for generating a certificate at build
time, incorporating the public half into shim and signing MokManager with
the private half. It uses pesign and nss, but still requires openssl for
key generation. Anyone using sbsign will need to figure this out for
themselves.

11 years agoDon't fail if there's no network devices
Matthew Garrett [Thu, 1 Nov 2012 20:03:24 +0000 (16:03 -0400)]
Don't fail if there's no network devices

findNetboot() would continue blindly even if no PXE-capable devices were
found. Fix that.

11 years agoBump version
Matthew Garrett [Thu, 1 Nov 2012 19:32:12 +0000 (15:32 -0400)]
Bump version

This seems pretty much functionally complete, so let's call it 0.2.

11 years agoMerge branch 'mok' into netboot
Matthew Garrett [Thu, 1 Nov 2012 19:29:23 +0000 (15:29 -0400)]
Merge branch 'mok' into netboot

Conflicts:
shim.c

11 years agoAdd comments
Matthew Garrett [Thu, 1 Nov 2012 19:26:36 +0000 (15:26 -0400)]
Add comments

11 years agoMerge branch 'mok' into netboot
Matthew Garrett [Thu, 1 Nov 2012 14:45:22 +0000 (10:45 -0400)]
Merge branch 'mok' into netboot

Conflicts:
Makefile
shim.c

11 years agoFix AuthenticodeVerify loop
Matthew Garrett [Thu, 1 Nov 2012 14:39:31 +0000 (10:39 -0400)]
Fix AuthenticodeVerify loop

Cert needs to be modified inside the Index loop, not outside it. This is unlikely to
ever trigger since there will typically only be one X509 certificate per
EFI_SIGNATURE_LIST, but fix it anyway.

11 years agoFix signature checking
Matthew Garrett [Thu, 1 Nov 2012 14:31:14 +0000 (10:31 -0400)]
Fix signature checking

We could potentially find a valid signature and then fail to validate it
due to not breaking out of the outer while loop.

11 years agoFix double free
Matthew Garrett [Thu, 1 Nov 2012 14:12:20 +0000 (10:12 -0400)]
Fix double free

load_image() didn't allocate PathName, don't have it free it.

11 years agoFix up some types
Matthew Garrett [Thu, 1 Nov 2012 13:27:38 +0000 (09:27 -0400)]
Fix up some types

Type-checking the UEFI calls picked up a couple of problems. Fix them up.

11 years agoAdd documentation of the Mok variables
Matthew Garrett [Tue, 30 Oct 2012 20:14:02 +0000 (16:14 -0400)]
Add documentation of the Mok variables

Brief overview of the function and format of the various variables used
by Shim and MokManager.

11 years agoMerge branch 'mok' of github.com:mjg59/shim into mok
Matthew Garrett [Tue, 30 Oct 2012 19:59:40 +0000 (15:59 -0400)]
Merge branch 'mok' of github.com:mjg59/shim into mok