-
Notifications
You must be signed in to change notification settings - Fork 1
/
draft-perrin-tls-tack-01.html
1275 lines (1038 loc) · 54 KB
/
draft-perrin-tls-tack-01.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.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en"><head><title>Trust Assertions for Certificate Keys</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="description" content="Trust Assertions for Certificate Keys">
<meta name="generator" content="xml2rfc v1.36 (http://xml.resource.org/)">
<style type='text/css'><!--
body {
font-family: verdana, charcoal, helvetica, arial, sans-serif;
font-size: small; color: #000; background-color: #FFF;
margin: 2em;
}
h1, h2, h3, h4, h5, h6 {
font-family: helvetica, monaco, "MS Sans Serif", arial, sans-serif;
font-weight: bold; font-style: normal;
}
h1 { color: #900; background-color: transparent; text-align: right; }
h3 { color: #333; background-color: transparent; }
td.RFCbug {
font-size: x-small; text-decoration: none;
width: 30px; height: 30px; padding-top: 2px;
text-align: justify; vertical-align: middle;
background-color: #000;
}
td.RFCbug span.RFC {
font-family: monaco, charcoal, geneva, "MS Sans Serif", helvetica, verdana, sans-serif;
font-weight: bold; color: #666;
}
td.RFCbug span.hotText {
font-family: charcoal, monaco, geneva, "MS Sans Serif", helvetica, verdana, sans-serif;
font-weight: normal; text-align: center; color: #FFF;
}
table.TOCbug { width: 30px; height: 15px; }
td.TOCbug {
text-align: center; width: 30px; height: 15px;
color: #FFF; background-color: #900;
}
td.TOCbug a {
font-family: monaco, charcoal, geneva, "MS Sans Serif", helvetica, sans-serif;
font-weight: bold; font-size: x-small; text-decoration: none;
color: #FFF; background-color: transparent;
}
td.header {
font-family: arial, helvetica, sans-serif; font-size: x-small;
vertical-align: top; width: 33%;
color: #FFF; background-color: #666;
}
td.author { font-weight: bold; font-size: x-small; margin-left: 4em; }
td.author-text { font-size: x-small; }
/* info code from SantaKlauss at http://www.madaboutstyle.com/tooltip2.html */
a.info {
/* This is the key. */
position: relative;
z-index: 24;
text-decoration: none;
}
a.info:hover {
z-index: 25;
color: #FFF; background-color: #900;
}
a.info span { display: none; }
a.info:hover span.info {
/* The span will display just on :hover state. */
display: block;
position: absolute;
font-size: smaller;
top: 2em; left: -5em; width: 15em;
padding: 2px; border: 1px solid #333;
color: #900; background-color: #EEE;
text-align: left;
}
a { font-weight: bold; }
a:link { color: #900; background-color: transparent; }
a:visited { color: #633; background-color: transparent; }
a:active { color: #633; background-color: transparent; }
p { margin-left: 2em; margin-right: 2em; }
p.copyright { font-size: x-small; }
p.toc { font-size: small; font-weight: bold; margin-left: 3em; }
table.toc { margin: 0 0 0 3em; padding: 0; border: 0; vertical-align: text-top; }
td.toc { font-size: small; font-weight: bold; vertical-align: text-top; }
ol.text { margin-left: 2em; margin-right: 2em; }
ul.text { margin-left: 2em; margin-right: 2em; }
li { margin-left: 3em; }
/* RFC-2629 <spanx>s and <artwork>s. */
em { font-style: italic; }
strong { font-weight: bold; }
dfn { font-weight: bold; font-style: normal; }
cite { font-weight: normal; font-style: normal; }
tt { color: #036; }
tt, pre, pre dfn, pre em, pre cite, pre span {
font-family: "Courier New", Courier, monospace; font-size: small;
}
pre {
text-align: left; padding: 4px;
color: #000; background-color: #CCC;
}
pre dfn { color: #900; }
pre em { color: #66F; background-color: #FFC; font-weight: normal; }
pre .key { color: #33C; font-weight: bold; }
pre .id { color: #900; }
pre .str { color: #000; background-color: #CFF; }
pre .val { color: #066; }
pre .rep { color: #909; }
pre .oth { color: #000; background-color: #FCF; }
pre .err { background-color: #FCC; }
/* RFC-2629 <texttable>s. */
table.all, table.full, table.headers, table.none {
font-size: small; text-align: center; border-width: 2px;
vertical-align: top; border-collapse: collapse;
}
table.all, table.full { border-style: solid; border-color: black; }
table.headers, table.none { border-style: none; }
th {
font-weight: bold; border-color: black;
border-width: 2px 2px 3px 2px;
}
table.all th, table.full th { border-style: solid; }
table.headers th { border-style: none none solid none; }
table.none th { border-style: none; }
table.all td {
border-style: solid; border-color: #333;
border-width: 1px 2px;
}
table.full td, table.headers td, table.none td { border-style: none; }
hr { height: 1px; }
hr.insert {
width: 80%; border-style: none; border-width: 0;
color: #CCC; background-color: #CCC;
}
--></style>
</head>
<body>
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<table summary="layout" width="66%" border="0" cellpadding="0" cellspacing="0"><tr><td><table summary="layout" width="100%" border="0" cellpadding="2" cellspacing="1">
<tr><td class="header">TLS Working Group</td><td class="header">M. Marlinspike</td></tr>
<tr><td class="header">Internet-Draft</td><td class="header">T. Perrin, Ed.</td></tr>
<tr><td class="header">Intended status: Standards Track</td><td class="header">September 26, 2012</td></tr>
<tr><td class="header">Expires: March 30, 2013</td><td class="header"> </td></tr>
</table></td></tr></table>
<h1><br />Trust Assertions for Certificate Keys<br />draft-perrin-tls-tack-01.txt</h1>
<h3>Abstract</h3>
<p>
This document defines TACK, a TLS Extension that enables a TLS server to
assert the authenticity of its public key. A "tack" contains a "TACK key"
which is used to sign the public key from the TLS server's certificate.
Hostnames can be "pinned" to a TACK key. TLS connections to a pinned
hostname require the server to present a tack containing the pinned key
and a corresponding signature over the TLS server's public key.
</p>
<h3>Status of this Memo</h3>
<p>
This Internet-Draft is submitted in full
conformance with the provisions of BCP 78 and BCP 79.</p>
<p>
Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current
Internet-Drafts is at http://datatracker.ietf.org/drafts/current/.</p>
<p>
Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any time.
It is inappropriate to use Internet-Drafts as reference material or to cite
them other than as “work in progress.”</p>
<p>
This Internet-Draft will expire on March 30, 2013.</p>
<h3>Copyright Notice</h3>
<p>
Copyright (c) 2012 IETF Trust and the persons identified as the
document authors. All rights reserved.</p>
<p>
This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License.</p>
<a name="toc"></a><br /><hr />
<h3>Table of Contents</h3>
<p class="toc">
<a href="#intro">1.</a>
Introduction<br />
<a href="#anchor1">2.</a>
Requirements notation<br />
<a href="#anchor2">3.</a>
Overview<br />
<a href="#anchor3">3.1.</a>
Tack life cycle<br />
<a href="#anchor4">3.2.</a>
Pin life cycle<br />
<a href="#anchor5">4.</a>
TACK Extension<br />
<a href="#anchor6">4.1.</a>
Definition of TackExtension<br />
<a href="#anchor7">4.2.</a>
Explanation of TackExtension fields<br />
<a href="#anchor8">4.2.1.</a>
Tack fields<br />
<a href="#anchor9">4.2.2.</a>
TackExtension fields<br />
<a href="#clientproc">5.</a>
Client processing<br />
<a href="#anchor10">5.1.</a>
TACK pins<br />
<a href="#anchor11">5.2.</a>
High-level client processing<br />
<a href="#details">5.3.</a>
Client processing details<br />
<a href="#wellformed">5.3.1.</a>
Check whether the TLS handshake is well-formed<br />
<a href="#anchor12">5.3.2.</a>
Check tack generations and update min_generations<br />
<a href="#anchor13">5.3.3.</a>
Determine the store's status<br />
<a href="#creating">5.3.4.</a>
Pin activation (optional)<br />
<a href="#anchor14">6.</a>
Application protocols and TACK<br />
<a href="#anchor15">6.1.</a>
Pin scope<br />
<a href="#anchor16">6.2.</a>
TLS negotiation<br />
<a href="#certver">6.3.</a>
Certificate verification<br />
<a href="#anchor17">7.</a>
Fingerprints<br />
<a href="#anchor18">8.</a>
Advice<br />
<a href="#servadvice">8.1.</a>
For server operators<br />
<a href="#anchor19">8.2.</a>
For client implementers<br />
<a href="#security">9.</a>
Security considerations<br />
<a href="#anchor20">9.1.</a>
For server operators<br />
<a href="#security_client">9.2.</a>
For client implementers<br />
<a href="#future">9.3.</a>
Note on algorithm agility<br />
<a href="#anchor21">10.</a>
IANA considerations<br />
<a href="#anchor22">10.1.</a>
New entry for the TLS ExtensionType Registry<br />
<a href="#anchor23">11.</a>
Acknowledgements<br />
<a href="#rfc.references1">12.</a>
Normative references<br />
<a href="#rfc.authors">§</a>
Authors' Addresses<br />
</p>
<br clear="all" />
<a name="intro"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.1"></a><h3>1.
Introduction</h3>
<p>
Traditionally, a TLS client verifies a TLS server's public key using a
certificate chain issued by some public CA. "Pinning" is a way for clients to
obtain increased certainty in server public keys. Clients that employ pinning
check for some constant "pinned" element of the TLS connection when
contacting a particular TLS host.
</p>
<p>
Unfortunately, a number of problems arise when attempting to pin certificate
chains: the TLS servers at a given hostname may have different certificate
chains simultaneously deployed and may change their chains at any time, the
"more constant" elements of a chain (the CAs) may not be trustworthy, and the
client may be oblivious to key compromise events which render the pinned data
untrustworthy.
</p>
<p>
TACK addresses these problems by having the site sign its TLS server public
keys with a "TACK key". This enables clients to "pin" a hostname to the TACK
key without requiring sites to modify their existing certificate chains, and
without limiting a site's flexibility to deploy different certificate chains
on different servers or change certificate chains at any time. Since TACK pins
are based on TACK keys (instead of CA keys), trust in CAs is not required.
Additionally, the TACK key may be used to revoke compromised TLS private keys,
and TACK key rollovers may be performed to recover from suspect or compromised
TACK keys.
</p>
<p>
If requested, a compliant server will send a TLS Extension containing its
"tack". Inside the tack is a public key and signature. Once a client has seen
the same (hostname, TACK public key) pair multiple times, the client will
"activate" a pin between the hostname and TACK key for a period equal to the
length of time the pair has been observed for. This "pin activation" algorithm
limits the impact of bad pins resulting from transient network attacks or
operator error.
</p>
<p>
TACK pins are easily shared between clients. For example, a TACK client may
scan the internet to discover TACK pins, then publish these pins through some
3rd-party trust infrastructure for other clients to rely upon.
</p>
<a name="anchor1"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.2"></a><h3>2.
Requirements notation</h3>
<p>The key words "MUST",
"MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT",
"RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as
described in <a class='info' href='#RFC2119'>[RFC2119]<span> (</span><span class='info'>Bradner, S., “Key words for use in RFCs to Indicate Requirement Levels,” March 1997.</span><span>)</span></a>.
</p>
<a name="anchor2"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.3"></a><h3>3.
Overview</h3>
<a name="anchor3"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.3.1"></a><h3>3.1.
Tack life cycle</h3>
<p>A server operator using TACK may perform several processes:
</p>
<blockquote class="text"><dl>
<dt>Selection of a TACK key:</dt>
<dd>
The server operator first chooses the ECDSA signing key to use for a set of
hostnames. It is safest to use a different signing key for each hostname,
though a signing key may be reused for closely-related hostnames (such as
aliases for the same host, or hosts sharing the same TLS key).
</dd>
<dt>Creating initial tacks under a TACK key:</dt>
<dd>
The TACK private key is then used to sign the TLS public keys for all servers
associated with those hostnames. The TACK public key and signature are
combined with some metadata into each server's "tack".
</dd>
<dt>Deploying initial tacks:</dt>
<dd>
For each hostname, tacks are deployed to TLS servers in a two-stage process.
First, each TLS server associated with the hostname is given a tack. Once this
is completed, the tacks are activated by setting the "activation flag" on each
server.
</dd>
<dt>Creating new tacks under a TACK key:</dt>
<dd>
A tack needs to be replaced whenever a server changes its TLS public key, or
when the tack expires. Tacks may also need to be replaced with
later-generation tacks if the TACK key's "min_generation" is updated (see
next).
</dd>
<dt>Revoking old tacks:</dt>
<dd>
If a TLS private key is compromised, the tacks signing this key can be revoked
by publishing a new tack containing a higher "min_generation".
</dd>
<dt>Deactivating tacks:</dt>
<dd>
If a server operator wishes to stop deploying tacks, all tacks for a hostname
can be deactivated via the activation flag, allowing the server to remove the
tacks within 30 days (at most).
</dd>
<dt>Rollover:</dt>
<dd>
If a server operator wishes to change the TACK key a hostname is pinned to,
the server can publish a new tack alongside the old one. This lets clients
activate pins for the new TACK key prior to the server deactivating the older
pins.
</dd>
</dl></blockquote><p>
</p>
<a name="anchor4"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.3.2"></a><h3>3.2.
Pin life cycle</h3>
<p>
A TACK pin associates a hostname and a TACK key. Pins are grouped into "pin
stores". A client may populate its pin stores by either performing "pin
activation" directly, or by querying some other party. For example, a client
application may have a store for pin activation as well as a store whose
contents are periodically fetched from a server.
</p>
<p>
Whenever a client performing "pin activation" sees a hostname and TACK key
combination not represented in the "pin activation" pin store, an inactive pin
is created. Every subsequent time the client sees the same pin, the pin is
"activated" for a period equal to the timespan between the first time the pin
was seen and the most recent time, up to a maximum period of 30 days.
</p>
<p>
A pin store may contain up to two pins per hostname. This allows for "pin
rollover", where a server securely transitions from one pin to another. If
both pins are simultaneously active, then the server must satisfy both of them
by presenting a pair of tacks.
</p>
<p>In addition to creating and activating pins, a TLS connection can alter
client pin stores by publishing new "min_generation" values in a tack. Each
pin stores the highest "min_generation" value it has seen from the pinned TACK
key, and rejects tacks from earlier generations.
</p>
<a name="anchor5"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4"></a><h3>4.
TACK Extension</h3>
<a name="anchor6"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.1"></a><h3>4.1.
Definition of TackExtension</h3>
<p>
A new TLS ExtensionType ("tack") is defined and MAY be included by a TLS
client in the ClientHello message defined in <a class='info' href='#RFC5246'>[RFC5246]<span> (</span><span class='info'>Dierks, T. and E. Rescorla, “The Transport Layer Security (TLS) Protocol Version 1.2,” August 2008.</span><span>)</span></a>.
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
enum {tack(TBD), (65535)} ExtensionType;
</pre></div>
<p>
The "extension_data" field of this ClientHello extension SHALL be empty. A TLS
server which is not resuming a TLS session MAY respond with an extension of
type "tack" in the ServerHello. The "extension_data" field of this
ServerHello extension SHALL contain a "TackExtension", as defined below using
the TLS presentation language from <a class='info' href='#RFC5246'>[RFC5246]<span> (</span><span class='info'>Dierks, T. and E. Rescorla, “The Transport Layer Security (TLS) Protocol Version 1.2,” August 2008.</span><span>)</span></a>.
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
struct {
opaque public_key[64];
uint8 min_generation;
uint8 generation;
uint32 expiration;
opaque target_hash[32];
opaque signature[64];
} Tack; /* 166 bytes */
struct {
Tack tacks<166...332> /* 1 or 2 Tacks */
uint8 activation_flags; /* 0...3 */
} TackExtension;
</pre></div>
<p>
</p>
<a name="anchor7"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.2"></a><h3>4.2.
Explanation of TackExtension fields</h3>
<a name="anchor8"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.2.1"></a><h3>4.2.1.
Tack fields</h3>
<p>
</p>
<blockquote class="text"><dl>
<dt>public_key:</dt>
<dd>
This field specifies the tack's public key. The field contains a pair of
integers (x, y) representing a point on the elliptic curve P-256 defined in
<a class='info' href='#FIPS186-3'>[FIPS186‑3]<span> (</span><span class='info'>National Institute of Standards and Technology, “Digital Signature Standard,” June 2009.</span><span>)</span></a>. Each integer is encoded as a 32-byte octet string
using the Integer-to-Octet-String algorithm from <a class='info' href='#RFC6090'>[RFC6090]<span> (</span><span class='info'>McGrew, D., Igoe, K., and M. Salter, “Fundamental Elliptic Curve Cryptography Algorithms,” February 2011.</span><span>)</span></a>, and
these strings are concatenated with the x value first. (NOTE: This is
equivalent to an uncompressed subjectPublicKey from <a class='info' href='#RFC5480'>[RFC5480]<span> (</span><span class='info'>Turner, S., Brown, D., Yiu, K., Housley, R., and T. Polk, “Elliptic Curve Cryptography Subject Public Key Information,” March 2009.</span><span>)</span></a>,
except that the initial 0x04 byte is omitted).
</dd>
<dt>min_generation:</dt>
<dd>
This field publishes a min_generation value.
</dd>
<dt>generation:</dt>
<dd>
This field assigns each tack a generation. Generations less than a published
min_generation are considered revoked.
</dd>
<dt>expiration:</dt>
<dd>
This field specifies a time after which the tack is considered expired. The
time is encoded as the number of minutes, excluding leap seconds, after
midnight UTC, January 1 1970.
</dd>
<dt>target_hash:</dt>
<dd>
This field is a hash of the TLS server's SubjectPublicKeyInfo <a class='info' href='#RFC5280'>[RFC5280]<span> (</span><span class='info'>Cooper, D., Santesson, S., Farrell, S., Boeyen, S., Housley, R., and W. Polk, “Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile,” May 2008.</span><span>)</span></a> using the SHA256 algorithm from <a class='info' href='#FIPS180-2'>[FIPS180‑2]<span> (</span><span class='info'>National Institute of Standards and Technology, “Secure Hash Standard,” August 2002.</span><span>)</span></a>.
The SubjectPublicKeyInfo is typically conveyed as part of the server's X.509
certificate.
</dd>
<dt>signature:</dt>
<dd>
This field is an ECDSA signature by the tack's public key over the 8 byte
ASCII string "tack_sig" followed by the contents of the tack prior to the
"signature" field (i.e. the preceding 102 bytes). The field contains a pair of
integers (r, s) representing an ECDSA signature as defined in <a class='info' href='#FIPS186-3'>[FIPS186‑3]<span> (</span><span class='info'>National Institute of Standards and Technology, “Digital Signature Standard,” June 2009.</span><span>)</span></a>, using curve P-256 and SHA256. Each integer is encoded as
a 32-byte octet string using the Integer-to-Octet-String algorithm from <a class='info' href='#RFC6090'>[RFC6090]<span> (</span><span class='info'>McGrew, D., Igoe, K., and M. Salter, “Fundamental Elliptic Curve Cryptography Algorithms,” February 2011.</span><span>)</span></a>, and these strings are concatenated with the r value first.
</dd>
</dl></blockquote><p>
</p>
<a name="anchor9"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.2.2"></a><h3>4.2.2.
TackExtension fields</h3>
<p>
</p>
<blockquote class="text"><dl>
<dt>tacks:</dt>
<dd>
This field provides the server's tack(s). It SHALL contain 1 or 2 tacks.
</dd>
<dt>activation_flags:</dt>
<dd>
This field contains "activation flags" for the extension's tacks. If the low
order bit is set, the first tack is considered active. If the next lowest bit
is set, the second tack is considered active. An active tack MAY be used by
the pin activation algorithm in <a class='info' href='#creating'>Section 5.3.4<span> (</span><span class='info'>Pin activation (optional)</span><span>)</span></a> to create, activate,
and extend the activation of TACK pins.
</dd>
</dl></blockquote><p>
</p>
<a name="clientproc"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.5"></a><h3>5.
Client processing</h3>
<a name="anchor10"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.5.1"></a><h3>5.1.
TACK pins</h3>
<p>
A client SHALL have a local store of pins, and MAY have multiple stores. Each
pin store consists of a map associating fully qualified DNS hostnames with
either one or two sets of the following values:
</p>
<blockquote class="text"><dl>
<dt>Initial time:</dt>
<dd>
A timestamp noting when this pin was created.
</dd>
<dt>End time:</dt>
<dd>
A timestamp determining the pin's "active period". If set to zero or a
time in the past, the pin is "inactive". If set to a future time, the pin is
"active" until that time.
</dd>
<dt>TACK public key (or hash):</dt>
<dd>
A public key or a cryptographically-secure, second preimage-resistant hash of
a public key.
</dd>
<dt>Min_generation:</dt>
<dd>
A single byte used to detect revoked tacks. All pins within a pin store
sharing the same TACK public key SHALL have the same min_generation.
</dd>
</dl></blockquote><p>
</p>
<p>
A hostname along with the above values comprises a "TACK pin". Thus, each
store can hold up to two pins for a hostname (however, those two pins MUST
reference different public keys). A pin "matches" a tack if they reference the
same public key. A pin is "relevant" if its hostname equals the TLS server's
hostname.
</p>
<a name="anchor11"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.5.2"></a><h3>5.2.
High-level client processing</h3>
<p>
A TACK client SHALL send the "tack" extension defined previously, and SHALL
send the "server_name" extension from <a class='info' href='#RFC6066'>[RFC6066]<span> (</span><span class='info'>Eastlake, D., “Transport Layer Security (TLS) Extensions: Extension Definitions,” January 2011.</span><span>)</span></a>. If not
resuming a session, the server MAY respond with a TackExtension. Regardless of
whether a TackExtension is returned, the client SHALL perform the following
steps prior to using the connection:
</p>
<ol class="text">
<li>Check whether the TLS handshake is "well-formed".
</li>
<li>For each pin store, do:
<blockquote class="text"><dl>
<dt>A.</dt>
<dd>Check tack generations and update min_generations.
</dd>
<dt>B.</dt>
<dd>Determine the store's status.
</dd>
<dt>C.</dt>
<dd>Perform pin activation (optional).
</dd>
</dl></blockquote>
</li>
</ol><p>
These steps SHALL be performed in order. If there is any error, the client
SHALL send a fatal error alert and close the connection, skipping the
remaining steps (see <a class='info' href='#details'>Section 5.3<span> (</span><span class='info'>Client processing details</span><span>)</span></a> for details).
</p>
<p>Based on step 2B, each store will report one of three statuses for the
connection: "accepted", "rejected", or "unpinned". A rejected connection might
indicate a network attack. If the connection is rejected the client SHOULD
send a fatal "access_denied" error alert and close the connection.
</p>
<p> A client MAY perform additional verification steps before using an
accepted or unpinned connection. See <a class='info' href='#certver'>Section 6.3<span> (</span><span class='info'>Certificate verification</span><span>)</span></a> for an
example.
</p>
<a name="details"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.5.3"></a><h3>5.3.
Client processing details</h3>
<a name="wellformed"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.5.3.1"></a><h3>5.3.1.
Check whether the TLS handshake is well-formed</h3>
<p>
A TLS handshake is "well-formed" if the following are true. Unless otherwise
specified, if any of the following are false a "bad_certificate" fatal error
alert SHALL be sent.
</p>
<ol class="text">
<li>The handshake protocol negotiates a cryptographically secure ciphersuite
and finishes succesfully.
</li>
<li>If a TackExtension is present then all length fields are correct,
"activation_flags" is <= 3, and the tacks are "well-formed" (see
below).
</li>
<li>If there are two tacks, they have different "public_key" fields.
</li>
</ol><p>
</p>
<p>
A tack is "well-formed" if:
</p>
<ol class="text">
<li>"generation" is >= "min_generation".
</li>
<li>"expiration" specifies a time in the future, otherwise the client SHALL
send a fatal "certificate_expired" error alert.
</li>
<li>"target_hash" is a correct hash of the SubjectPublicKeyInfo.
</li>
<li>"signature" is a correct ECDSA signature.
</li>
</ol><p>
</p>
<a name="anchor12"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.5.3.2"></a><h3>5.3.2.
Check tack generations and update min_generations</h3>
<p>If a tack has matching pins in the pin store and a generation less than the
stored min_generation, then that tack is revoked and the client SHALL send a
fatal "certificate_revoked" error alert. If a tack has matching pins and a
min_generation greater than the stored min_generation, the stored value SHALL
be set to the tack's value.
</p>
<a name="anchor13"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.5.3.3"></a><h3>5.3.3.
Determine the store's status</h3>
<p>
If there is a relevant active pin without a matching tack, then the connection
is "rejected". If the connection is not rejected and there is a relevant
active pin with a matching tack, then the connection is "accepted". Otherwise,
the connection is "unpinned".
</p>
<a name="creating"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.5.3.4"></a><h3>5.3.4.
Pin activation (optional)</h3>
<p>
The TLS connection MAY be used to create, delete, and activate pins. This "pin
activation algorithm" is optional; a client MAY rely on an external source of
pins. If the connection was "rejected" by the previous processing step, then
pin activation is skipped.
</p>
<p>
The first step in pin activation is to evaluate each relevant pin (there may
be one or two): </p>
<ol class="text">
<li>If a pin has no matching tack, its handling will depend on whether the pin
is active. If active, the connection will have been rejected, skipping pin
activation. If inactive, the pin SHALL be deleted, since it is contradicted by
the connection.
</li>
<li>If a pin has a matching tack, its handling will depend on whether the tack
is active. If inactive, the pin is left unchanged. If active, the pin SHALL
have its "end time" set based on the current, initial, and end times:
<div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
end = current + MIN(30 days, current - initial)
</pre></div>
</li>
</ol><p>
</p>
<p> In sum: (1) deletes unmatched pins, provided they are inactive; and (2)
activates matched pins, provided the matching tack is active.
</p>
<p>The remaining step in pin activation is to add new inactive pins for any
unmatched active tacks. Each new pin uses the server's hostname, the tack's
public key and min_generation (unless the store has a higher min_generation
for the public key), an "initial time" set to the current time, and an "end
time" of zero.
</p>
<p> (Note that there are always sufficient empty "slots" in the pin store for
adding new pins without exceeding two pins per hostname. This is because the
number of matching pins equals the number of matching tacks, so the number of
empty pin slots equals the number of unmatched tacks.)
</p>
<p>The following tables summarize this behavior from the perspective of a pin.
You can follow the lifecycle of a single pin from "New inactive pin" to
"Delete pin".
</p>
<p>Relevant pin is active:
</p><table class="full" align="center" border="0" cellpadding="2" cellspacing="2">
<col align="left"><col align="left"><col align="left">
<tr><th align="left">Pin matches a tack</th><th align="left">Tack is active</th><th align="left">Result</th></tr>
<tr>
<td align="left">Yes</td>
<td align="left">Yes</td>
<td align="left">Extend activation period</td>
</tr>
<tr>
<td align="left">Yes</td>
<td align="left">No</td>
<td align="left">-</td>
</tr>
<tr>
<td align="left">No</td>
<td align="left">-</td>
<td align="left">(Connection rejected)</td>
</tr>
</table>
<br clear="all" />
<p>Relevant pin is inactive:
</p><table class="full" align="center" border="0" cellpadding="2" cellspacing="2">
<col align="left"><col align="left"><col align="left">
<tr><th align="left">Pin matches a tack</th><th align="left">Tack is active</th><th align="left">Result</th></tr>
<tr>
<td align="left">Yes</td>
<td align="left">Yes</td>
<td align="left">Activate pin</td>
</tr>
<tr>
<td align="left">Yes</td>
<td align="left">No</td>
<td align="left">-</td>
</tr>
<tr>
<td align="left">No</td>
<td align="left">-</td>
<td align="left">Delete pin</td>
</tr>
</table>
<br clear="all" />
<p>Tack doesn't match any relevant pin:
</p><table class="full" align="center" border="0" cellpadding="2" cellspacing="2">
<col align="left"><col align="left">
<tr><th align="left">Unmatched tack is active</th><th align="left">Result</th></tr>
<tr>
<td align="left">Yes</td>
<td align="left">New inactive pin</td>
</tr>
<tr>
<td align="left">No</td>
<td align="left">-</td>
</tr>
</table>
<br clear="all" />
<a name="anchor14"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.6"></a><h3>6.
Application protocols and TACK</h3>
<a name="anchor15"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.6.1"></a><h3>6.1.
Pin scope</h3>
<p> TACK pins are specific to a particular application protocol. In other
words, a pin for HTTPS at "example.com" implies nothing about POP3 or SMTP at
"example.com".
</p>
<a name="anchor16"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.6.2"></a><h3>6.2.
TLS negotiation</h3>
<p>Some application protocols negotiate TLS as an optional feature (e.g. SMTP
using STARTTLS <a class='info' href='#RFC3207'>[RFC3207]<span> (</span><span class='info'>Hoffman, P., “SMTP Service Extension for Secure SMTP over Transport Layer Security,” February 2002.</span><span>)</span></a>). If such a server fails to negotiate
TLS and there are relevant active pins, then the connection is rejected by the
pin. If the server fails to negotiate TLS, then any relevant, inactive pins
SHALL be deleted. Note that these steps are taken despite the absence of a TLS
connection.
</p>
<a name="certver"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.6.3"></a><h3>6.3.
Certificate verification</h3>
<p>
A TACK client MAY choose to perform some form of certificate verification in
addition to TACK processing. When combining certificate verification and TACK
processing, the TACK processing described in <a class='info' href='#clientproc'>Section 5<span> (</span><span class='info'>Client processing</span><span>)</span></a> SHALL
be followed, with the exception that TACK processing MAY be terminated early
(or skipped) if some fatal certificate error is discovered.
</p>
<p>
If TACK processing and certificate verification both complete without a fatal
error, the client SHALL apply some policy to decide whether to accept the
connection. The policy is up to the client. An example policy would be to
accept the connection only if it passes certificate verification and is not
rejected by a pin.
</p>
<a name="anchor17"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.7"></a><h3>7.
Fingerprints</h3>
<p>
A "key fingerprint" may be used to represent a TACK public key to users in a
form that is easy to compare and transcribe. A key fingerprint consists of the
first 25 characters from the base32 encoding of SHA256(public_key), split into
5 groups of 5 characters separated by periods. Base32 encoding is as specified
in <a class='info' href='#RFC4648'>[RFC4648]<span> (</span><span class='info'>Josefsson, S., “The Base16, Base32, and Base64 Data Encodings,” October 2006.</span><span>)</span></a>, except lowercase is used. Examples:
</p>
<p>
</p>
<blockquote class="text">
<p>g5p5x.ov4vi.dgsjv.wxctt.c5iul
</p>
<p>quxiz.kpldu.uuedc.j5znm.7mqst
</p>
<p>e25zs.cth7k.tscmp.5hxdp.wf47j
</p>
</blockquote><p>
</p>
<a name="anchor18"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.8"></a><h3>8.
Advice</h3>
<a name="servadvice"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.8.1"></a><h3>8.1.
For server operators</h3>
<p>
</p>