-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnfm24.tex
executable file
·1429 lines (1292 loc) · 65.3 KB
/
nfm24.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
\documentclass[runningheads]{llncs}
%
\usepackage{graphicx}
% Used for displaying a sample figure. If possible, figure files should
% be included in EPS format.
\usepackage{tikz}
\usetikzlibrary{arrows}
\usepackage{verbatim}
%\usepackage{amsmath}
%\usepackage{amssymb}
%\usepackage{graphicx}
%\usepackage[all]{xy}
\usepackage{array}
\usepackage{enumitem}
%\usepackage{cite}
\usepackage[numbers,sectionbib]{natbib}
% If you use the hyperref package, please uncomment the following line
% to display URLs in blue roman font according to Springer's eBook style:
% \renewcommand\UrlFont{\color{blue}\rmfamily}
\usepackage[breaklinks=true]{hyperref}
\usepackage{breakcites}
\renewcommand\UrlFont{\color{blue}\rmfamily}
\input{coq-listings}
\begin{document}
%
\title{Verifying TPM DevID Provisioning\thanks{This work is funded in part
Honeywell FMT Purchase Order
\#N000422909. The views and conclusions contained in this document
are those of the authors and should not be interpreted as
representing the official policies, either expressed or implied,
of the U.S. Government.}}
%
%\titlerunning{Abbreviated paper title}
% If the paper title is too long for the running head, you can set
% an abbreviated paper title here
%
\author{Sarah Johnson \and
Perry Alexander}
%
\authorrunning{S. Johnson and P. Alexander.}
% First names are abbreviated in the running head.
% If there are more than two authors, 'et al.' is used.
%
\institute{Institute for Information Sciences \\ The
University of Kansas \\ Lawrence, KS 66045 \\
\email{\{sarahjohnson,palexand\}@ku.edu}}
%
\maketitle % typeset the header of the contribution
%
\begin{abstract}
Provisioning TPM-based secure device identifiers must be verified to
ensure they are strongly bound to their devices. Lack of such
assurance jeopardizes high-integrity decisions and reporting that
rely upon associating data with devices. We develop models of two
TCG provisioning protocols and verify they provide guarantees
necessary to produce a strong cryptographic binding of TPM key to
device. As a result we can be assured that initial and local device
identifiers are strongly bound to their associated devices.
\keywords{Secure Device Identifiers \and TPM \and Verification.}
\end{abstract}
%
%
%
\section{Introduction}
Deployment of trusted systems requires strong
identification~\citep{Martin:08:The-ten-page-in} ensuring a remote
device is unambiguously associated with an identity. Strong identity
has two properties: (i) generated and bound to the device using good
credentials (integrity); and (ii) stored in a way that prevents use by
other devices (confidentiality). Without strong identification a
malicious source can produce and use an invalid identity or steal and
use the identity of good entity.
One method for implementing strong identity is a \emph{secure device
identifier (DevID)}~\citep{DevIDSpec-IEEE} realized using a Trusted
Platform Module (TPM) to generate and protect DevID instances. The
Trusted Computing Group DevID Specification~\citep{DevIDSpec-TCG}
describes protocols for assuring DevID integrity and
confidentiality. These protocols are performed by a trusted
Certificate Authority (CA) communicating with a certificate-requesting
device. The protocols result in the formation of a cryptographic
evidentiary chain linking a DevID to its TPM-containing device and
produce a DevID certificate assuring the DevID's integrity and
confidentiality. If a signature check using the DevID key is
successful the checked signature was produced by the correct private
key. The existence of the DevID certificate ensures the signing key
resides only on the correct, properly provisioned TPM-containing
device, thus satisfying requirements for strong identification.
%% First,
%% the Trusted Computing Group DevID Specification~\citep{DevIDSpec-TCG}
%% describes protocols for assuring DevID integrity and residency. These
%% protocols are performed by a trusted Certificate Authority (CA)
%% communicating with a certificate-requesting device. They evaluate a
%% cryptographic evidentiary chain linking a DevID to its TPM-containing
%% device and produce a certificate assuring integrity. Second, the TPM
%% provides an attribute that when set during key creation
%% prevents duplication or sharing of a key. Setting this attribute for
%% a DevID key ensures its confidentiality.
Our work focuses on correctness of two certification protocols:
(i) OEM Creation of an IAK Certificate based on an EK Certificate; and
(ii) Owner Creation of an LAK Certificate based on an IAK
Certificate. These DevID establishment protocols and their resulting
certificates are essential for our work in remote
attestation~\citep{Coker::Principles-of-R,petz2022innovations} where
device appraisal requires strong identification of an attestation
source. Specifically, ensuring the signing key for an attestation
result is bound to the attestation manager responsible for that
attestation. Contributions of this research include: (i) design and
implementation of an abstract formal model of TPM command execution;
(ii) an in-depth analysis of the TCG-provided IAK and LAK
certification protocols, and (iii) a recommendation for clarifying the
IAK provisioning procedure.
\section{DevIDs and TPMs}
The \emph{Trusted Platform Module (TPM)} is a microcontroller that complies
with the ISO/IEC 11889:2015 international standard. The TPM was
designed by the Trusted Computing Group (TCG) to act as a hardware
root-of-trust for PC system security. TPMs are increasingly common
making them a strong choice for building DevIDs.
%%\subsection{TPM Keys and DevID Certificates}
In the context of this work, a \emph{TPM key} is an asymmetric key created
and used by a TPM in a way that is consistent with its specified attributes.
TPM key attributes are permanent, set at creation-time, and restrict how the key may
be used. Attributes include \verb|FixedTPM| to control duplication,
\verb|Sign| and \verb|Decrypt| to restrict the key usage, and
\verb|Restricted| to limit operations to TPM-generated data only. A
restricted decryption key is called a \emph{storage key} while a
restricted signing key is call an \emph{attestation key (AK)}.
The AK is so named for its unique ability to prove that a data
object is contained in the same TPM as the key itself.
%% Primary TPM keys are maintained internally by the TPM as roots for
%% chaining key ownership. They are shielded and not available outside
%% the TPM. Ordinary TPM keys are wrapped by a parent TPM key and can be
%% stored outside the TPM. The wrapping operation encrypts the ordinary
%% TPM key's private key with a parent public key and includes a PCR
%% composite. The public key remains clear and can be used for encryption
%% and signature checking. However, decryption and signing are possible
%% only if both key and its parent are installed in the TPM. When the
%% key is installed the parent key must be installed to decrypt its
%% private key. Wrapping creates an ownership chain from ordinary keys
%% to a primary key, thus binding keys in the chain to the TPM.
% key may only sign a PCR digest produced by the TPM during attestation
% and to prove that a new key is loaded on the same TPM as itself during
% certification. A valid signature proves that quoted PCR values or new
% key are from the same TPM as the original key. If the signing key is
% bound to the a TPM, then the PCR values or new key are also bound to
% the same TPM.
% A restricted decryption key is called a storage key. Only storage keys
% can be used as parents to create or load child objects or to activate
% credentials~\citep{PracticalGuide}. The EK is initialized by the TPM
% manufacturer and stored in a shielded location on the TPM. The
% corresponding EK certificate is the root certificate for chains of
% IAKs and LAKs and thus plays a significant role in the creation of
% DevID certificates.
A \emph{secure device identifier (DevID)} is a TPM key with
\verb|FixedTPM| and \verb|Sign| set, cryptographically bound to a
device by a \emph{DevID certificate}. Thus, a DevID is a signing key
that cannot be duplicated or shared outside the TPM. The
\verb|FixedTPM| attribute is essential as it guarantees the
confidentiality property of strong identity, namely that the DevID is
stored in a way that prevents use by other devices. Given a positive
check of signature generated by a DevID, we know the signature came
from the DevID's TPM. The DevID certificate links a DevID to its
TPM-containing device and is generated through interaction with a
trusted Certificate Authority (CA). The certificate is necessary
because a positive signature check does not indicate the owner of the
DevID. A trusted CA generates and signs a certificate containing the
public DevID key and information identifying the device that created
it.
\begin{table}[hbtp]
\begin{center}
\footnotesize
\begin{tabular}{ |c|c|c|c|c|c|c| }
\hline
Key & \verb|FixedTPM| & \verb|Sign| & \verb|Decrypt| & \verb|Restricted| &
Creator \\
\hline
\hline
EK & X & & X & X & TPM Manufacturer \\
\hline
IAK & X & X & & X & OEM \\
\hline
IDevID & X & X & & & OEM \\
\hline
LAK & X & X & & X & Owner \\
\hline
LDevID & X & X & & & Owner \\
\hline
\end{tabular}
\caption{EK and DevID Attribute Requirements and Properties}
\label{fig:req_and_recs}
\end{center}
\end{table}
%%\subsection{TPM Provisioning}
All TPMs are shipped from the manufacturer with a storage key called
the \emph{Endorsement Key (EK)}. The EK is a \verb|FixedTPM|,
restricted, decryption key initialized by the TPM manufacturer. The
EK has an associated certificate generated by the TPM Foundry CA that
binds the EK to a specific TPM. Although the EK is not a DevID since
it is not a signing key, it serves a significant role in the
provisioning of DevIDs.
When a TPM is installed in a device by an original equipment
manufacturer (OEM), the OEM creates \emph{Initial Attestation Keys
(IAKs)} that are \verb|FixedTPM|, restricted, signing keys. IAK
certificates generated by the OEM CA provide definitive evidence that
the associated IAK belongs to a specific TPM-containing device. Trust
for creation of a new DevID is based on an existing certificate.
Therefore, proving that an IAK belongs to a specific device requires
first binding an IAK to a specific TPM using its EK and then binding
the TPM to a specific device.
Following the creation of IAKs, the OEM creates \emph{Initial Device
Identifiers (IDevIDs)}. The OEM CA generates IDevID
certificates. Proving that an IDevID belongs to a specific device
requires binding the IDevID to a specific TPM and device using an IAK.
IAKs and IDevIDs are permanent, unique identifiers of TPM-containing
devices, intended to be long-lived and usable for the device's
lifetime. They should be used sparingly to limit the risk of
compromise.
% An AK may only sign objects produced by the TPM. This includes
% TPM-internal structures such as platform configuration registers,
% digests, and keys. TPM-based attestation involves high-integrity reporting
% of system measurements stored in the TPM's platform configuration
% registers (PCRs). PCRs store a measurement chain composite in a way
% that guarantees integrity. Rather than being set like a traditional
% register, a PCR is extended by concatenating a new hash to the current
% PCR value, hashing and storing the result. Thus, a PCR captures both
% measurement value and order over an arbitrarily long measurement
% sequence. A TPM attestation is called a quote and minimally consists
% of a PCR composite signed to guarantee integrity and authenticity. To
% tie attestation data to a specific device, the signing key must be an
% AK. An AK's \verb|Restricted| attribute and associated certificate
% results in cryptographic binding of signatures to a specific device.
\emph{Local Attestation Keys (LAKs)} and
\emph{Local Device Identifiers (LDevIDs)} are installed by device owners
and serve as aliases for the device. Unlike IAKs and IDevIDs, they
need not be long-lived, may be created and installed at any time, and
shared widely. LAK certificates and LDevID certificates are generated by
the Owner CA. Proving that an LAK or an LDevID belongs to a specific device
requires binding the key to a specific TPM and device using an existing AK.
This AK may be an IAK or LAK.
% Proper TPM key creation ensures
% an ownership chain from a TPM's EK while a DevID certificate ensures
% residency and proper key attributes. The role of a Certificate
% Authority (CA) is to certify key residency and properties, and issuing
% DevID certificates. CAs associated with the TPM manufacturer, OEMs,
% and device owners interact with the TPM to: (i) create the initial EK
% certificate; (ii) create an initial DevID certificate permanently
% bound to a device; and (iii) create collections of local DevID
% certificates serving as device aliases using the following procedure:
\begin{figure}[hbtp]
\centering
\input{key-cert-rel}
\caption{Keys and certificates created by CA provisioning.
Black arrows are trust relationships while red
arrows denote key inclusion in certificates. Certificates are
labeled with their associated CA~\citep{DevIDSpec-TCG}.}
\label{fig:cert_rel}
\end{figure}
%%\subsection{Creating and Using DevIDs}
To reiterate, trust for creating a new DevID is based on an existing
certificate. Therefore, a chain of certificates can be used to verify
a chain of trust to some trust anchor~\citep{DevIDSpec-TCG}.
%%Trust in new DevIDs is inherited from an existing chain back to a
%%trust anchor~\citep{DevIDSpec-TCG}.
Since an IAK provides definitive evidence that a key belongs to a
specific device, an IAK certificate serves as the trust anchor
and is the root node in a chain of DevID certificates. Since an AK has
the \verb|Restricted| attribute set, it has the ability to prove that
some unknown key is loaded on the same TPM as itself. AK certificates
are thus used as the existing certificate in the provisioning of new DevIDs
and may be parent nodes in a chain of DevID certificates.
All IDevID and LDevID certificates are leaf nodes.
The resulting structure showing relationships between the EK, DevIDs
and certificates is shown in Figure~\ref{fig:cert_rel}.
% \begin{enumerate}
% \item\label{ite:idTPM} Manufacturers produce TPMs provisioned with an
% EK certificate binding the EK to a specific TPM. TPMs and EK
% certificates are then distributed to Original Equipment
% Manufacturers (OEMs) and represent roots-of-trust.
% \item\label{ite:idDevIni} OEMs produce devices with TPMs provisioned
% with one or more IDevID certificates that bind an IDevID key to a
% device. Devices are then distributed to end users (Owners).
% \item\label{ite:idDevLoc} Owners may optionally provision their TPMs
% with one or more LDevID certificates that bind LDevID keys to their
% device.
% \end{enumerate}
% \noindent Modeling and verifying device identification provisioning
% using CAs in \ref{ite:idDevIni} and \ref{ite:idDevLoc} is the subject
% of this work.
% \begin{itemize}[itemsep=0pt,parsep=0pt,partopsep=0pt]
% \item \textsf{TPM Manufacturer}: Manufacturers produce TPMs provisioned with an
% EK certificate binding the EK to a specific TPM.
% \begin{itemize}[itemsep=0pt,parsep=0pt,partopsep=0pt]
% \item The EK is initialized in an immutable, shielded location
% \item The EK certificate is generated and signed by the TPM
% Manufacturer's CA binding the EK to the TPM.
% \end{itemize}
% \item \textsf{OEM}: OEMs produce devices with TPMs provisioned with
% one or more Initial DevID (IDevID) certificates that bind an Initial
% DevID (IDevID) key to a device.
% \begin{itemize}[itemsep=0pt,parsep=0pt,partopsep=0pt]
% \item \textsf{A}: The Initial AK (IAK) is created and verified by
% the OEM's CA to have correct key properties and to be loaded on
% the same TPM as the EK.
% \item \textsf{B}: The Initial DevID (IDevID) is created and verified
% by the OEM's CA to have the correct key properties and to be
% loaded on the same TPM as the IAK.
% \item \textsf{CA Signing}: The IAK certificate and IDevID
% certificate are signed by the OEM's CA binding the IAK and IDevID
% to this specific device.
% \end{itemize}
% \item \textsf{Owner}: Owners may optionally provision their TPMs with
% one or more Local DevIDs (LDevID) certificates binding Local DevID
% (LDevID) keys to their specific device.
% \begin{itemize}[itemsep=0pt,parsep=0pt,partopsep=0pt]
% \item \textsf{C}: The LAK is created and verified by the Owner's CA
% to have the correct key properties and to be loaded on the same
% TPM as the IAK.
% \item \textsf{D}: The LDevID is created and verified by the Owner's
% CA to have the correct key properties and to be loaded on the same
% TPM as the LAK.
% \item \textsf{CA Signing}: The LAK certificate and LDevID
% certificate are signed by the Owner's CA binding the LAK and
% LDevID to this specific device.
% \end{itemize}
% \end{itemize}
% \begin{figure}[htbp]
% \begin{centering}
% \includegraphics[width=\linewidth]{figures/certRelationships.png}
% \par\end{centering}
% \caption{Key and Certificate Relationships \citep{DevIDSpec-TCG}}
% \label{fig:cert_rel}
% \end{figure}
\section{Protocol Execution Model}
TPM protocols are sequences of TPM Software Stack (TSS) instructions.
To model protocol execution we use a labeled transition system
representing effects of protocol execution. State is represented as a
collection of objects installed in the TPM while transitions perform
operations over state as defined by commands. Labels represent
individual commands and label sequences represent protocols. DevID
provisioning protocols are modeled as sequences of state
transformations corresponding with commands executed by the CA or
certificate-requesting entity.
%\subsection{Keys and Certificates}
The model defines a \verb|pubKey| and \verb|privKey| type for public
keys and private keys respectively. A key of either type requires a
unique identifier and a sequence of Boolean values indicating the
presence of key attributes. An asymmetric key pair is a \verb|pubKey|
and a \verb|privKey| pair with the same identifier and attributes.
% \begin{lstlisting}[language=Coq]
% Inductive pubKey : Type :=
% | Public : keyIdType -> Restricted -> Sign -> Decrypt -> FixedTPM -> pubKey.
% Inductive privKey : Type :=
% | Private : keyIdType -> Restricted -> Sign -> Decrypt -> FixedTPM -> privKey.
% \end{lstlisting}
Certificates are defined by the \verb|signedCert| type consisting of a
public key, an identifier, and a private key. The identifier
represents the certificate's Subject field and may include information
describing the TPM or the device. The private key parameter denotes
the CA's key that performed the signature over the certificate.
% \begin{lstlisting}[language=Coq]
% Inductive identifier : Type :=
% | TPM_info : tpmInfoType -> identifier
% | Device_info : deviceInfoType -> identifier.
% Inductive signedCert : Type :=
% | Cert : pubKey -> identifier -> privKey -> signedCert.
% \end{lstlisting}
%\subsection{Commands}
Protocols used to create DevID certificates execute TPM, TSS and
non-TPM commands. A command may rely on a variety of parameters such
as keys, nonces, certificates, and messages that define structures an
entity may use or produce. The \verb|message| type shown in
Figure~\ref{fig:message-model} is an abstract representation of these
structures.
\begin{figure}[hbtp]
\vspace{-\medskipamount}
\vspace{-\medskipamount}
\begin{lstlisting}[language=Coq]
Inductive message : Type :=
| signature : message -> privKey -> message
| TPM2B_Attest : pubKey -> message
| encryptedCredential : message -> randType -> pubKey -> message
| TCG_CSR_IDevID : identifier -> signedCert -> pubKey -> message
| TCG_CSR_LDevID : message -> signedCert -> message
| ...
\end{lstlisting}
\vspace{-\medskipamount}
\caption{TPM Message Data Structure}
\label{fig:message-model}
\end{figure}
%% \begin{figure}[hbtp]
%% \begin{lstlisting}[language=Coq]
%% Inductive message : Type :=
%% | publicKey : pubKey -> message
%% | privateKey : privKey -> message
%% | hash : message -> message
%% | signature : message -> privKey -> message
%% | TPM2B_Attest : pubKey -> message
%% | encryptedCredential : message -> randType -> pubKey -> message
%% | randomNum : randType -> message
%% | TCG_CSR_IDevID : identifier -> signedCert -> pubKey -> message
%% | TCG_CSR_LDevID : message -> signedCert -> message
%% | signedCertificate : signedCert -> message
%% | pair : message -> message -> message.
%% \end{lstlisting}
%% \caption{TPM Message Model}
%% \label{fig:message-model}
%% \end{figure}
An entity may derive additional messages from a collection of known
messages. For example, given a message of the form
\verb|signature m k|, \verb|m| may be deduced as signatures do not
hide their contents. Conversely, a message of the form
\verb|encryptedCredential n g k| protects its contents unless its
decryption key is also available. Additional messages may be derived
from signed messages, \verb|TPM2B_Attest| structures, certificate
signing requests (CSRs), certificates, and message pairs. Other
messages contain no additional information or information is
concealed. Message inference is modeled by a recursive function
\verb|inferFrom| and an equivalent inductive proposition
\verb|inferrable|.
\verb|tpm_state| and \verb|state| are lists of messages modeling TPM
state. \verb|tpm_state| contains messages that a restricted signing
key may operate on. Such messages must be in one of two forms: (i)
objects constructed from TPM-internal data such as private keys and
PCRs; or (ii) digests produced by signature hash operations.
\verb|state| contains messages visible to the system.
A labeled transition system models TPM command execution in the
canonical fashion as a triple $(S,L,\rightarrow)$ where $S$ is a set
of states, $L$ is a set of labels, and
$\rightarrow \subseteq S \times L \times S$ is a labeled transition
relation. In this case, $S$ is defined as
\verb|tpm_state|$\times$\verb|state| pairs; $L$ is the set of
\verb|command| values; and $\rightarrow$ is the \verb|execute|
relation defining single command execution. \verb|execute| is defined
using an inductive proposition relating a current state pair, a
command, and a next state pair.
% \begin{figure}[h]
% \begin{lstlisting}[language=Coq]
% Inductive execute : tpm_state * state -> command -> tpm_state * state -> Prop
% \end{lstlisting}
% \caption{Type Signature of Execute Relation}
% \end{figure}
% Each \verb|command| constructor corresponds with one constructor in the
% \verb|execute| relation with the exception of \verb|TPM2_Sign| that
% corresponds with two. Each constructor possesses its own distinctive
% conditions that must be met for execution to succeed. These conditions
% are manifested in several ways: constructors pattern match on the
% command's inputs, some inputs must be in the current, and the results
% must be in the next state.
\begin{figure}[hbtp]
\vspace{-\medskipamount}
\vspace{-\medskipamount}
\begin{footnotesize}
\begin{lstlisting}[language=Coq]
Inductive command : Type :=
| TPM2_Sign : message -> privKey -> command
| TPM2_Certify : pubKey -> privKey -> command
| TPM2_ActivateCredential : message -> privKey -> privKey -> command
| MakeCSR_IDevID : identifier -> signedCert -> pubKey -> command
| MakeCSR_LDevID : message -> signedCert -> command
| ...
\end{lstlisting}
\end{footnotesize}
\vspace{-\medskipamount}
\caption{TPM Command Data Structure}
\label{fig:command-model}
\end{figure}
%% \begin{figure}[hbtp]
%% \begin{footnotesize}
%% \begin{lstlisting}[language=Coq]
%% Inductive command : Type :=
%% | TPM2_Hash : message -> command
%% | CheckHash : message -> message -> command
%% | TPM2_Sign : message -> privKey -> command
%% | TPM2_Certify : pubKey -> privKey -> command
%% | CheckSig : message -> pubKey -> command
%% | TPM2_MakeCredential : message -> randType -> pubKey -> command
%% | TPM2_ActivateCredential : message -> privKey -> privKey -> command
%% | MakeCSR_IDevID : identifier -> signedCert -> pubKey -> command
%% | MakeCSR_LDevID : message -> signedCert -> command
%% | CheckCert : signedCert -> pubKey -> command
%% | CheckAttributes : pubKey -> Restricted -> Sign -> Decrypt -> FixedTPM -> command
%% | MakePair : message -> message -> command.
%% \end{lstlisting}
%% \end{footnotesize}
%% \caption{TPM Command Data Structure}
%% \label{fig:command-model}
%% \end{figure}
% The \verb|TPM2_Hash| command performs a cryptographic hash operation
% on a piece of data. This data may be any message that is known to the
% entity performing the command \verb|state|. The result of the
% operation is abstractly defined using the opaque \verb|hash|
% constructor and is stored in both the next \verb|tpm_state| and
% \verb|state|. The \verb|CheckHash| command verifies
% that the contents of a hash digest match a particular plaintext
% message. Both the hash digest and the plaintext message must be
% contained in the current \verb|state|.
% The \verb|TPM2_Sign| command generates a signature over a message
% using the specified private key. To succeed the key must have the
% \verb|Sign| attribute set and the key must be present in
% \verb|tpm_state|. Execution then differs based on the status of the
% private key's \verb|Restricted| attribute. If the key does not have
% the \verb|Restricted| attribute set the message must simply be in
% \verb|state|. If the key does have the \verb|Restricted| attribute
% set, the message must be in the current \verb|tpm_state|.
While most TPM command behaviors are clear from their name, two are
critical to CA protocol verification and warrant explanation. The
\verb|TPM2_Certify| command provides proof that an object is loaded in
the TPM by producing a signed \verb|TPM2B_Attest| structure. The
command requires two inputs: (i) a public key to be certified; and
(ii) a private key to sign the attestation structure. To execute, the
TPM verifies that the public key parameter's inverse is loaded.
% Messages produced by the \verb|TPM2_Sign| and \verb|TPM2_Certify|
% commands are defined using the \verb|signature| constructor. A
% signature may be verified against a public key using the
% \verb|CheckSig| command.
% The \verb|TPM2_MakeCredential| command is used when a remote entity,
% desires to affirm that some private key is loaded on the same TPM as a
% particular EK. This command produces an
% \verb|encryptedCredential| structure and requires three inputs: the
% cryptographic name of a key to be credentialed; a secret; and a public
% EK. % The cryptographic name of a key is produced by hashing its public
% % area with its associated hash algorithm and prepending the Algorithm
% % ID of the hashing algorithm.
The \verb|TPM2_ActivateCredential| command is used by the recipient of
an encrypted credential blob to release its secret. The secret
contained in an encrypted credential blob is only released if the
credentialed key is loaded on the same TPM as the EK. When executing
the \verb|TPM2_ActivateCredential| command, the TPM first decrypts the
blob with the EK then verifies that the private key corresponding with
the name field is also loaded. The secret is only released if both
steps succeed. The secret value may then be returned to the remote CA
to validate the result.
% The \verb|MakeCSR_IDevID| command produces a \verb|TCG_CSR_IDevID|
% structure. A \verb|TCG_CSR_IDevID| is a certificate signing request
% (CSR) that contains the data required to couple an initial DevID to a
% TPM-containing device. This structure is used any time
% a provisioning procedure uses the EK certificate. The
% \verb|MakeCSR_LDevID| command is similar except that it produces a
% \verb|TCG_CSR_LDevID| structure that includes the certification
% information for a locally significant DevID.
% The \verb|CheckCert| command verifies a signature over a certificate
% against a public key. One should check an EK certificate against the
% public key of the TPM Manufacturer's CA, an IAK or IDevID certificate
% against the public key of the OEM's CA, and an LAK or LDevID
% certificate against the public key of the Owner's CA. The
% \verb|CheckAttributes| command verifies a public key has all provided
% attributes. In order to check the attributes, one must have have
% knowledge of that key. The key need not be loaded on a TPM since this
% command is typically used to check the attributes of some external
% entity's key.
%\subsection{Protocols}
Commands are sequenced linearly by the \verb|sequence| constructor to form
protocols. Protocol execution is defined as an inductive proposition
relating a current state pair, a command sequence, and a next state
pair. Sequential execution first executes the command at the head of a
sequence using the single command execution relation \verb|execute|
followed by executing the remaining sequence using the sequential
execution relation \verb|seq_execute|. The next state pair produced by
the single command becomes the current state pair for the following
sequence.
%% \begin{figure}[hbtp]
%% \begin{lstlisting}[language=Coq]
%% Inductive sequence : Type :=
%% | Sequence : command -> sequence -> sequence
%% | Done : sequence.
%%
%% Inductive seq_execute : tpm_state * state -> sequence -> tpm_state * state -> Prop :=
%% | SE_Seq : forall ini mid fin c s,
%% execute ini c mid ->
%% seq_execute mid s fin ->
%% seq_execute ini (Sequence c s) fin
%% | SE_Done : forall ini, seq_execute ini Done ini.
%% \end{lstlisting}
%% \caption{Sequential command execution model}
%% \label{fig:command-sequence-model}
%% \end{figure}
We prove an important property of sequential execution. That is,
sequential execution is deterministic. Given an initial state pair and
a command sequence, there is at most one final state pair that
satisfies the \verb|seq_execute| relation implying that command
sequence execution is a partial function.
%% Second, sequential execution
%% is monotonic over state. Given a current state pair, command sequence,
%% and initial state pair, the initial state is always a subset of the
%% final state implying that command sequence execution is monotonic.
% \begin{figure}[hbtp]
% \begin{lstlisting}[language=Coq]
% Theorem seq_exec_deterministic : forall ini s fin1 fin2,
% seq_execute ini s fin1 ->
% seq_execute ini s fin2 ->
% fin1 = fin2.
% Theorem seq_exec_expansion : forall iniTPM ini s finTPM fin,
% seq_execute (iniTPM,ini) s (finTPM,fin) ->
% (iniTPM \subsetOf finTPM) /\ (ini \subsetOf fin).
% \end{lstlisting}
% \caption{Properties of Sequential Execution}
% \label{fig:sequential-execution-properties}
% \end{figure}
% For two commands to match, not only must the commands itself match but
% all of their inputs as well. To precisely describe this situation,
% this function utilizes the decidable equality property over the
% \verb|command| type. This requires declaring and proving that the
% \verb|command| type and all of the types it relies on (e.g.,
% \verb|message|, \verb|pubKey|, \verb|signedCert|) are members of the
% \verb|DecEq| class. These proofs may be conveniently automated.
%
%
%
\section{Proof Techniques}
The TCG describes several provisioning protocols~\citep{DevIDSpec-TCG}
that maintain a cryptographic evidentiary chain linking a
DevID to a specific TPM and device using TPM-residency. For each
protocol, the specification outlines steps for the CA and the
certificate-requesting entity. To verify the guarantees made
by these protocols, we consider two scenarios: (i) the CA and
certificate-requesting entity
perform the exact steps described by the specification; and (ii) only the
CA is trusted to perform the steps described by the specification.
We will use two novel proof techniques, one for each scenario,
to verify TPM-residency of the new DevID---\emph{minimal initial state} and
\emph{supersequence}.
\subsection{Minimal Initial State}
A minimal initial state aims to quantitatively describe the minimal
prerequisites for successfully executing a command sequence.
Given a command sequence,
a minimal initial state is defined as the smallest initial state that
allows successful execution. The proof obligation describing this
property in Figure~\ref{fig:minimal-initial-state} has two parts: (i)
the minimal initial state is a lower bound on the set of possible
initial states; and (ii) the minimal initial state is sufficient for
successful execution.
\begin{figure}[hbtp]
\vspace{-\medskipamount}
\vspace{-\medskipamount}
\begin{lstlisting}[language=Coq]
Definition lower_bound seq minTPM min : Prop :=
forall iniTPM ini fin,
seq_execute (iniTPM, ini) seq fin ->
(minTPM \subsetOf iniTPM) /\ (min \subsetOf ini).
Definition sufficient seq minTPM min : Prop :=
exists fin, seq_execute (minTPM, min) seq fin.
\end{lstlisting}
\caption{Minimal Initial State}
\label{fig:minimal-initial-state}
\end{figure}
We use the minimal initial state in our verification of the first
scenario to prove that an unknown key is
loaded on the same TPM as a previously-certified key when the
certificate-requesting entity follows the TCG's
recommended procedure.
%% Specifically, the key whose presence is
%% required is included in the minimal initial state for protocol
%% execution.
\subsection{Supersequence}
A CA will only issue a certificate if it receives a valid
\emph{certificate signing request (CSR)}. The production of a CSR
shown in Figure~\ref{fig:csr-production} can be described by these
statements: the certificate-requesting entity executes some arbitrary,
unknown command sequence; the initial state contains only messages
that cannot be generated by the certificate-requesting entity; the
command sequence produces some message in the final state; and a CA
determines that the message is a valid CSR. We constrain the initial
state of the certificate-requesting entity to include only those
messages it cannot generate to ensure the contents of the
produced CSR are fresh.
\begin{figure}[hbtp]
\vspace{-\medskipamount}
\vspace{-\medskipamount}
\begin{lstlisting}[language=Coq]
Definition arbitrary_CSR_production (steps_CA : message -> Prop) : Prop :=
forall seq iniTPM ini finTPM fin,
seq_execute (iniTPM, ini) seq (finTPM, fin) ->
(forall m', needsGenerated m' -> ~ In m' iniTPM) ->
(forall m', needsGenerated m' -> ~ In m' ini) ->
In csr fin ->
steps_CA csr.
\end{lstlisting}
\caption{Arbitrary CSR production definition.}
\label{fig:csr-production}
\end{figure}
To produce a valid CSR, specific commands must be executed in a
specific order. The shape of a valid request and the checks performed
by a CA allows proving that any command sequence the
certificate-requesting entity performed to generate the request is a
supersequence of the TCG-recommended procedure. A list is a
supersequence of another list if and only if all the elements of the
second list occur in order in the first---the elements need not occur
consecutively. We use the supersequence technique to verify the second
scenario to gain necessary knowledge of the unknown command sequence
executed by the certificate-requesting entity.
\section{Identity Provisioning}
We consider two DevID provisioning protocols in detail: (i) Owner
creation of an LAK certificate based on an IAK certificate; and (ii)
OEM creation of an IAK certificate based on an EK certificate. For
each protocol, the TCG specification outlines steps for the CA and the
certificate-requesting entity. The specification claims each protocol
ensures properties manifest as assertions about TPM-residency, key
attributes, or previously-issued certificates providing the basis for
the resulting certificate chain. We verify each protocol guarantees
its associated properties.
We consider two protocol execution scenarios: (i) the CA and
certificate-requesting entity perform the exact steps described
by the specification; and (ii) only the
CA is trusted to perform the steps described by the specification. Because
trust in a new certificate is rooted in an existing certificate, these
scenarios assume a precondition that previously-issued certificates
have properties guaranteed by their provisioning protocols.
\subsection{Owner Creation of LAK Certificate based on IAK Certificate}
The TCG's specification claims the protocol for creating an LAK
certificate in Figure~\ref{fig:lak-certificate-creation} guarantees two
properties: the LAK has good attributes; and the LAK is loaded on the
same TPM as the IAK. These properties correspond with the Chain of
Trust relation from IAK to LAK in Figure \ref{fig:cert_rel}.
\begin{figure}[hpbt]
\vspace{-\medskipamount}
\vspace{-\medskipamount}
\begin{enumerate}[itemsep=0pt,parsep=0pt,partopsep=0pt]
\setcounter{enumi}{-1}
\item The Owner creates and loads the LAK
\item The Owner certifies the LAK with the IAK
\item The Owner builds the CSR% containing:
% \begin{enumerate}[topsep=0pt, itemsep=0pt,parsep=0pt,partopsep=0pt]
% \item The signed \verb|TPM2B_Attest| structure
% \item The IAK certificate
% \end{enumerate}
\item The Owner takes a signature hash of the CSR
\item The Owner signs the resulting hash digest with the LAK
\item The Owner sends the CSR paired with the signed hash to the CA
\item The CA verifies the received data% by checking:
% \begin{enumerate}[topsep=0pt, itemsep=0pt,parsep=0pt,partopsep=0pt]
% \item The hash digest against the CSR
% \item The signature on the hash digest with the public LAK
% \item The signature on the \verb|TPM2B_Attest| structure with the public IAK
% \item The signature on the IAK certificate with the public key of the OEM's CA
% \item The attributes of the LAK
% \end{enumerate}
\item If all checks succeed, the CA issues the LAK certificate to the Owner
\end{enumerate}
\caption{LAK Certificate Creation Protocol}
\label{fig:lak-certificate-creation}
\end{figure}
Modeling this protocol begins by initializing states for the Owner and
CA. The Owner must have its LAK, IAK, and IAK certificate, and the CA
must have its own key and the public key of the OEM CA.
% Private key values are represented by taking the inverse of the corresponding
% public key and are stored in the \verb|privLAK|, \verb|privIAK|, and
% \verb|privCA| variables.
To enforce the randomness of cryptographic
keys, all key values are specified to be pairwise distinct.
% \begin{figure}[hbtp]
% \begin{lstlisting}[language=Coq]
% (* Owner parameters *)
% Parameter pubLAK : pubKey.
% Parameter pubIAK : pubKey.
% Parameter certIAK : signedCert.
% (* CA parameters *)
% Parameter pubCA : pubKey.
% Parameter pubOEM : pubKey.
% (* All keys are pairwise distinct *)
% Axiom keys_distinct :
% pubLAK <> pubIAK /\
% pubLAK <> pubCA /\
% pubLAK <> pubOEM /\
% pubIAK <> pubCA /\
% pubIAK <> pubOEM /\
% pubCA <> pubOEM.
% \end{lstlisting}
% \caption{Parameters of LAK Provisioning Procedure}
% \end{figure}
\begin{figure}[hpbt]
\vspace{-\medskipamount}
\vspace{-\medskipamount}
\begin{lstlisting}[language=Coq]
Definition steps1to5_Owner : sequence :=
TPM2_Certify pubLAK privIAK;
MakeCSR_LDevID (signature (TPM2B_Attest pubLAK) privIAK) certIAK;
TPM2_Hash (TCG_CSR_LDevID (signature (TPM2B_Attest pubLAK) privIAK) certIAK);
TPM2_Sign
(hash (TCG_CSR_LDevID (signature (TPM2B_Attest pubLAK) privIAK) certIAK))
privLAK;
...
\end{lstlisting}
\caption{Owner's LAK Provisioning Protocol}
\label{fig:lak_model_Owner}
\end{figure}
The protocol is modeled in two parts: the Owner's steps (Steps 0-5)
followed by the CA's steps (Steps 6-7). Each part of the procedure is
modeled using the initialized state and the sequential command
construction defined previously. We construct a \verb|sequence| value
for the Owner and a function for the CA. Constructing the Owner's
steps is straightforward and shown in
Figure~\ref{fig:lak_model_Owner}. Step 0 is assumed to have been
performed previously since its results are already encapsulated in the
Owner's initialized state. Each remaining step of the Owner
corresponds with exactly one command in the model, namely
\verb|TPM2_Certify| for Step 1, \verb|MakeCSR_LDevID| for Step 2,
\verb|TPM2_Hash| for Step 3, \verb|TPM2_Sign| for Step 4, and
\verb|MakePair| for Step 5.
The CA's steps in Figure~\ref{fig:lak_model_CA} are more complex as
they rely on the CSR produced by the Owner.
First, the CA waits to receive a request from the
Owner. The request must be in a specific
format to be considered valid. The CA then executes Step 6 of the
procedure defined by the sequence within \verb|seq_execute|. If
execution succeeds, the CA issues the LAK certificate to the Owner.
The model includes several additional parameters and criteria to serve
as a method for referencing elements of the certificate request
within proof statements.
\begin{figure}[hpbt]
\vspace{-\medskipamount}
\vspace{-\medskipamount}
\begin{lstlisting}[language=Coq]
Definition steps_CA (msg:message) (iak lak:pubKey) (cert:signedCert) : Prop :=
match msg with
| (pair (TCG_CSR_LDevID (signature (TPM2B_Attest k) k0') (Cert k0 id k_ca'))
(signature m k')) =>
iak = k0 /\ lak = k /\ cert = (Cert k0 id k_ca') /\
seq_execute (iniTPM_CA, inferFrom msg ++ ini_CA)
CheckHash m
(TCG_CSR_LDevID (signature (TPM2B_Attest k) k0') (Cert k0 id k_ca'));
CheckSig (signature m k') k;
CheckSig (signature (TPM2B_Attest k) k0') k0;
CheckCert (Cert k0 id k_ca') pubOEM';
CheckAttributes k Restricting Signing NonDecrypting FixedTPM;
(iniTPM_CA, inferFrom msg ++ ini_CA)
| _ => False
end.
\end{lstlisting}
\caption{CA's LAK Provisioning Protocol}
\label{fig:lak_model_CA}
\end{figure}
The good attributes property is proved under both scenarios
simultaneously by using only the CA's function. The
\verb|CheckAttributes| command in the CA's function corresponds with
Step 6 of the provisioning procedure. It follows that successful
execution implies the LAK has all attributes required to be an
attestation key.
We now verify that the LAK and IAK are on the same TPM under the
conditions of the first scenario where both the Owner and CA perform
the exact steps described by the specification. Recall that this proof
trusts that the previously-performed IAK provisioning guarantees its
associated properties, specifically that the IAK has good attributes.
We construct a minimal initial state pair for \verb|steps1to5_Owner|
using the following intuition: (i) the private LAK and private IAK are
loaded on the same TPM because the LAK is certified by the IAK; and
(ii) the IAK certificate is known to the Owner because it is included
in the CSR. The proof of the lower bound property uses this
intuition. The proof of the sufficiency property uses the
constructors of the \verb|execute| relation to demonstrate that a next
state pair exists that satisfies the \verb|seq_execute| relation for
the minimal initial state pair and \verb|steps1to5_Owner|. This proof
relies on two conditions, the IAK has good attributes and that the CA
issues the LAK certificate.
% \begin{figure}[hbtp]
% \begin{lstlisting}[language=Coq]
% Definition minTPM_Owner : tpm_state := [ privateKey privLAK
% ; privateKey privIAK ].
% Definition min_Owner : state := [ signedCertificate certIAK ].
% Lemma lower_bound_Owner :
% lower_bound steps1to5_Owner minTPM_Owner min_Owner.
% Lemma sufficient_Owner : forall msg,
% attestationKey pubIAK ->
% steps_CA msg pubIAK pubLAK certIAK ->
% sufficient steps1to5_Owner minTPM_Owner min_Owner.
% \end{lstlisting}
% \caption{Minimal Initial State of Owner}
% \end{figure}
This analysis of the Owner's steps' prerequisites in the form of a
minimal initial state leads to the conclusion that the LAK and IAK
must be loaded on the same TPM for the Owner to execute its steps.
Therefore, we have now confirmed the simultaneous presence of the LAK
and IAK is guaranteed by the protocol when we assume that both the
Owner and the CA are trusted to execute their prescribed steps.
We now attempt to verify the same goal under the second scenario where
only the CA is trusted to perform the steps described by the specification.
We define a cascading collection of recursive functions to determine
whether a given command sequence is a supersequence of
\verb|steps1to5_Owner|. Using the properties provided by the
\verb|arbitrary_CSR_production| definition, we prove the Owner's
arbitrary command sequence satisfies this function.
% This proof is
% troublesome if we make no assumptions about the Owner. Because the
% certificate request and its contents must have been produced by some
% entity, we assume the Owner to be this entity. Owner and its
% characteristics are represented as a series of assumptions: the Owner
% executes some unknown sequence of commands \verb|s|; \verb|s| produces
% a message \verb|msg| in the Owner's next \verb|state|; the Owner's
% initial \verb|tpm_state| only contains private keys; the Owner's
% initial \verb|state| only contains public keys and certificates; and
% the CA executes its procedure on the message \verb|msg|.
% \begin{figure}[hbtp]
% \begin{lstlisting}[language=Coq]
% Theorem lak_and_iak_in_TPM : forall s iniTPM ini finTPM fin msg iak lak cert,
% seq_execute (iniTPM, ini) s (finTPM, fin) ->
% In msg fin ->
% (forall m', needsGeneratedTPM m' -> ~ In m' iniTPM) ->
% (forall m', needsGenerated m' -> ~ In m' ini) ->