Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

Broken signing files for secureboot [SOLVED]

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
10 posts • Page 1 of 1
Author
Message
ololoshwin
n00b
n00b
Posts: 16
Joined: Thu Nov 25, 2021 8:13 am

Broken signing files for secureboot [SOLVED]

  • Quote

Post by ololoshwin » Wed May 28, 2025 11:34 am

I'm using secureboot with own keys.

Portage is not able to sign files.

$ sudo emerge -1av sys-apps/memtest86+
...
[ebuild R ] sys-apps/memtest86+-7.20::gentoo USE="boot secureboot uefi64 -bios32 -bios64 -iso32 -iso64 -uefi32" 0 KiB
...
* Signing /var/tmp/portage/sys-apps/memtest86+-7.20/image/boot/memtest86plus/memtest.efi64 ...
Signing Unsigned original image
...

1. Installation without warnings.

2. sbverify --cert=/var/lib/sbctl/keys/PK/PK.pem /boot/memtest86plus/memtest.efi64
Signature verification OK

3. sbctl verify /boot/memtest86plus/memtest.efi64
✗ /boot/memtest86plus/memtest.efi64 is not signed


Why sbctl can not verify signature created by portage and sbsign ?
Last edited by ololoshwin on Thu May 29, 2025 4:06 pm, edited 1 time in total.
Top
justguy
n00b
n00b
User avatar
Posts: 33
Joined: Sat Apr 12, 2025 6:12 pm

  • Quote

Post by justguy » Wed May 28, 2025 1:36 pm

dont use secure boot :roll:
Top
Hu
Administrator
Administrator
Posts: 24403
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Wed May 28, 2025 1:49 pm

justguy wrote:dont use secure boot :roll:
This is not helpful, and is particularly undesirable in a thread that previously had 0 responses. Some users run a canned search for threads with zero replies as a way of finding posts to answer. When you replied, you removed this thread from the list, even though you were neither offering a solution nor soliciting information that we could use to help the poster. Thus, they would no longer see your thread on the list of unanswered threads.

OP: would you like for me to split off justguy's post and my post, to return this thread to the unanswered posts list?
Top
justguy
n00b
n00b
User avatar
Posts: 33
Joined: Sat Apr 12, 2025 6:12 pm

  • Quote

Post by justguy » Wed May 28, 2025 2:22 pm

secure boot makes installation harder, if dont wanna get malware while installing, i recommend troubleshoot instead of making secure boot
Top
Hu
Administrator
Administrator
Posts: 24403
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Wed May 28, 2025 2:53 pm

Yes, Secure Boot adds complications. OP chose to accept those complications, and has a specific problem that he wants help solving. From my limited knowledge of Secure Boot, I think OP's question looks reasonable.
Top
Nowa
Developer
Developer
User avatar
Posts: 522
Joined: Wed Jun 25, 2014 7:07 am
Location: Hilversum

  • Quote

Post by Nowa » Wed May 28, 2025 3:13 pm

Why sbctl can not verify signature created by portage and sbsign ?
It's probably attempting verification with the wrong key/certificate (possibly the portage certificate you used is not registered with UEFI/shim yet). Try listing all signatures with "sbverify --list".
OS: Gentoo 6.19.3-gentoo-dist, ~amd64, 23.0/desktop/plasma/systemd
MB: MSI Z370-A PRO
CPU: Intel Core i9-9900KS
GPU: Intel Arc A770 16GB & Intel UHD Graphics 630
SSD: Samsung 970 EVO Plus 2 TB
RAM: Crucial Ballistix 32GB DDR4-2400
Top
ololoshwin
n00b
n00b
Posts: 16
Joined: Thu Nov 25, 2021 8:13 am

  • Quote

Post by ololoshwin » Wed May 28, 2025 8:23 pm

Nowa wrote:It's probably attempting verification with the wrong key/certificate (possibly the portage certificate you used is not registered with UEFI/shim yet). Try listing all signatures with "sbverify --list".

Code: Select all

# sbverify  --list /boot/memtest86plus/memtest.efi64
signature 1
image signature issuers:
 - /C=Platform Key/CN=Platform Key
image signature certificates:
 - subject: /C=Platform Key/CN=Platform Key
   issuer:  /C=Platform Key/CN=Platform Key
Platform key was created by sbctl create-keys

Code: Select all

# openssl x509  -text -noout < /var/lib/sbctl/keys/PK/PK.pem 
Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number:
            ***STRIPPED***
        Signature Algorithm: sha256WithRSAEncryption
        Issuer: C=Platform Key, CN=Platform Key
        Validity
            Not Before: ***STRIPPED*** 2025 GMT
            Not After : ***STRIPPED*** 2030 GMT
        Subject: C=Platform Key, CN=Platform Key
        Subject Public Key Info:
            Public Key Algorithm: rsaEncryption
                Public-Key: (4096 bit)
                Modulus:...
Top
ololoshwin
n00b
n00b
Posts: 16
Joined: Thu Nov 25, 2021 8:13 am

  • Quote

Post by ololoshwin » Wed May 28, 2025 9:40 pm

After fixing by sbctl sign result is:

Code: Select all

# sbverify  --list /boot/memtest86plus/memtest.efi64
signature 1
image signature issuers:
 - /C=Platform Key/CN=Platform Key
image signature certificates:
 - subject: /C=Platform Key/CN=Platform Key
   issuer:  /C=Platform Key/CN=Platform Key
signature 2
image signature issuers:
 - /C=Database Key/CN=Database Key
image signature certificates:
 - subject: /C=Database Key/CN=Database Key
   issuer:  /C=Database Key/CN=Database Key
Top
Nowa
Developer
Developer
User avatar
Posts: 522
Joined: Wed Jun 25, 2014 7:07 am
Location: Hilversum

  • Quote

Post by Nowa » Thu May 29, 2025 5:35 am

You configured Portage to use the Platform Key, but that should be the Database key. Note that portage will use that key automatically if none are specified.
OS: Gentoo 6.19.3-gentoo-dist, ~amd64, 23.0/desktop/plasma/systemd
MB: MSI Z370-A PRO
CPU: Intel Core i9-9900KS
GPU: Intel Arc A770 16GB & Intel UHD Graphics 630
SSD: Samsung 970 EVO Plus 2 TB
RAM: Crucial Ballistix 32GB DDR4-2400
Top
ololoshwin
n00b
n00b
Posts: 16
Joined: Thu Nov 25, 2021 8:13 am

  • Quote

Post by ololoshwin » Thu May 29, 2025 4:06 pm

Nowa wrote:portage will use that key automatically if none are specified.
Thanks. Some time ago portage require to set SECUREBOOT_SIGN_KEY and SECUREBOOT_SIGN_KEY variables to build secureboot packages.

I've removed these variables and signing works.
Top
Post Reply

10 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic