documented update
[gnutls.git] / doc / protocol / draft-badra-tls-key-exchange-00.txt
blob76f81488357acfeb35dcf74df8a06557a372b339
1 Internet Engineering Task Force                                M. Badra 
2 INTERNET DRAFT                                             O. Cherkaoui 
3                                                         UQAM University 
4                                                               I. Hajjeh 
5 Expires: 8, February 2004                                A. Serhrouchni 
6                                                             ENST, Paris 
7                                                         August, 10 2004 
8  
9  
10             Pre-Shared-Key key Exchange methods for TLS  
11                <draft-badra-tls-key-exchange-00.txt> 
12     
13     
14 Status of this Memo 
15     
16    By submitting this Internet-Draft, I certify that any applicable 
17    patent or other IPR claims of which I am aware have been disclosed, 
18    or will be disclosed, and any of which I become aware will be 
19    disclosed, in accordance with RFC 3668. 
20     
21    Internet-Drafts are working documents of the Internet Engineering 
22    Task Force (IETF), its areas, and its working groups. Note that 
23    other groups may also distribute working documents as Internet 
24    Drafts. 
25     
26    Internet-Drafts are draft documents valid for a maximum of six 
27    months and may be updated, replaced, or obsoleted by other documents 
28    at any time. It is inappropriate to use Internet-Drafts as reference 
29    material or to cite them other than as "work in progress." 
30     
31    The list of current Internet-Drafts can be accessed at 
32    http://www.ietf.org/ietf/1id-abstracts.txt 
33     
34    The list of Internet-Draft Shadow Directories can be accessed at 
35    http://www.ietf.org/shadow.html. 
36     
37    This Internet-Draft will expire on February 8, 2005. 
38     
39 Copyright Notice 
40     
41    Copyright (C) The Internet Society (2004).  All Rights Reserved. 
42     
43 Abstract 
44     
45    This document specifies new key exchange methods for Transport Layer 
46    Security protocol to support authentication based on pre installed 
47    key and to allow anonymous exchanges, identity protection And 
48    Perfect Forward Secrecy. 
49     
50     
51     
52     
55 Badra, et. al.           Expires February 2005                 [Page 1]
57 INTERNET-DRAFT        PSK key Exchange methods for TLS      August 2004 
59 1. Introduction 
60     
61    Transport Layer Security (TLS) [TLS] is an authentication protocol 
62    that establishes a secure channel, as well as mutual authentication, 
63    protected cipher suite negotiation and key exchange between two 
64    entities. TLS handshake uses certificates and PKI for mutual 
65    authentication and key exchange. In many cases, a TLS public-key-
66    based handshake is unnecessary; especially for closed environments 
67    or for clients pre-configured. This document specifies how to 
68    establish a TLS session using symmetric keys. 
69     
70    Although several Internet Draft authors ([TLSPSK], [TLSSK], 
71    [TSLEXP], etc) propose the pre shared key mechanism, none of them 
72    provides neither anonymous exchanges and identity protection against 
73    eavesdropping nor Perfect Forward Secrecy (PFS). On the other hand,  
74    some approaches like [ISATLS], propose a radical change to the TLS 
75    protocol. Other like [SPTLS], propose Password-based cipher suite 
76    for TLS Handshake scheme. 
77     
78    This document specifies new key exchange methods for TLS for pre 
79    shared key. The advantageous use of the pre shared key regarding the 
80    Public Key Infrastructure (PKI) based certificates is that the pre 
81    shared key reduces the cryptographic operations, the messages load 
82    and the number of round trips. 
83     
84 1.1. Requirements language 
85     
86    The key words "MUST", "SHALL", "SHOULD", and "MAY", in this document 
87    are to be interpreted as described in RFC-2119. 
88     
89 2. Changes to the TLS Handshake protocol 
90     
91    TLS [TLS] defines the client key exchange message that is always 
92    sent by the client. With this message [TLS], the premaster secret is 
93    set, either though direct transmission of the RSA-encrypted secret, 
94    or by the transmission of Diffie-Hellman parameters which will allow 
95    each side to agree upon the same premaster secret. The structure of 
96    this message depends on which key exchange method has been selected. 
97    The actual TLS standard defines two methods using RSA or  
98    Diffie_Hellman algorithms. 
99     
100    The rest of this document describes the changes to the handshake 
101    messages contents when the pre shared key is being used. 
102     
103 2.1. Client Hello 
104     
105    In order to negotiate and to signal to the server that the client 
106    wishes to use a pre_shared_key key exchange method, the client MAY 
107    include an extension of type "psk_key_exchange (9)" in the extended 
108    client hello, such is defined in [TLSEXT]. The "extension_data" 
111 Badra, et. al.           Expires - February 2005               [Page 2]
113 INTERNET-DRAFT        PSK key Exchange methods for TLS      August 2004 
115    field of the psk key exchange extension SHALL contain 
116    "PSKKeyExchangeMethod" where: 
117     
118         struct {  
119           PSKMethod psk_methods_list<0..2^16-1>;  
120         } PSKKeyExchangeMethod;  
121         
122         struct {  
123           MethodType method_type;  
124             Select (method_type) {  
125              case rsa_psk : RSAPSK  
126              case diffie_hellman_psk : DHPSK  
127             } method;  
128         } PSKMethod;  
129         
130         enum { rsa_psk(0), diffie_hellmen_psk(1), (255) } MethodType;  
131         
132    Here, "PSKKeyExchangeMethod" provides a list of PSK key exchange  
133    methods that the client supports.  
134     
135 2.3. Server Key Exchange 
136     
137    The format of ServerKeyExchange is as follow: 
138     
139         struct { 
140             select (KeyExchangeAlgorithm) { 
141              case diffie_hellman: 
142                 ServerDHParams params; 
143                 Signature signed_params; 
144              case rsa: 
145                 ServerRSAParams params; 
146                 Signature signed_params; 
147              case rsa_psk: /*NEW/ 
148                 ServerRSAParamsPSK params; 
149                 Signature signed_params; /*optional/ 
150              case diffie_hellman_psk: /*NEW/ 
151                 ServerDHParamsPSK params; 
152                 Signature signed_params;/*optional/ 
153             }; 
154         } ServerKeyExchange; 
155     
156    rsa_psk and diffie_hellman_psk cases are respectively identical to 
157    rsa and diffie_hellman cases that are definied in [TLS]. 
158     
159    Note that because the pre_shared_key SHOULD protect entities against 
160    man-in-the-middle attack (see section 2.4), the server MAY not sign 
161    its Diffie_Hellman parameters and thus the signed_params field MAY 
162    be omitted. For more information, see security considerations 
163    section. 
164     
167 Badra, et. al.           Expires - February 2005               [Page 3]
169 INTERNET-DRAFT        PSK key Exchange methods for TLS      August 2004 
171 2.2. Client Key Exchange  
172     
173    This document adds two new key exchange methods to the enumerated 
174    KeyExchangeAlgorithm originally defined in [TLS]. 
175     
176         enum { 
177           rsa, diffie_hellman, rsa_psk, diffie_hellman_psk 
178         } KeyExchangeAlgorithm; 
179     
180    Thus, the structure of the client key exchange becomes as follow: 
181     
182         struct { 
183          select (KeyEchangeAlgorithm){ 
184           case rsa: EncryptedPreMasterSecret; 
185           case diffie_hellman: ClientDiffieHellmanPublic; 
186           case rsa_psk: EncryptPreMasterSecretPSK; /*NEW/ 
187           case diffie_hellman_psk: ClientDiffieHellmanPublicPSK; /*NEW/ 
188           } exchange_key; 
189         } ClientKeyExchange; 
190     
191   2.2.1. rsa_psk encrypted premaster secret message 
192     
193    If rsa_psk is being used for key agreement, the client generates a 
194    30-byte random value, concatenates it with the pre shared key 
195    identity, encrypts the result (premaster secret) using the server 
196    public key and sends it in an encrypted premaster secret message. 
197     
198    Structure of the premaster secret: 
199     
200        struct { 
201          ProtocolVersion client_version; 
202          opaque random[30]; 
203          opaque psk_identity<1..2^16-1>; 
204          opaque pad[16-psk_identity.length]; 
205        } PreMasterSecret; 
206     
207        struct { public-key-encrypted PreMasterSecret pre_master_secret; 
208        } EncryptedPreMasterSecretPSK; 
209     
210    For interoperation issues, this document uses the same definition 
211    used in [TLSSRP]. Thus, the psk_identity SHALL be UTF-8 encoded 
212    Unicode, where the psk_identity is the pre shared key identifier. 
213     
214    If the psk_identity is less than 16 bytes in length, the premaster 
215    secret will be padded to obtain 46 bytes. For example, if the 
216    psk_identity length is 13 bytes, then the last three bytes of the 
217    premaster secret will be 0x03 0x03 0x03. This mechanism will allow 
218    the server to extract the psk_identity from the premaster secret. 
219     
220     
223 Badra, et. al.           Expires - February 2005               [Page 4]
225 INTERNET-DRAFT        PSK key Exchange methods for TLS      August 2004 
227   2.2.2. diffie_hellman_psk encrypted premaster secret message  
228     
229    Because the client does not use any certificate, its value Yc needs 
230    to be sent. As a result, the case implicit MAY be omitted. 
231     
232         struct { 
233             select (PublicValueEncoding) { 
234              case implicit: struct { }; 
235              case explicit: opaque dh_Yc<1..2^16-1>; 
236             } dh_public; 
237             opaque psk_identity<1..2^16-1>; 
238         } ClientDiffieHellmanPublicPSK; 
239     
240              dh_Yc 
241                  The client's Diffie-Hellman public value (Yc). 
242     
243              psk_identity 
244                  The pre shared key identifier. 
245     
246    The psk_identity helps the client to indicate which key it wants to 
247    use and the server to retrieve the corresponding pre shared key 
248    value, if exists. When using a Diffie-Hellman based key exchange 
249    method, the psk_identity is sent in the clear. 
250     
251 2.4. Computing the master secret 
252     
253    This document uses the same mechanism defined in [TLS] for keys 
254    computation and calculation, except the master secret key. It 
255    generates the master secret by applying the PRF on the premaster 
256    secret XOR pre_shared_key value instead of the premaster secret: 
257     
258    master_secret = PRF(pre_master_secret XOR pre_shared_key, 
259                        "master_secret", 
260                        ClientHello.random + ServerHello.random)[0..47]; 
261     
262    As a result, if the server uses a static private key and if this key 
263    is compromised, the intruder must have the pre_shared_key to decrypt 
264    old sessions. 
265     
266    On the other hand, if either the client or the server calculates an 
267    incorrect premaster_secret XOR pre_shared_key value, the finished 
268    messages will fail to decrypt properly and the other party will 
269    return a bad_record_mac alert. This MAY happen when the server does 
270    not send its certificate and that a man-in-the-middle intercepts the 
271    session exchanges and sends its public key instead of the server 
272    public key. 
273     
274     
275     
276     
279 Badra, et. al.           Expires - February 2005               [Page 5]
281 INTERNET-DRAFT        PSK key Exchange methods for TLS      August 2004 
283 2.5. Error Alerts 
284     
285    Three new TLS error alerts are defined by this document (This  
286    section is inspired by [TLSSRP]): 
287     
288    a) "unknown_psk_key_exchange" (integer) - this alert MAY be sent by 
289       a server that does not support any PSK key exchange methods sent 
290       by the client.  This alert is always a warning. Upon receiving 
291       this alert, the client MAY send a new hello message on the same 
292       connection using another TLS authentication methods. 
293     
294    b) "unknown_psk_identity" (integer) - this alert MAY be sent by a 
295       server that receives an unknown ticket identity.  This alert is 
296       always fatal. 
297     
298    c) "missing_psk_identity" (integer) - this alert MAY be sent by a 
299       server that would like to select an offered PSK key exchange 
300       method, if the MethodType extension is absent from the client's 
301       hello message.  This alert is always a warning. Upon receiving 
302       this alert, the client MAY send a new hello message on the same 
303       connection, this time including the MethodType extension. 
304     
305 2.6. Handshake 
306     
307    In order to indicate the support of the shared key type, the client 
308    adds the extension "psk_key_exchange (9)" to its extended hello 
309    message. 
310     
311    When the server receives an extended client hello message, it 
312    replies by its hello that contains the following attributes: 
313    Protocol Version, Random, Session ID, Cipher Suite, and Compression 
314    Method. 
315     
316    If the server is able to agree on a key exchange method using the 
317    pre shared key, it will send its server key exchange message that 
318    contains the selected method. In this case, the Certificate message 
319    MAY be omitted from the response. 
320     
321    If the server does not support any PSK key exchange methods sent by 
322    the client, the server MAY abort the handshake with a 
323    unknown_key_exchange alert. 
324     
325    Now the server will send the server hello done message, indicating 
326    that the hello-message phase of the handshake is completed. 
327     
328    The client send its client key exchange message. The content of this 
329    message depends on the method selected between the client hello and 
330    the server key exchange messages. 
331     
332     
333     
334 Badra, et. al.           Expires - February 2005               [Page 6]
336 INTERNET-DRAFT        PSK key Exchange methods for TLS      August 2004 
338    The handshake exchange is given in the following diagram: 
339     
340             ClientHello         --------> 
341             (MethodType)                     ServerHello 
342                                              Certificate* 
343                                              ServerKeyExchange 
344                                 <--------    ServerHelloDone 
345             ClientKeyExchange 
346             ChangeCipherSpec 
347             Finished            --------> 
348                                              ChangeCipherSpec 
349                                 <--------    Finished 
350     
351       * Indicates an optional message which is not always sent. 
352     
353 3. Security considerations 
354     
355    The server MUST stock the shared key in a secure and protected 
356    manner in order to prevent attackers from retrieving its value. 
357     
358    During the handshake phase, the server MAY send its certificate. The 
359    certificate's use protects entities against man-in-the-middle 
360    attack. 
361     
362    If the server certificate is omitted, the client and the server 
363    authenticate each other via the finished messages. In fact, the 
364    finished value is computed using the master_secret calculated during 
365    the establishment session and the pre shared key. Thus, if the 
366    client is intercepted by a bogus server, this later will be 
367    detectable by the client during the finished phase. As a result, no 
368    third party can calculate the same finished value without having the 
369    correct pre_shared_key. Instead, the third party MAY discover the 
370    pre shared key identity sent in the client key exchange message. 
371     
372    When using a Diffie-Hellman based PSK key exchange method, the 
373    client sends its psk_identity in the clear. In order to avoid this 
374    issue, the client could first open a conventional anonymous and then 
375    renegotiate a PSK key exchange method with the handshake protected 
376    by the first connection. Another solution MAY be done using the 
377    pseudonym management. 
378     
379 3.1. Key management with non-human support 
380     
381    In the case where the client does not enter his credentials manually 
382    during the session establishment and that he does not need to 
383    remember them, then he can stock them on a secure token (e.g. 
384    smartcard) or in a local file. In this case, the server and the 
385    client MAY update the pre shared key value after each session has 
386    been formed. In this case, the both MAY add a seed to their 
387    credentials entries. By this method, the client's support and the 
390 Badra, et. al.           Expires - February 2005               [Page 7]
392 INTERNET-DRAFT        PSK key Exchange methods for TLS      August 2004 
394    server calculate the seed and update the pre shared key as following 
395    (in the session i): 
396     
397        seed(0) is a random on 16 bytes. 
398     
399        seed(i) = P_MD5(seed(i-1) XOR psk_identity, 
400                        "seed" +  
401                        ClientHello.random + ServerHello.random)[0..16]; 
402     
403        psk(i) = PRF(psk(i-1) XOR premaster secret(i), "pre shared key", 
404                     ServerHello.random + ClientHello.random)[0..48]; 
405     
406    With this mechanism, the psk_identity remains unchanged. However, 
407    when the client connect to the server, it sends the seed (seed(i-1) 
408    for session i) instead of the psk_identity. The rest of the protocol 
409    is unchangeable. This SHALL ensure, among other, PFS and anonymity. 
410     
411 4. IANA Considerations 
412     
413    To be specified. 
414     
415 5. Acknowledgment  
416     
417    This document has been inspired by [TLS], [TLSSRP] and [TLSPSK]. 
418    Thus, it reused extracts of these documents. 
419     
420 6. References 
421     
422 6.1. Normative References 
423     
424    [TLSEXT]  Blake-Wilson, S., Nystrom, M., Hopwwod, D., Mikkelsen, J. 
425              and Wright, T., "Transport Layer Security (TLS) 
426              Extensions", RFC 3546, June 2003. 
427     
428    [TLS]     Dierks, T., and Allen, C., "The TLS Protocol Version 1.0", 
429              RFC 2246, November 1998. 
430     
431    [ISATLS]  Hajjeh, I., and Serhrouchni, A., "ISAKMP Handshake for 
432              SSL/TLS", IEEE GLOBECOM'03, Vol. 3, San Francisco, USA, 
433              1-5 December 2003, Pages: 1481-1485. 
434     
435    [SPTLS]   Steiner, Michael, et. al., "Secure Password-Based Cipher 
436              Suite for TLS", ACM Transaction on Information and System 
437              Security, Vol. 4, No. 2, May 2001, Pages 134-157. 
438     
439 6.2.  Informative References 
440     
441    [TLSSRP]  Taylor, D., Wu, T., Mavroyanopoulos, N., and Perrin, 
442              T., "Using SRP for TLS Authentication", 
443              draft-ietf-tls-srp-07.txt, Internet Draft (work in 
444              progress), June 2004. 
445 Badra, et. al.           Expires - February 2005               [Page 8]
447 INTERNET-DRAFT        PSK key Exchange methods for TLS      August 2004 
449    [TLSPSK]  Eronen, P., and Tschofenig, H., "Pre-Shared Key 
450              Ciphersuites for Transport Layer Security (TLS)", 
451              draft-eronen-tls-psk-00.txt, Internet Draft (work in 
452              progress), August 2004. 
453     
454    [TLSSK]   Gutmann, P.,"Use of Shared Keys in the TLS Protocol", 
455              draft-ietf-tls-sharedkeys-02.txt, Internet Draft  
456              (expired), October 2003. 
457     
458    [TSLEXP]  Badra, M., Serhrouchni, A., and Urien, P., "TLS Express", 
459              draft-badra-tls-express-00.txt, Internet Draft (work in 
460              progress), June 2004. 
461     
462 6. Author's Addresses 
463     
464    Mohamad Badra 
465    ENST Telecom 
466    46 rue Barrault 
467    75634 Paris               Phone: NA 
468    France                    Email: Mohamad.Badra@enst.fr 
469     
470    Omar Cherkaoui 
471    UQAM University 
472    Montreal (Quebec)         Phone: NA 
473    Canada                    Email: cherkaoui.omar@uqam.ca 
474     
475    Ibrahim Hajjeh 
476    ENST Telecom 
477    46 rue Barrault 
478    75634 Paris               Phone: NA 
479    France                    Email: Ibrahim.Hajjeh@enst.fr 
480     
481    Ahmed Serhrouchni 
482    ENST Telecom 
483    46 rue Barrault 
484    75634 Paris               Phone: NA 
485    France                    Email: Ahmed.Serhrouchni@enst.fr 
486     
487    Intellectual Property Statement 
488     
489    The IETF takes no position regarding the validity or scope of any 
490    Intellectual Property Rights or other rights that might be claimed 
491    to pertain to the implementation or use of the technology described 
492    in this document or the extent to which any license under such 
493    rights might or might not be available; nor does it represent that 
494    it has made any independent effort to identify any such rights. 
495    Information on the IETF's procedures with respect to rights in IETF 
496    Documents can be found in BCP 78 and BCP 79. 
497     
498    Copies of IPR disclosures made to the IETF Secretariat and any 
499    assurances of licenses to be made available, or the result of an 
500 Badra, et. al.           Expires - February 2005               [Page 9]
502 INTERNET-DRAFT        PSK key Exchange methods for TLS      August 2004 
504    attempt made to obtain a general license or permission for the use 
505    of such proprietary rights by implementers or users of this 
506    specification can be obtained from the IETF on-line IPR repository 
507    at http://www.ietf.org/ipr. 
508     
509    The IETF invites any interested party to bring to its attention any 
510    copyrights, patents or patent applications, or other proprietary 
511    rights that may cover technology that may be required to implement 
512    this standard. Please address the information to the IETF at  
513    ietf-ipr@ietf.org. 
514     
515    Disclaimer of Validity 
516     
517    This document and the information contained herein are provided on 
518    an "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE 
519    REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE 
520    INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR 
521    IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF 
522    THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED 
523    WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 
524     
525    Copyright Statement 
526     
527    Copyright (C) The Internet Society (2004). This document is subject 
528    to the rights, licenses and restrictions contained in BCP 78, and 
529    except as set forth therein, the authors retain all their rights. 
530     
531    Acknowledgment 
532     
533    Funding for the RFC Editor function is currently provided by the 
534    Internet Society. 
556 Badra, et. al.           Expires - February 2005              [Page 10]