forked from tiiuae/ghaf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add TPM2-PKCS11 support for X1 Carbon
This patch adds the initial support for PKCS#11 interface on the host system for the X1 carbon, utilising the hardware TPM2. Signed-off-by: Humaid Alqasimi <[email protected]>
- Loading branch information
1 parent
4b892d0
commit 70dcec0
Showing
6 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Copyright 2024 TII (SSRC) and the Ghaf contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
{ | ||
config, | ||
lib, | ||
pkgs, | ||
... | ||
}: let | ||
cfg = config.ghaf.security.tpm2; | ||
in | ||
with lib; { | ||
options.ghaf.security.tpm2 = { | ||
enable = mkEnableOption "TPM2 PKCS#11 interface"; | ||
}; | ||
|
||
config = mkIf cfg.enable { | ||
security.tpm2 = { | ||
enable = true; | ||
pkcs11.enable = true; | ||
abrmd.enable = true; | ||
}; | ||
|
||
environment.systemPackages = mkIf config.ghaf.profiles.debug.enable [ | ||
pkgs.opensc | ||
pkgs.tpm2-tools | ||
]; | ||
|
||
assertions = [ | ||
{ | ||
assertion = pkgs.stdenv.isx86_64; | ||
message = "TPM2 is only supported on x86_64"; | ||
} | ||
]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,5 +13,6 @@ _: { | |
(import ./qemu) | ||
(import ./nm-launcher) | ||
(import ./labwc) | ||
(import ./tpm2-pkcs11) | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Copyright 2024 TII (SSRC) and the Ghaf contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# This overlay customizes tpm2-pkcs11 - see comments for details | ||
# | ||
(_final: prev: { | ||
tpm2-pkcs11 = prev.tpm2-pkcs11.overrideAttrs (_prevAttrs: { | ||
configureFlags = ["--with-fapi=no --enable-fapi=no"]; | ||
}); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters