KEYS: asymmetric: tpm2_key_rsa
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v5 Latest5 patches 4 repliesIn review
- v45 patches 0 repliesSuperseded
- v35 patches 0 repliesSuperseded
Earlier versions · 2
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v2 | 6 patches | 13 replies | Superseded | |
| v1 | 6 patches | 2 replies | Superseded |
Patches in v5 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 | KEYS: trusted: Change -EINVAL to -E2BIGsecurity/ | +1 | 0 replies | |
| 3/5 | KEYS: trusted: Move tpm2_key_decode() to the TPM driverdrivers/ drivers/ drivers/ +4 more | +167 | 0 replies | |
| 4/5 | tpm: tpm2_key: Extend parser to TPM_LoadableKeydrivers/ include/ security/ | +18 | 0 replies | |
| 5/5 | keys: asymmetric: ASYMMETRIC_TPM2_KEY_RSA_SUBTYPEcrypto/ crypto/ crypto/ +1 more | +698 | 3 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v5 yet.
Cover letter [PATCH v5 0/5] KEYS: asymmetric: tpm2_key_rsa
## Overview
Introduce tpm2_key_rsa module, which implements asymmetric TPM2 RSA key. The feature can be enabled with the CONFIG_ASYMMETRIC_TPM2_KEY_RSA_SUBTYPE kconfig option. This feature allows the private key to be uploaded to the TPM2 for signing, and software can use the public key to verify the signatures.
The idea in the design is to over time to have submodule per key type For instance, tpm2_key_ecdsa could be one potential future addition in the future. Perhaps, it might sense to consider at that point also a top-level tpm2_key module. The gist is that the naming convention is free from potential future bottlencks.
### Testing
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 serial=cat key.priv.der | keyctl padd asymmetric tpm @u
echo "abcdefg" > plaintext.txt
keyctl pkey_encrypt $serial 0 plaintext.txt enc=pkcs1 > encrypted.dat keyctl pkey_decrypt $serial 0 encrypted.dat enc=pkcs1 > decrypted.dat keyctl pkey_sign $serial 0 plaintext.txt enc=pkcs1 hash=sha256 > signed.dat keyctl pkey_verify $serial 0 plaintext.txt signed.dat enc=pkcs1 hash=sha256
## References
- v4: https://lore.kernel.org/linux-integrity/[email protected]/
- v3: https://lore.kernel.org/linux-integrity/[email protected]/
- v2: https://lore.kernel.org/linux-integrity/[email protected]/
- v1: https://lore.kernel.org/linux-integrity/[email protected]/
- Derived from https://lore.kernel.org/all/[email protected]/
James Prestwood (1):
keys: asymmetric: ASYMMETRIC_TPM2_KEY_RSA_SUBTYPE
Jarkko Sakkinen (4):
crypto: rsa-pkcs1pad: export rsa1_asn_lookup()
KEYS: trusted: Change -EINVAL to -E2BIG
KEYS: trusted: Move tpm2_key_decode() to the TPM driver
tpm: tpm2_key: Extend parser to TPM_LoadableKey
crypto/asymmetric_keys/Kconfig | 15 +
crypto/asymmetric_keys/Makefile | 1 +
crypto/asymmetric_keys/tpm2_key_rsa.c | 680 ++++++++++++++++++
crypto/rsa-pkcs1pad.c | 16 +-
drivers/char/tpm/Kconfig | 1 +
drivers/char/tpm/Makefile | 5 +
drivers/char/tpm/tpm2_key.c | 118 +++
.../char/tpm}/tpm2key.asn1 | 0
include/crypto/rsa-pkcs1pad.h | 20 +
include/crypto/tpm2_key.h | 35 +
include/linux/tpm.h | 2 +
security/keys/trusted-keys/Makefile | 2 -
security/keys/trusted-keys/trusted_tpm2.c | 131 +---
13 files changed, 908 insertions(+), 118 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