Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rpm2img: use openssl to generate HMAC #196

Merged
merged 1 commit into from
Apr 10, 2024

Conversation

bcressey
Copy link
Contributor

Issue number:

Closes #195

Description of changes:
The sha512hmac tool from libkcapi requires the kernel to be built with CRYPTO_USER support. If this dependency is not satisfied, the signature generation fails with this message:

  Error: Netlink error: sendmsg failed
  Error: NETLINK_CRYPTO: cannot obtain cipher information for hmac(sha512)

Generate the HMAC with openssl instead, which does not require any specific kernel functionality.

Testing done:
Verified that the generated HMAC can be validated at runtime with sha512hmac:

bash-5.2# cd /boot
bash-5.2# sha512hmac -c .vmlinuz.hmac
vmlinuz: OK

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

The `sha512hmac` tool from libkcapi requires the kernel to be built
with CRYPTO_USER support. If this dependency is not satisfied, the
signature generation fails with this message:
  Error: Netlink error: sendmsg failed
  Error: NETLINK_CRYPTO: cannot obtain cipher information for hmac(sha512)

Generate the HMAC with `openssl` instead, which does not require any
specific kernel functionality.

Signed-off-by: Ben Cressey <[email protected]>
@bcressey bcressey requested review from webern and sumukhballal April 10, 2024 15:36
@bcressey bcressey merged commit 6053627 into bottlerocket-os:develop Apr 10, 2024
1 check passed
@bcressey bcressey deleted the kernel-hmac-take-two branch April 10, 2024 18:10
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.

sha512hmac fails if the kernel is not built with CRYPTO_USER support
4 participants