-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathibmtss.html
3894 lines (3419 loc) · 147 KB
/
ibmtss.html
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
<title>IBM TSS</title>
<meta name="generator" content="LibreOffice 4.3.7.2 (Linux)"/>
<meta name="author" content="Ken Goldman"/>
<meta name="created" content="2015-11-20T13:35:00"/>
<meta name="changedby" content="Kenneth Goldman"/>
<meta name="changed" content="2020-03-31T11:10:00"/>
<style type="text/css">
@page { size: 8.5in 11in; margin-right: 1.25in; margin-top: 1in; margin-bottom: 0.5in }
p { margin-bottom: 0.08in; direction: ltr; color: #000000; widows: 2; orphans: 2 }
p.western { font-family: "Times New Roman", serif; font-size: 12pt; so-language: en-US }
p.cjk { font-family: "Times New Roman", serif; font-size: 12pt }
p.ctl { font-family: "Times New Roman", serif; font-size: 12pt; so-language: ar-SA }
h1 { margin-bottom: 0.04in; direction: ltr; color: #000000; widows: 2; orphans: 2 }
h1.western { font-family: "Arial", sans-serif; font-size: 16pt; so-language: en-US }
h1.cjk { font-family: "Times New Roman", serif; font-size: 16pt }
h1.ctl { font-family: "Arial", sans-serif; font-size: 16pt; so-language: ar-SA }
h2 { margin-top: 0.17in; margin-bottom: 0.04in; direction: ltr; color: #000000; widows: 2; orphans: 2 }
h2.western { font-family: "Arial", sans-serif; font-size: 14pt; so-language: en-US }
h2.cjk { font-family: "Times New Roman", serif; font-size: 14pt }
h2.ctl { font-family: "Arial", sans-serif; font-size: 14pt; so-language: ar-SA; font-style: italic }
h3 { margin-top: 0.17in; margin-bottom: 0.04in; direction: ltr; color: #000000; widows: 2; orphans: 2 }
h3.western { font-family: "Cambria", serif; font-size: 13pt; so-language: en-US }
h3.cjk { font-family: "Times New Roman", serif; font-size: 13pt }
h3.ctl { font-family: "Cambria", serif; font-size: 13pt; so-language: ar-SA }
h4 { margin-top: 0.17in; margin-bottom: 0.04in; direction: ltr; color: #000000; widows: 2; orphans: 2 }
h4.western { font-family: "Calibri", sans-serif; font-size: 14pt; so-language: en-US }
h4.cjk { font-family: "Times New Roman", serif; font-size: 14pt }
h4.ctl { font-family: "Times New Roman", serif; font-size: 14pt; so-language: ar-SA }
a:link { color: #0000ff }
a.western:link { so-language: en-US }
a.cjk:link { so-language: en-US }
a:visited { color: #800080 }
a.western:visited { so-language: en-US }
a.cjk:visited { so-language: zh-CN }
a.ctl:visited { so-language: hi-IN }
</style>
</head>
<body lang="en-US" text="#000000" link="#0000ff" vlink="#800080" bgcolor="#ffffff" dir="ltr" style="background: #ffffff">
<p lang="da-DK" align="center" style="margin-left: 0.17in; margin-bottom: 0in">
<br/>
</p>
<p align="center" style="margin-top: 0.14in; margin-bottom: 0.33in"><font face="Arial, sans-serif"><font size="6" style="font-size: 24pt">IBM
TPM 2.0 (and 1.2) TSS API</font></font></p>
<p align="center" style="margin-top: 0.14in; margin-bottom: 0.33in"><font face="Arial, sans-serif"><font size="6" style="font-size: 24pt">Ken
Goldman</font></font></p>
<p align="center" style="margin-top: 0.14in; margin-bottom: 0.33in"><font face="Arial, sans-serif"><font size="6" style="font-size: 24pt">IBM
Research</font></font></p>
<p align="center" style="margin-top: 0.14in; margin-bottom: 0.33in"><font face="Arial, sans-serif"><font size="6" style="font-size: 24pt">[email protected]</font></font></p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" align="center" style="margin-bottom: 0in"><font size="5" style="font-size: 20pt">April
March 3118, 202018</font></p>
<p lang="da-DK" class="western" align="center" style="margin-bottom: 0in">
<br/>
</p>
<p lang="da-DK" align="center" style="margin-left: 0.17in; margin-bottom: 0in; page-break-before: always">
<br/>
</p>
<p lang="da-DK" align="center" style="margin-left: 0.17in; margin-bottom: 0in">
<br/>
</p>
<div id="Table of Contents1" dir="ltr">
<p lang="da-DK" align="center" style="margin-left: 0.17in; margin-bottom: 0in">
<font size="4" style="font-size: 15pt"><b><a class="western" href="#__RefHeading___Toc35934217"><span style="letter-spacing: 0.4pt">1.</span></a></b><font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"><span style="font-weight: normal"><a class="western" href="#__RefHeading___Toc35934217"> </a></span></span></font></font><a class="western" href="#__RefHeading___Toc35934217"><b><span style="letter-spacing: 0.4pt">Introduction</span><span lang="en-US"> 5</span></b></a></font></p>
<p lang="da-DK" align="center" style="margin-left: 0.17in; margin-bottom: 0in">
<font size="4" style="font-size: 15pt"><b><a class="western" href="#__RefHeading___Toc35934218"><span style="letter-spacing: 0.4pt">2.</span></a></b><font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"><span style="font-weight: normal"><a class="western" href="#__RefHeading___Toc35934218"> </a></span></span></font></font><a class="western" href="#__RefHeading___Toc35934218"><b><span style="letter-spacing: 0.4pt">Features</span><span lang="en-US"> 6</span></b></a></font></p>
<p lang="da-DK" align="center" style="margin-left: 0.17in; margin-bottom: 0in">
<font size="4" style="font-size: 15pt"><b><a class="western" href="#__RefHeading___Toc35934219"><span style="letter-spacing: 0.4pt">3.</span></a></b><font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"><span style="font-weight: normal"><a class="western" href="#__RefHeading___Toc35934219"> </a></span></span></font></font><a class="western" href="#__RefHeading___Toc35934219"><b><span style="letter-spacing: 0.4pt">API</span><span lang="en-US"> 7</span></b></a></font></p>
<p style="margin-left: 0.17in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934220">3.1.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>TSS_Execute()<span lang="en-US"> 7</span></a></p>
<p style="margin-left: 0.17in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934221">3.2.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>TSS_Create()<span lang="en-US"> 7</span></a></p>
<p style="margin-left: 0.17in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934222">3.3.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>TSS_Delete()<span lang="en-US"> 8</span></a></p>
<p style="margin-left: 0.17in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934223">3.4.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>Optional
Customization<span lang="en-US"> 9</span></a></p>
<p style="margin-left: 0.33in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934224">3.4.1.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>Property
Example<span lang="en-US"> 9</span></a></p>
<p style="margin-left: 0.33in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934225">3.4.2.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>Properties<span lang="en-US"> 9</span></a></p>
<p style="margin-left: 0.33in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934226">3.4.3.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>TSS_SetProperty()<span lang="en-US"> 12</span></a></p>
<p style="margin-left: 0.17in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934227">3.5.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>Extra
Parameter<span lang="en-US"> 13</span></a></p>
<p style="margin-left: 0.17in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934228">3.6.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>Other
APIs and Headers<span lang="en-US"> 13</span></a></p>
<p lang="da-DK" align="center" style="margin-left: 0.17in; margin-bottom: 0in">
<font size="4" style="font-size: 15pt"><b><a class="western" href="#__RefHeading___Toc35934229"><span style="letter-spacing: 0.4pt">4.</span></a></b><font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"><span style="font-weight: normal"><a class="western" href="#__RefHeading___Toc35934229"> </a></span></span></font></font><a class="western" href="#__RefHeading___Toc35934229"><b><span style="letter-spacing: 0.4pt">Application
Notes</span><span lang="en-US"> 15</span></b></a></font></p>
<p style="margin-left: 0.17in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934230">4.1.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>TPM
Simulator<span lang="en-US"> 15</span></a></p>
<p style="margin-left: 0.17in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934231">4.2.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>Parameter
Encryption<span lang="en-US"> 15</span></a></p>
<p style="margin-left: 0.17in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934232">4.3.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>Session
Salt<span lang="en-US"> 15</span></a></p>
<p style="margin-left: 0.17in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934233">4.4.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>Session
Bind<span lang="en-US"> 15</span></a></p>
<p style="margin-left: 0.17in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934234">4.5.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>NV<span lang="en-US"> 16</span></a></p>
<p style="margin-left: 0.33in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934235">4.5.1.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>Rationale<span lang="en-US"> 16</span></a></p>
<p style="margin-left: 0.33in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934236">4.5.2.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>NV
Pre-provisioning<span lang="en-US"> 17</span></a></p>
<p style="margin-left: 0.17in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934237">4.6.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>TPM2_LoadExternal<span lang="en-US"> 17</span></a></p>
<p style="margin-left: 0.17in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934238">4.7.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>Connecting
to Resource Managers<span lang="en-US"> 17</span></a></p>
<p style="margin-left: 0.17in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934239">4.8.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>Endorsement
Key (EK) Certificates<span lang="en-US"> 18</span></a></p>
<p style="margin-left: 0.33in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934240">4.8.1.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>Nuvoton<span lang="en-US"> 19</span></a></p>
<p style="margin-left: 0.33in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934241">4.8.2.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>St
Micro<span lang="en-US"> 19</span></a></p>
<p style="margin-left: 0.33in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934242">4.8.3.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>Infineon<span lang="en-US"> 20</span></a></p>
<p style="margin-left: 0.33in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934243">4.8.4.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>NationZ<span lang="en-US"> 20</span></a></p>
<p style="margin-left: 0.33in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934244">4.8.5.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>Intel<span lang="en-US"> 20</span></a></p>
<p style="margin-left: 0.33in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934245">4.8.5.1.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>Intel
EK Certificate Download<span lang="en-US"> 20</span></a></p>
<p style="margin-left: 0.17in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934246">4.9.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>Command
Line Utilities<span lang="en-US"> 21</span></a></p>
<p style="margin-left: 0.17in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934247">4.10.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>TSS
for TPM 1.2<span lang="en-US"> 22</span></a></p>
<p lang="da-DK" align="center" style="margin-left: 0.17in; margin-bottom: 0in">
<font size="4" style="font-size: 15pt"><b><a class="western" href="#__RefHeading___Toc35934248"><span style="letter-spacing: 0.4pt">5.</span></a></b><font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"><span style="font-weight: normal"><a class="western" href="#__RefHeading___Toc35934248"> </a></span></span></font></font><a class="western" href="#__RefHeading___Toc35934248"><b><span style="letter-spacing: 0.4pt">Examples</span><span lang="en-US"> 23</span></b></a></font></p>
<p style="margin-left: 0.17in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934249">5.1.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>signapp.c<span lang="en-US"> 23</span></a></p>
<p style="margin-left: 0.17in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934250">5.2.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>writeapp.c<span lang="en-US"> 23</span></a></p>
<p lang="da-DK" align="center" style="margin-left: 0.17in; margin-bottom: 0in">
<font size="4" style="font-size: 15pt"><b><a class="western" href="#__RefHeading___Toc35934251"><span style="letter-spacing: 0.4pt">6.</span></a></b><font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"><span style="font-weight: normal"><a class="western" href="#__RefHeading___Toc35934251"> </a></span></span></font></font><a class="western" href="#__RefHeading___Toc35934251"><b><span style="letter-spacing: 0.4pt">Utility
tools</span><span lang="en-US"> 25</span></b></a></font></p>
<p style="margin-left: 0.17in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934252">6.1.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>Debugging
Aids<span lang="en-US"> 25</span></a></p>
<p style="margin-left: 0.33in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934253">6.1.1.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>reponsecode<span lang="en-US"> 25</span></a></p>
<p style="margin-left: 0.33in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934254">6.1.2.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>printattr<span lang="en-US"> 25</span></a></p>
<p style="margin-left: 0.33in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934255">6.1.3.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>timepacket<span lang="en-US"> 25</span></a></p>
<p style="margin-left: 0.17in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934256">6.2.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>Policy
Aids<span lang="en-US"> 25</span></a></p>
<p style="margin-left: 0.33in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934257">6.2.1.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>policymaker<span lang="en-US"> 26</span></a></p>
<p style="margin-left: 0.33in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934258">6.2.2.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>policymakerpcr<span lang="en-US"> 26</span></a></p>
<p style="margin-left: 0.33in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934259">6.2.3.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>publicname<span lang="en-US"> 26</span></a></p>
<p style="margin-left: 0.17in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934260">6.3.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>Key
Manipulation<span lang="en-US"> 26</span></a></p>
<p style="margin-left: 0.33in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934261">6.3.1.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>createek<span lang="en-US"> 26</span></a></p>
<p style="margin-left: 0.33in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934262">6.3.2.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>createekcert<span lang="en-US"> 27</span></a></p>
<p style="margin-left: 0.33in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934263">6.3.3.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>tpm2pem<span lang="en-US"> 27</span></a></p>
<p style="margin-left: 0.17in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934264">6.4.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>Event
Logs<span lang="en-US"> 27</span></a></p>
<p style="margin-left: 0.33in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934265">6.4.1.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>eventextend<span lang="en-US"> 27</span></a></p>
<p style="margin-left: 0.33in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934266">6.4.2.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>imaextend<span lang="en-US"> 27</span></a></p>
<p lang="da-DK" align="center" style="margin-left: 0.17in; margin-bottom: 0in">
<font size="4" style="font-size: 15pt"><b><a class="western" href="#__RefHeading___Toc35934267"><span style="letter-spacing: 0.4pt">7.</span></a></b><font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"><span style="font-weight: normal"><a class="western" href="#__RefHeading___Toc35934267"> </a></span></span></font></font><a class="western" href="#__RefHeading___Toc35934267"><b><span style="letter-spacing: 0.4pt">Build</span><span lang="en-US"> 28</span></b></a></font></p>
<p style="margin-left: 0.17in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934268">7.1.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>Build
Options<span lang="en-US"> 28</span></a></p>
<p style="margin-left: 0.33in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934269">7.1.1.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>TPM_TPM20
and TPM_TPM12<span lang="en-US"> 28</span></a></p>
<p style="margin-left: 0.33in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934270">7.1.2.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>TPM_POSIX
or TPM_WINDOWS<span lang="en-US"> 28</span></a></p>
<p style="margin-left: 0.33in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934271">7.1.3.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>TPM_WINDOWS_TBSI<span lang="en-US"> 28</span></a></p>
<p style="margin-left: 0.33in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934278">7.1.4.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>TPM_TSS_NOFILE<span lang="en-US"> 28</span></a></p>
<p style="margin-left: 0.33in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934279">7.1.5.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>TPM_TSS_NOCRYPTO<span lang="en-US"> 29</span></a></p>
<p style="margin-left: 0.33in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934280">7.1.6.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>TPM_TSS_NO_PRINT<span lang="en-US"> 29</span></a></p>
<p style="margin-left: 0.33in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934281">7.1.7.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>TPM_TSS_NOECC<span lang="en-US"> 29</span></a></p>
<p style="margin-left: 0.33in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934282">7.1.8.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>TPM_TSS_NORSA<span lang="en-US"> 29</span></a></p>
<p style="margin-left: 0.33in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934283">7.1.9.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>TPM_TSS_NOENV<span lang="en-US"> 29</span></a></p>
<p style="margin-left: 0.33in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934286">7.1.10.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>TPM_NOSOCKET<span lang="en-US"> 29</span></a></p>
<p style="margin-left: 0.33in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934287">7.1.11.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>TPM_TSS_NOCMDCHECK<span lang="en-US"> 30</span></a></p>
<p style="margin-left: 0.33in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934288">7.1.12.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>TPM_TSS_NODEPRECATED<span lang="en-US"> 30</span></a></p>
<p style="margin-left: 0.33in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934289">7.1.13.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>TPM_TSS_NUVOTON<span lang="en-US"> 30</span></a></p>
<p style="margin-left: 0.17in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934290">7.2.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>Directories<span lang="en-US"> 30</span></a></p>
<p style="margin-left: 0.17in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934291">7.3.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>Linux<span lang="en-US"> 31</span></a></p>
<p style="margin-left: 0.17in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934292">7.4.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>Windows<span lang="en-US"> 31</span></a></p>
<p style="margin-left: 0.33in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934293">7.4.1.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>Windows
gcc<span lang="en-US"> 33</span></a></p>
<p style="margin-left: 0.33in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934300">7.4.2.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>Windows
Visual Studio<span lang="en-US"> 33</span></a></p>
<p style="margin-left: 0.33in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934301">7.4.3.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>Windows
Tbsi<span lang="en-US"> 34</span></a></p>
<p style="margin-left: 0.17in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934302">7.5.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>Mac<span lang="en-US"> 34</span></a></p>
<p style="margin-left: 0.17in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934303">7.6.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>AIX<span lang="en-US"> 35</span></a></p>
<p lang="da-DK" align="center" style="margin-left: 0.17in; margin-bottom: 0in">
<font size="4" style="font-size: 15pt"><b><a class="western" href="#__RefHeading___Toc35934304"><span style="letter-spacing: 0.4pt">8.</span></a></b><font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"><span style="font-weight: normal"><a class="western" href="#__RefHeading___Toc35934304"> </a></span></span></font></font><a class="western" href="#__RefHeading___Toc35934304"><b><span style="letter-spacing: 0.4pt">Fedora</span><span lang="en-US"> 36</span></b></a></font></p>
<p style="margin-left: 0.17in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934305">8.1.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>Local
Install<span lang="en-US"> 36</span></a></p>
<p style="margin-left: 0.17in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934306">8.2.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>Alternative
Local Install<span lang="en-US"> 36</span></a></p>
<p style="margin-left: 0.17in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934307">8.3.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>Repository
Install<span lang="en-US"> 37</span></a></p>
<p style="margin-left: 0.17in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934308">8.4.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>Install
Test<span lang="en-US"> 37</span></a></p>
<p style="margin-left: 0.17in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934309">8.5.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>Source
rpms<span lang="en-US"> 37</span></a></p>
<p lang="da-DK" align="center" style="margin-left: 0.17in; margin-bottom: 0in">
<font size="4" style="font-size: 15pt"><b><a class="western" href="#__RefHeading___Toc35934310"><span style="letter-spacing: 0.4pt">9.</span></a></b><font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"><span style="font-weight: normal"><a class="western" href="#__RefHeading___Toc35934310"> </a></span></span></font></font><a class="western" href="#__RefHeading___Toc35934310"><b><span style="letter-spacing: 0.4pt">Status</span><span lang="en-US"> 39</span></b></a></font></p>
<p style="margin-left: 0.17in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934311">9.1.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>Utilities<span lang="en-US"> 39</span></a></p>
<p style="margin-left: 0.17in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934312">9.2.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>Bugs<span lang="en-US"> 39</span></a></p>
<p style="margin-left: 0.17in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934313">9.3.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>Untested<span lang="en-US"> 39</span></a></p>
<p lang="da-DK" align="center" style="margin-left: 0.17in; margin-bottom: 0in">
<font size="4" style="font-size: 15pt"><b><a class="western" href="#__RefHeading___Toc35934314"><span style="letter-spacing: 0.4pt">10.</span></a></b><font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"><span style="font-weight: normal"><a class="western" href="#__RefHeading___Toc35934314"> </a></span></span></font></font><a class="western" href="#__RefHeading___Toc35934314"><b><span style="letter-spacing: 0.4pt">Threading</span><span lang="en-US"> 40</span></b></a></font></p>
<p lang="da-DK" align="center" style="margin-left: 0.17in; margin-bottom: 0in">
<font size="4" style="font-size: 15pt"><b><a class="western" href="#__RefHeading___Toc35934315"><span style="letter-spacing: 0.4pt">11.</span></a></b><font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"><span style="font-weight: normal"><a class="western" href="#__RefHeading___Toc35934315"> </a></span></span></font></font><a class="western" href="#__RefHeading___Toc35934315"><b><span style="letter-spacing: 0.4pt">Troubleshooting</span><span lang="en-US"> 41</span></b></a></font></p>
<p style="margin-left: 0.17in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934316">11.1.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>Environment
Variables<span lang="en-US"> 41</span></a></p>
<p style="margin-left: 0.17in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934317">11.2.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>Command
line utilities fail on Windows 10<span lang="en-US"> 41</span></a></p>
<p style="margin-left: 0.17in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934318">11.3.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>OpenSSL
Linking on Windows<span lang="en-US"> 41</span></a></p>
<p style="margin-left: 0.17in; margin-bottom: 0in"><a class="western" href="#__RefHeading___Toc35934319">11.4.<font face="Calibri, sans-serif"><font size="2" style="font-size: 11pt"><span lang="en-US"> </span></font></font>Loaded
objects (keys) disappear<span lang="en-US"> 41</span></a></p>
</div>
<p class="western" style="margin-bottom: 0in"><a name="_Ref166921735"></a>
<br/>
</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<ol>
<li/>
<h1 class="western" align="justify" style="margin-top: 0.25in; margin-bottom: 0.17in; letter-spacing: 0.4pt; page-break-before: always"><a name="__RefHeading___Toc35934217"></a>
<font size="2" style="font-size: 11pt">Introduction</font></h1>
</ol>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">The IBM TSS is designed
for:</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<ul>
<li/>
<p class="western" style="margin-bottom: 0in">ease of
understanding</p>
<li/>
<p class="western" style="margin-bottom: 0in">ease of use</p>
<li/>
<p class="western" style="margin-bottom: 0in">ease of
implementation</p>
<li/>
<p class="western" style="margin-bottom: 0in">maximum code
reuse</p>
</ul>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">The package is
upstreamed to</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<ul>
<li/>
<p class="western" style="margin-bottom: 0in">Fedora</p>
<li/>
<p class="western" style="margin-bottom: 0in">Debian</p>
<li/>
<p class="western" style="margin-bottom: 0in">RHEL 7.4 and up</p>
<li/>
<p class="western" style="margin-bottom: 0in">SLES 12 SP3 and
up</p>
<li/>
<p class="western" style="margin-bottom: 0in">Ubuntu 17.10 and
up</p>
</ul>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<ol start="2">
<li/>
<h1 class="western" align="justify" style="margin-top: 0.25in; margin-bottom: 0.17in; letter-spacing: 0.4pt; page-break-before: always"><a name="__RefHeading___Toc35934218"></a>
<font size="2" style="font-size: 11pt">Features</font></h1>
</ol>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">The TSS handles the
following, completely hidden from the caller:</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<ul>
<li/>
<p class="western" style="margin-bottom: 0in">HMAC, password
and policy sessions</p>
<li/>
<p class="western" style="margin-bottom: 0in">Session and HMAC
key calculations, including bind and salt sessions</p>
<li/>
<p class="western" style="margin-bottom: 0in">HMAC generation
and verification (including cpHash and rpHash)</p>
<li/>
<p class="western" style="margin-bottom: 0in">Parameter
encryption and decryption, XOR and AES</p>
<li/>
<p class="western" style="margin-bottom: 0in">Nonces and nonce
rolling</p>
<li/>
<p class="western" style="margin-bottom: 0in">Session continue
flag</p>
<li/>
<p class="western" style="margin-bottom: 0in">TPM 2.0 "Name"
and bind session tracking</p>
<li/>
<p class="western" style="margin-bottom: 0in">Different
session hash algorithms</p>
<li/>
<p class="western" style="margin-bottom: 0in">Marshaling,
unmarshaling, and communication with the TPM
</p>
</ul>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">and almost hidden from
the caller:</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<ul>
<li/>
<p class="western" style="margin-bottom: 0in">bind password</p>
</ul>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<ol start="3">
<li/>
<h1 class="western" align="justify" style="margin-top: 0.25in; margin-bottom: 0.17in; letter-spacing: 0.4pt; page-break-before: always"><a name="__RefHeading___Toc35934219"></a><a name="_Ref511735765"></a><a name="_Ref511735763"></a>
<font size="2" style="font-size: 11pt">API</font></h1>
</ol>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">The API consists of the
following calls:</p>
<ol>
<ol>
<li/>
<h2 class="western"><a name="__RefHeading___Toc35934220"></a>TSS_Execute()</h2>
</ol>
</ol>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">#include <ibmtss/tss.h></p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">TPM_RC
TSS_Execute(TSS_CONTEXT *tssContext,</p>
<p class="western" style="margin-left: 0.5in; margin-bottom: 0in">
RESPONSE_PARAMETERS *out,</p>
<p class="western" style="margin-bottom: 0in"> COMMAND_PARAMETERS
*in,</p>
<p class="western" style="margin-bottom: 0in"> EXTRA_PARAMETERS
*extra,</p>
<p class="western" style="margin-bottom: 0in"> TPM_CC
commandCode,</p>
<p class="western" style="margin-bottom: 0in"> ...);</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">This is the primary TSS
function.</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">tssContext: Opaque
object</p>
<p class="western" style="margin-bottom: 0in">out: The standard TPM2
Part 3 response parameter</p>
<p class="western" style="margin-bottom: 0in">in: The standard TPM2
Part 3 command parameter</p>
<p class="western" style="margin-bottom: 0in">extra: Some commands
(only two so far) require extra parameter s.</p>
<p class="western" style="margin-bottom: 0in">commandCode: The
standard TPM2 Part 2 command code.</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">. . . : A list of
session 3-tuples , of the form</p>
<p class="western" style="margin-bottom: 0in"> TPMI_SH_AUTH_SESSION
sessionHandle,</p>
<p class="western" style="margin-bottom: 0in"> const char
*password,</p>
<p class="western" style="margin-bottom: 0in"> unsigned int
sessionAttributes</p>
<p class="western" style="margin-bottom: 0in"> The list is terminated
with (TPM_RH_NULL, NULL, 0)</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<ol>
<ol start="2">
<li/>
<h2 class="western"><a name="__RefHeading___Toc35934221"></a><a name="_Ref437348825"></a>
TSS_Create()</h2>
</ol>
</ol>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">#include <ibmtss/tss.h></p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">TPM_RC
TSS_Create(TSS_CONTEXT **tssContext);</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">This creates the
TSS_CONTEXT used in the TSS_Execute() function. It is initialized
with the default configuration, which can be then changed using 3.4.3
TSS_SetProperty().</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">Returns an error if the
context cannot be allocated, or if the properties cannot be
initialized, typically due to an invalid environment variable.</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">See 3.3 TSS_Delete().</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">It does not immediately
open a connection, so that the connection properties can be changed
from the default first.
</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<ol>
<ol start="3">
<li/>
<h2 class="western"><a name="__RefHeading___Toc35934222"></a><a name="_Ref437348811"></a>
TSS_Delete()</h2>
</ol>
</ol>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">#include <ibmtss/tss.h></p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">TPM_RC TSS_Delete(TSS_CONTEXT
*tssContext);</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">The deletes the opaque
context created using 3.2 TSS_Create().
</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">It closes an open
connection.</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">Returns an error if the
connection close fails.</p>
<p class="western" style="margin-bottom: 0in; page-break-before: always">
<br/>
</p>
<ol>
<ol start="4">
<li/>
<h2 class="western"><a name="__RefHeading___Toc35934223"></a><a name="_Ref532809555"></a><a name="_Ref532809551"></a>
Optional Customization</h2>
</ol>
</ol>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">The TSS is designed to
work by default with no configuration.
</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-left: 0.25in; margin-bottom: 0in">The
current default connects to the Microsoft format socket simulation.
This will eventually change to connect to the resource manager.</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">There are three ways to
customize the configuration:</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<ol>
<li/>
<p class="western" style="margin-bottom: 0in">At compile time,
with a compiler flag</p>
<li/>
<p class="western" style="margin-bottom: 0in">At program
start, using an environment variable</p>
<li/>
<p class="western" style="margin-bottom: 0in">During run time,
using the 3.4.3 TSS_SetProperty() function.</p>
</ol>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">The environment
variables and TSS_SetProperty property use the same names. The
makefile flag uses the name with _DEFAULT appended.</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">The environment
variable overrides the compiler flag, and the TSS_SetProperty()
function overrides both the compiler flag and the environment
variable.</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<ol>
<ol>
<ol>
<li/>
<h3 class="western"><a name="__RefHeading___Toc35934224"></a>
Property Example</h3>
</ol>
</ol>
</ol>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">To change the default
TPM interface to the TPM device driver:</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<ul>
<li/>
<p class="western" style="margin-bottom: 0in">With a makefile:</p>
</ul>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">-DTPM_INTERFACE_TYPE_DEFAULT="\"dev\""</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<ul>
<li/>
<p class="western" style="margin-bottom: 0in">With an
environment variable:</p>
</ul>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">> setenv
TPM_INTERFACE_TYPE dev</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<ul>
<li/>
<p class="western" style="margin-bottom: 0in">With the TSS_SetProperty()
function:</p>
</ul>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">rc =
TSS_SetProperty(tssContext, TPM_INTERFACE_TYPE, "dev");</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<ol>
<ol>
<ol start="2">
<li/>
<h3 class="western"><a name="__RefHeading___Toc35934225"></a><a name="_Ref469903681"></a><a name="_Ref469903677"></a>
Properties</h3>
</ol>
</ol>
</ol>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">(Remember that the
makefile compiler flag requires _DEFAULT to be added, and that the
quotes must be escaped.).</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">The property and legal
values are:</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<h4 class="western"><a name="_Ref473273918"></a>TPM_TRACE_LEVEL</h4>
<p class="western" style="margin-bottom: 0in"> default - 0</p>
<p class="western" style="margin-bottom: 0in"> 0 - no tracing</p>
<p class="western" style="margin-bottom: 0in"> 1 - trace errors</p>
<p class="western" style="margin-bottom: 0in"> 2 - trace errors and
execution flow</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<h4 class="western">TPM_DATA_DIR</h4>
<p class="western" style="margin-bottom: 0in"> default - current
directory</p>
<p class="western" style="margin-bottom: 0in"> set the directory
where the TSS can store persistent data</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<h4 class="western"><a name="_Ref473274005"></a>TPM_INTERFACE_TYPE</h4>
<p class="western" style="margin-bottom: 0in"> default - socsim
</p>
<p class="western" style="margin-bottom: 0in"> socsim - the socket
simulator</p>
<p class="western" style="margin-left: 1in; margin-bottom: 0in">see
</p>
<p class="western" style="margin-left: 1in; text-indent: 0.5in; margin-bottom: 0in">
TPM_SERVER_NAME</p>
<p class="western" style="margin-left: 1in; text-indent: 0.5in; margin-bottom: 0in">
TPM_SERVER_TYPE</p>
<p class="western" style="margin-left: 1in; text-indent: 0.5in; margin-bottom: 0in">
TPM_COMMAND_PORT</p>
<p class="western" style="margin-left: 1in; text-indent: 0.5in; margin-bottom: 0in">
TPM_PLATFORM_PORT</p>
<p class="western" style="margin-bottom: 0in"> dev - TPM device
driver
</p>
<p class="western" style="margin-left: 0.5in; text-indent: 0.5in; margin-bottom: 0in">
see
</p>
<p class="western" style="margin-left: 1in; text-indent: 0.5in; margin-bottom: 0in">
TPM_DEVICE</p>
<h4 class="western"><a name="_Ref473273410"></a>TPM_SERVER_NAME</h4>
<p class="western" style="margin-bottom: 0in"> default - localhost</p>
<p class="western" style="margin-bottom: 0in"> set the socket server
name (full host name or dotted decimal)</p>
<h4 class="western"><a name="_Ref473273447"></a>TPM_SERVER_TYPE</h4>
<p class="western" style="margin-bottom: 0in"> Used with
TPM_INTERFACE_TYPE = socsim</p>
<p class="western" style="margin-bottom: 0in"> default - mssim</p>
<p class="western" style="margin-bottom: 0in"> mssim - send packets
in the Microsoft simulator format (header and footer)</p>
<p class="western" style="margin-bottom: 0in"> raw - send packets in
the raw TPM 2.0 specification Part 3 format</p>
<p class="western" style="margin-bottom: 0in"> rawsingle - same as
raw but opens and closes the connection for each command</p>
<p class="western" style="margin-bottom: 0in"> (useful with the IBM
SW TPM 1.2 simulator)</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<h4 class="western"><a name="_Ref473273450"></a>TPM_COMMAND_PORT</h4>
<p class="western" style="margin-bottom: 0in"> default - 2321</p>
<p class="western" style="margin-bottom: 0in"> set the socket port
for TPM commands</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<h4 class="western"><a name="_Ref473273453"></a>TPM_PLATFORM_PORT</h4>
<p class="western" style="margin-bottom: 0in"> default - 2322</p>
<p class="western" style="margin-bottom: 0in"> set the socket port
for TPM simulator platform commands</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<h4 class="western"><a name="_Ref473273499"></a>TPM_DEVICE</h4>
<p class="western" style="margin-bottom: 0in"> Unix/Linux default -
/dev/tpm0 (single user)</p>
<p class="western" style="margin-bottom: 0in"> Windows default -
Windows 7,8,10 Tbsi</p>
<p class="western" style="margin-bottom: 0in"> For Unix, sets the TPM
device name</p>
<p class="western" style="margin-bottom: 0in"> /dev/tpmrm0 is the
multi-user kernel resource manager</p>
<p class="western" style="margin-bottom: 0in"> Once the kernel
resource manager is upstreamed, this</p>
<p class="western" style="margin-bottom: 0in"> may become the
default.</p>
<p class="western" style="margin-bottom: 0in"> For Windows, not
currently used, only Tbsi supported</p>
<p class="western" style="margin-bottom: 0in"> </p>
<h4 class="western"><a name="_Ref473274288"></a>TPM_ENCRYPT_SESSIONS</h4>
<p class="western" style="margin-bottom: 0in"> default 1</p>
<p class="western" style="margin-bottom: 0in"> 1 - Session state is
saved encrypted</p>
<p class="western" style="margin-bottom: 0in"> 0 - Session state is
saved in plaintext</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">Since session state can
potentially hold secrets, it should normally be encrypted. When the
process terminates, the ephemeral encryption key is lost.</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">See 4.9 Command Line Utilities
for the special case of using the command line utilities. That
section is not applicable when using the TSS library in programs.</p>
<p class="western" style="margin-bottom: 0in; page-break-before: always">
<br/>
</p>
<ol>
<ol>
<ol start="3">
<li/>
<h3 class="western"><a name="__RefHeading___Toc35934226"></a><a name="_Ref418692484"></a>
TSS_SetProperty()</h3>
</ol>
</ol>
</ol>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">#include <ibmtss/tss.h></p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">TPM_RC
TSS_SetProperty(TSS_CONTEXT *tssContext,</p>
<p class="western" style="margin-left: 1.5in; text-indent: 0.5in; margin-bottom: 0in">
int property,</p>
<p class="western" style="margin-left: 1.5in; text-indent: 0.5in; margin-bottom: 0in">
const char *value);</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">The TSS_SetProperty()
function overrides the defaults and environment variables
programmatically.
</p>
<p class="western" style="margin-bottom: 0in"> </p>
<p class="western" style="margin-bottom: 0in">If the property is
related to the connection, an open connection is closed before the
property is processed.</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-left: 0.5in; margin-bottom: 0in">NOTE:
The close occurs even if the new value is the same as the old value.
This can be used to close a connection without deleting the context.</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-left: 0.5in; margin-bottom: 0in">Question:
Is it good to mandate this behavior? It offers functionality and
makes the implementation easier, but perhaps it's too clever?</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">NOTE: The value
parameter is always a string. For simplicity, the 'value' pointer is
stored. The input should be a constant string.</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">NOTE: For the property
TPM_TRACE_LEVEL, tssContext is ignored. The trace level is per
process, not per context.</p>
<p class="western" style="margin-bottom: 0in; page-break-before: always">
<br/>
</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<ol>
<ol start="5">
<li/>
<h2 class="western"><a name="__RefHeading___Toc35934227"></a>Extra
Parameter</h2>
</ol>
</ol>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">The extra parameter is
a catch-all for any parameters that TSS_Execute() requires beyond the
normal TPM command and response parameters.</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">TPM2_StartAuthSession
needs the bind password so that it can calculate the session key.
</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<ol>
<ol start="6">
<li/>
<h2 class="western"><a name="__RefHeading___Toc35934228"></a>Other
APIs and Headers</h2>
</ol>
</ol>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">Headers are in the
…/utils/ibmtss directory.
</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">#include <ibmtss/tss.h></p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">The utility / demo
applications cheat a bit, in that they call into TSS utility
functions. These are less likely to be stable than the official API
above.</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<ul>
<li/>
<p class="western" style="margin-bottom: 0in">tss.h: The
official API</p>
</ul>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<ul>
<li/>
<p class="western" style="margin-bottom: 0in">tsserror.h:
Included by tss.h for convenience. Error codes may be added.</p>
</ul>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<ul>
<li/>
<p class="western" style="margin-bottom: 0in">tssmarshal.h:
Marshal structures to arrays. These are likely to be stable. They
are similar to the TPM side functions but return errors.</p>
</ul>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<ul>
<li/>
<p class="western" style="margin-bottom: 0in">Unmarshal_fp.h:
Unmarshal arrays to structures.
</p>
</ul>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-left: 0.5in; margin-bottom: 0in">The
functions without the TSS_ prefix are deprecated. They were borrowed
from the TPM side but used a signed value for the size. The
functions prefixed TSS_ use an unsigned value for the size.</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<ul>
<li/>
<p class="western" style="margin-bottom: 0in">tssresponsecode.h:
Response code to text. Useful for debugging. The API should be
stable, but the actual output may change.</p>
</ul>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<ul>
<li/>
<p class="western" style="margin-bottom: 0in">tssprint.h:
Functions to print structures. Useful for debugging. The API
should be stable. Functions may be added, and the output is likely
to change.</p>
</ul>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<ul>
<li/>
<p class="western" style="margin-bottom: 0in">tssprintcmd.h:
Functions to print command parameters. Used in TSS verbose tracing.
The API should be stable, but the actual output may change.</p>
</ul>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<ul>
<li/>
<p class="western" style="margin-bottom: 0in">tssutils.h:
Demo helper functions. These are useful for rapid prototyping but
are not recommended for production code.</p>
</ul>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<ul>
<li/>
<p class="western" style="margin-bottom: 0in">tssfile.h: Demo
helper functions. These are useful for rapid prototyping but are
not recommended for production code.</p>
</ul>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<ul>
<li/>
<p class="western" style="margin-bottom: 0in">tsscrypto.h:
Sample crypto code. These are useful for rapid prototyping but are
not recommended for production code.</p>
</ul>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<ul>
<li/>
<p class="western" style="margin-bottom: 0in">Any of the lower
layer TSS functions are for TSS internal use. They should not be
called.</p>
</ul>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<ol start="4">
<li/>
<h1 class="western" align="justify" style="margin-top: 0.25in; margin-bottom: 0.17in; page-break-before: always"><a name="__RefHeading___Toc35934229"></a>
<font size="2" style="font-size: 11pt"><span style="letter-spacing: 0.4pt">Application
Notes</span></font></h1>
</ol>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">Several areas have
non-obvious usage. They are described here.</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<ol>
<ol>
<li/>
<h2 class="western"><a name="__RefHeading___Toc35934230"></a>TPM
Simulator</h2>
</ol>
</ol>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">A typical cause of a
hang when sending the first command to the TPM simulator is that it
has not received a simulated "powered up." The IBM TPM
simulator does not require this, but others may. Send this command:</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">> powerup</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">The platform firmware
initializes a hardware TPM. The TPM simulator requires this command:</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<p class="western" style="margin-bottom: 0in">> startup</p>
<p class="western" style="margin-bottom: 0in"><br/>
</p>
<ol>