Bug 1297273

Summary: MokManager.efi fails to enroll MOK public keys at boot.
Product: [Fedora] Fedora Reporter: Juan A. Burgos <surkum>
Component: shimAssignee: Matthew Garrett <mjg59>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 25CC: knutjbj, mjg59, pjones, toddsmb
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-12-12 11:07:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Juan A. Burgos 2016-01-11 04:16:45 UTC
Description of problem:

MokManager.efi fails to enroll public keys added with "mokutil --import key.der".
Mokmanager.efi ask to import the key after reboot, but key is not imported anyway. 


Version-Release number of selected component (if applicable):

$ rpm -q shim mokutil openssl
shim-0.8-8.x86_64
mokutil-0.2.0-3.fc23.x86_64
openssl-1.0.2e-3.fc23.x86_64

How reproducible:

Always, several tries with different keys has been performed.

Steps to Reproduce:
1. Generate a key pair with openssl
2. Import key with "mokutil --import"
3. Verify key is pending to import looking at /sys/firmware/efi/efivars/MokNew-XXX...
4. Reboot
5. Use MokManager.efi interface to import pending key.
6. Reboot
7. Use "keyctl list %:.system_keyring" to view current public keys in keyring.

Actual results:

Four public keys listed

# keyctl list %:.system_keyring
4 keys in keyring:
893647049: ---lswrv     0     0 asymmetric: Fedora kernel signing key: 89ceaf5380b1d1504056cb00aa3c46346beb2e05
 49271380: ---lswrv     0     0 asymmetric: Fedora Secure Boot CA: fde32599c2d61db1bf5807335d7b20e4cd963b42
164585263: ---lswrv     0     0 asymmetric: Microsoft Corporation UEFI CA 2011: 13adbf4309bd82709c8cd54f316ed522988a1bd4
757346961: ---lswrv     0     0 asymmetric: Microsoft Windows Production PCA 2011: a92902398e16c49778cd90f99e4f9ae17c55af53



Expected results:

Five public keys listed, the previous ones plus the one we wish to import.


Additional info:

Hardware HP Zbook 15 G2, latest firmware:

# dmidecode |grep 'BIOS Rev'
	BIOS Revision: 1.12

As no MOK key could be imported, no custom module can be loaded into kernel with secureboot enabled until this is solved.

Comment 1 Juan A. Burgos 2016-01-11 04:21:53 UTC
# tree /boot/efi/
/boot/efi/
├── EFI
│   ├── BOOT
│   │   ├── BOOTX64.EFI
│   │   └── fallback.efi
│   └── fedora
│       ├── BOOT.CSV
│       ├── fonts
│       │   └── unicode.pf2
│       ├── fw
│       ├── fwupx64.efi
│       ├── gcdx64.efi
│       ├── grub.cfg
│       ├── grubenv
│       ├── grubx64.efi
│       ├── MokManager.efi
│       ├── shim.efi
│       └── shim-fedora.efi
├── mach_kernel
└── System
    └── Library
        └── CoreServices
            └── SystemVersion.plist

Comment 2 todd 2016-06-14 01:30:12 UTC
I'm having the same issue. Cant import keys using mokutil --import.
Seems pretty much all functions of mokutil are not working.

fedora 23 
kernel = 4.5.6-200.fc23.x86_64
shim-0.8-8.x86_64
mokutil-0.2.0-3.fc23.x86_64

Comment 3 Fedora End Of Life 2016-11-24 14:50:10 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 4 Fedora End Of Life 2016-12-20 17:46:31 UTC
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 5 Knut J BJuland 2016-12-21 06:51:50 UTC
mokutil --import public_key.der 
input password: 
input password again: 
Failed to enroll new keys


This is with fedora 25.

Comment 6 Juan A. Burgos 2016-12-21 12:14:37 UTC
Still present in fedora 25.

Comment 7 Knut J BJuland 2017-03-13 14:23:47 UTC
duplicate of 1406868

Comment 8 Juan A. Burgos 2017-03-13 15:25:48 UTC
(In reply to Knut J BJuland from comment #7)
> duplicate of 1406868

1406868 could be a duplicate of this, but not the way around as this predates the other in about a year.

Comment 9 Fedora End Of Life 2017-11-16 19:54:07 UTC
This message is a reminder that Fedora 25 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 25. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '25'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 25 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 10 Fedora End Of Life 2017-12-12 11:07:47 UTC
Fedora 25 changed to end-of-life (EOL) status on 2017-12-12. Fedora 25 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.