Debian Codegraph @

docs/credential-activation.md

raw
1 # Credential Activation
2
3 Credential activation remotely proves a specific attestation key resides on
4 the same TPM as a specific endorsement key. Because the endorsement key is the
5 cryptographic identifier for a TPM (and by extension, the device), credential
6 activation enables a remote system to establish trust in a new key, which can
7 then be used to encrypt or attest on behalf of the device.
8
9 Credential Activation is a poorly documented TPM concept. This document
10 aims to explain how it works and what it is used for, without assuming any
11 knowledge of the TCG specifications.
12
13 ## Overview
14
15 Abstractly: credential activation allows a remote party to verify one key is
16 on the same TPM as another key, and that the key has a specific set of
17 properties.
18
19 The description in the first paragraph describes the activation of an
20 attestation key with the endorsement key. While this is the most common use
21 of credential activation, any two asymmetric key-pairs in the TPM can be
22 used.
23
24 ### How it works
25
26 The credential activation procedure involves the remote end generating a
27 specially-crafted, encrypted challenge for the TPM to process. The server
28 generates this challenge based on knowledge of two TPM keys (specifically,
29 their public keys and key properties), and the secret data it wishes to
30 encrypt.
31
32 This challenge can be decrypted by the TPM using the `ActivateCredential`
33 command. Through this command, the user presents to the TPM:
34
35 * The encrypted challenge generated by the server
36 * A handle to the 1st key
37 * A handle to the 2nd key
38
39 If the keys and their properties are present on the TPM, and match exactly
40 the keys the server used to generate the challenge, the TPM will decrypt
41 the secret contained within, and return it as the response to the command.
42
43 ## Why use credential activation?
44
45 **TL;DR: Credential activation lets you trust a new key.**
46
47 While devices are typically identified by the endorsement key burned into
48 their TPM, key usage restrictions set on most endorsement keys mean they
49 typically cannot be used for signing or attestation. As such a different
50 key is needed.
51
52 After the new key is generated on the TPM, the credential activation
53 procedure allows you to prove that:
54
55 * The new key has acceptable properties (ie: A key intended for attestation
56 can only be used in attestation commands, and the key material cannot be
57 exported).
58 * The new key is present & on the same TPM as an endorsement key.
59
60 Once credential activation completes successfully, the remote end can be
61 sure of the properties of the key & which device it was generated for, and
62 start trusting the use of the new key on behalf of the device.
63
64 ## Detailed process
65
66 ### Glossary
67
68 **Activation key** - The first public key. Credential activation verifies that
69 this key is resident on the TPM, *and it has a specific set of properties.*
70
71 **Anchor key** - The second public key. Credential activation verifies this
72 key is resident on the same TPM as the activation key.
73
74 ### Sequence of operations
75
76 ![sequence diagram](credential_activation.png)
77
78 1. The Client device informs the server of the public keys of both the anchor
79 and activation key, as well as communicating the key properties of the
80 activation key.
81
82 2. The server computes the activation challenge, as described below. This
83 challenge is sent back to the client.
84
85 3. The Client invokes the `ActivateCredential` command, providing the encrypted
86 challenge from the server, and handles to the two keys.
87
88 4. If the keys handles presented have public keys / properties matching those
89 the server used when computing the challenge, the TPM will be able to
90 decrypt and return the secret.
91
92 ## Appendix: Generating the credential activation challenge
93
94 TODO