Skip to content

Commit 7b4fa2e

Browse files
JuergenReppSITAndreasFuchsTPM
authored andcommitted
tpm2_createek: Add high range templates for rsa20248 and eccp256
According to the EK Credential Profile B.4.4.1 Template H-1: RSA 2048 (Storage) B.4.4.2 Template H-2: ECC NIST P256 (Storage) and The high range templates are added. Addresses: #3471 Signed-off-by: Juergen Repp <juergen_repp@web.de>
1 parent c2d1ee7 commit 7b4fa2e

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

man/tpm2_createek.1.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ Refer to:
4646
using algorithm specifiers (e.g. **ecc384** or **ecc_nist_p384**) .
4747
* **rsa** - An RSA2048 key.
4848
* **keyedhash** - hmac key.
49+
By default, For NIST_P256 and RSA2048 the LOW range template defined in
50+
the EK Credential Profile will be used. The HIGH range template can
51+
be selected by adding the suffix _high to the algorithm name.
4952

5053
* **-u**, **\--public**=_FILE_:
5154

tools/tpm2_createek.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,18 @@ static const TPM2B_DIGEST policy_a_sha256 = {
4141
}
4242
};
4343

44+
static const TPM2B_DIGEST policy_b_sha256 = {
45+
.size = 32,
46+
.buffer = {
47+
0xca, 0x3d, 0x0a, 0x99, 0xa2, 0xb9,
48+
0x39, 0x06, 0xf7, 0xa3, 0x34, 0x24,
49+
0x14, 0xef, 0xcf, 0xb3, 0xa3, 0x85,
50+
0xd4, 0x4c, 0xd1, 0xfd, 0x45, 0x90,
51+
0x89, 0xd1, 0x9b, 0x50, 0x71, 0xc0,
52+
0xb7, 0xa0
53+
}
54+
};
55+
4456
static const TPM2B_DIGEST policy_b_sha384 = {
4557
.size = 48,
4658
.buffer = {
@@ -136,14 +148,19 @@ struct alg_map {
136148

137149
static const alg_map alg_maps[] = {
138150
{ "rsa", "rsa2048:aes128cfb", "sha256", &policy_a_sha256, ATTRS_A },
151+
{ "rsa_high", "rsa2048:aes128cfb", "sha256", &policy_b_sha256, ATTRS_B },
139152
{ "rsa2048", "rsa2048:aes128cfb", "sha256", &policy_a_sha256, ATTRS_A },
153+
{ "rsa2048_high", "rsa2048:aes128cfb", "sha256", &policy_b_sha256, ATTRS_B },
140154
{ "rsa3072", "rsa3072:aes256cfb", "sha384", &policy_b_sha384, ATTRS_B },
141155
{ "rsa4096", "rsa4096:aes256cfb", "sha384", &policy_b_sha384, ATTRS_B },
142156
{ "ecc", "ecc_nist_p256:aes128cfb", "sha256", &policy_a_sha256, ATTRS_A },
157+
{ "ecc_high", "ecc_nist_p256:aes128cfb", "sha256", &policy_b_sha256, ATTRS_B },
143158
{ "ecc256", "ecc_nist_p256:aes128cfb", "sha256", &policy_a_sha256, ATTRS_A },
159+
{ "ecc256_high", "ecc_nist_p256:aes128cfb", "sha256", &policy_b_sha256, ATTRS_B },
144160
{ "ecc384", "ecc_nist_p384:aes256cfb", "sha384", &policy_b_sha384, ATTRS_B },
145161
{ "ecc521", "ecc_nist_p521:aes256cfb", "sha512", &policy_b_sha512, ATTRS_B },
146162
{ "ecc_nist_p256", "ecc_nist_p256:aes128cfb", "sha256", &policy_a_sha256, ATTRS_A },
163+
{ "ecc_nist_p256_high", "ecc_nist_p256:aes128cfb", "sha256", &policy_b_sha256, ATTRS_B },
147164
{ "ecc_nist_p384", "ecc_nist_p384:aes256cfb", "sha384", &policy_b_sha384, ATTRS_B },
148165
{ "ecc_nist_p521", "ecc_nist_p521:aes256cfb", "sha512", &policy_b_sha512, ATTRS_B },
149166
{ "ecc_sm2", "ecc_sm2_p256:sm4_128cfb", "sm3_256", &policy_b_sm3_256, ATTRS_B },

0 commit comments

Comments
 (0)