RFC Asymmetric TPM2 key type
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 RFC Latest5 patches 1 replyIn review
- v1 RFC5 patches 0 repliesSuperseded
Changes in v2 from the cover letter
Sorry for rush update. I noticed that not all changes were in the commits. This version just fixes those compilation errors.
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | crypto: rsa-pkcs1pad: export rsa1_asn_lookup()crypto/ include/ | +30 | 0 replies | |
| 2/5 | tpm: export tpm2_load_context()drivers/ drivers/ drivers/ +1 more | +79 | 0 replies | |
| 3/5 | KEYS: trusted: Do not use WARN when encode failssecurity/ | +6 | 0 replies | |
| 4/5 | KEYS: trusted: Migrate tpm2_key_{encode,decode}() to TPM driverdrivers/ drivers/ drivers/ +4 more | +242 | 0 replies | |
| 5/5 | keys: asymmetric: ASYMMETRIC_TPM2_KEY_RSA_SUBTYPEcrypto/ crypto/ crypto/ +4 more | +684 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH RFC v2 0/5] Asymmetric TPM2 key type
## Overview
Introduce tpm2_key_rsa implementing asymmetric TPM RSA key.
I submit this first as RFC as I could not execute the keyctl padd in the following sequence (returns EBADF):
tpm2_createprimary --hierarchy o -G rsa2048 -c owner.txt tpm2_evictcontrol -c owner.txt 0x81000001tpm2_getcap handles-persistent
openssl genrsa -out private.pem 2048tpm2_import -C 0x81000001 -G rsa -i private.pem -u key.pub -r key.priv tpm2_encodeobject -C 0x81000001 -u key.pub -r key.priv -o key.priv.pem openssl asn1parse -inform pem -in key.priv.pem -noout -out key.priv.der key_serial=cat key.priv.der | keyctl padd asymmetric tpm @u
This is derived work from James Prestwood’s earlier work from 2020:
https://lore.kernel.org/all/[email protected]/
## Change Log
v2:
Sorry for rush update. I noticed that not all changes were in the commits. This version just fixes those compilation errors.
James Prestwood (1):
keys: asymmetric: ASYMMETRIC_TPM2_KEY_RSA_SUBTYPE
Jarkko Sakkinen (4):
crypto: rsa-pkcs1pad: export rsa1_asn_lookup()
tpm: export tpm2_load_context()
KEYS: trusted: Do not use WARN when encode fails
KEYS: trusted: Migrate tpm2_key_{encode,decode}() to TPM driver
crypto/asymmetric_keys/Kconfig | 13 +
crypto/asymmetric_keys/Makefile | 1 +
crypto/asymmetric_keys/tpm2_key_rsa.c | 655 ++++++++++++++++++
crypto/rsa-pkcs1pad.c | 16 +-
drivers/char/tpm/Kconfig | 2 +
drivers/char/tpm/Makefile | 5 +
drivers/char/tpm/tpm.h | 2 -
drivers/char/tpm/tpm2-cmd.c | 77 ++
drivers/char/tpm/tpm2-space.c | 61 --
drivers/char/tpm/tpm2_key.c | 192 +++++
.../char/tpm}/tpm2key.asn1 | 0
include/crypto/rsa-pkcs1pad.h | 20 +
include/crypto/tpm2_key.h | 36 +
include/linux/tpm.h | 3 +
security/keys/trusted-keys/Makefile | 2 -
security/keys/trusted-keys/trusted_tpm2.c | 183 +----
16 files changed, 1032 insertions(+), 236 deletions(-)
create mode 100644 crypto/asymmetric_keys/tpm2_key_rsa.c
create mode 100644 drivers/char/tpm/tpm2_key.c
rename {security/keys/trusted-keys => drivers/char/tpm}/tpm2key.asn1 (100%)
create mode 100644 include/crypto/rsa-pkcs1pad.h
create mode 100644 include/crypto/tpm2_key.hSignature · 1 line
2.45.1