Skip to content

Add SHA384 algorithm support - #139

Merged
nfrayer merged 1 commit into
rhboot:mainfrom
gustavo16a:add-pesign-sha384-algorithm
Sep 16, 2026
Merged

nfrayer merged 1 commit into
rhboot:mainfrom
gustavo16a:add-pesign-sha384-algorithm

Conversation

@gustavo16a

Copy link
Copy Markdown
Contributor

Currently SHA384 algorithm is not supported for pesign. With the command below returning not found:

pesign -d sha384

In general SHA256 is always used, however in some cases, some HSMs only expose SHA384 algorithms.

This change was tested generating signature attributes and then reattaching it to the binary, the workflow was like below:

mkdir keydb
certutil -d keydb db_cert.db -A -n db_cert -t ,,u -i RSA4096_cert.pem
pesign -i shellx64.efi -E shellx64.efi.sattrs -d sha384
openssl dgst sha384 -out shellx64.efi.sattrs.digest" -binary shellx64.efi.sattrs
$HSM_SIGNATURE_COMMAND --InputFile shellx64.efi.sattrs.digest --OutputFile shellx64.efi.sattrs.signed
pesign -c worker_cert \
  -n keydb \
  -R shellx64.efi.sattrs.signed \
  -I shellx64.efi.sattrs \
  -i shellx64.efi  \
  -d sha384 \
  -o shellx64.signed.efi

After that with OVMF build and secureboot enabled with loaded certificate (RSA4096_cert.pem) into db, the shellx64.signed.efi binary was successfully booted.

@gustavo16a
gustavo16a force-pushed the add-pesign-sha384-algorithm branch from 28516f9 to 7aff0b7 Compare September 8, 2026 17:09
@vathpela
vathpela force-pushed the add-pesign-sha384-algorithm branch from 7aff0b7 to 1e6769d Compare September 16, 2026 14:11
"pesign -d sha384" currently returns not found, as the algorithm is not
implemented in the CMS signature generation and verification process.
Therefore, this commit adds SHA384 algorithm support.

Signed-off-by: Gustavo dos Santos Cardoso <gustavo_16a@hotmail.com>
@vathpela
vathpela force-pushed the add-pesign-sha384-algorithm branch from 1e6769d to be4c9f7 Compare September 16, 2026 14:17
@nfrayer
nfrayer self-requested a review September 16, 2026 14:39

@nfrayer nfrayer left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@nfrayer
nfrayer merged commit 0c8679c into rhboot:main Sep 16, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants