Skip to content

eBPF-based security platform

tpm_wire: accept only the default RSA exponent

Daniel Borkmann9dbe1f5bfd6d
diff --git a/Documentation/security/cryptography.rst b/Documentation/security/cryptography.rst
index 9e74f16b..803156d0 100644
--- a/Documentation/security/cryptography.rst
+++ b/Documentation/security/cryptography.rst
@@ -198,8 +198,8 @@ TPM
nonce, up to 64 bytes. ``init`` records its name in the identity
map.
* - Endorsement key
- - The TCG default template, RSA-2048 or ECC P-256, with AES-128 in
- CFB mode as its symmetric algorithm
+ - The TCG default template, RSA-2048 with the exponent 65537 or ECC
+ P-256, with AES-128 in CFB mode as its symmetric algorithm
- Credential activation for ``shirudo attest challenge``
* - Credential
- RSA-OAEP with SHA-256 and the label ``IDENTITY`` for an RSA
diff --git a/util/tpm_wire.c b/util/tpm_wire.c
index 8bf969f2..fb1f965d 100644
--- a/util/tpm_wire.c
+++ b/util/tpm_wire.c
@@ -368,7 +368,8 @@ int tpm_public_parse(const __u8 *buf, size_t len,
(out->type == TPM_ALG_ECC &&
out->curve != TPM_ECC_NIST_P256) ||
(out->type == TPM_ALG_RSA &&
- (out->rsa_bits != 2048 || out->n_len != 256)))
+ (out->rsa_bits != 2048 || out->n_len != 256 ||
+ (out->rsa_exponent && out->rsa_exponent != 65537))))
return -EPROTONOSUPPORT;
return 0;
}