4 Internet-Draft D. Taylor
5 Expires: May 2, 2002 Forge Research
9 SM2 -- A Session Management Capable SASL Mechanism
10 draft-naffah-cat-sasl-sm2-02
14 This document is an Internet-Draft and is in full conformance with
15 all provisions of Section 10 of RFC2026.
17 Internet-Drafts are working documents of the Internet Engineering
18 Task Force (IETF), its areas, and its working groups. Note that
19 other groups may also distribute working documents as Internet-
22 Internet-Drafts are draft documents valid for a maximum of six months
23 and may be updated, replaced, or obsoleted by other documents at any
24 time. It is inappropriate to use Internet-Drafts as reference
25 material or to cite them other than as "work in progress."
27 The list of current Internet-Drafts can be accessed at http://
28 www.ietf.org/ietf/1id-abstracts.txt.
30 The list of Internet-Draft Shadow Directories can be accessed at
31 http://www.ietf.org/shadow.html.
33 This Internet-Draft will expire on May 2, 2002.
37 Copyright (C) The Internet Society (2001). All Rights Reserved.
41 This document describes a family of SASL mechanisms capable of re-
42 using cryptographic parameters (SASL Security Context) negotiated in
55 Naffah & Taylor Expires May 2, 2002 [Page 1]
57 Internet-Draft The SM2 SASL Mechanism November 2001
62 1. Mechanism Names . . . . . . . . . . . . . . . . . . . . . . 4
63 2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 5
64 3. Conventions Used in this Document . . . . . . . . . . . . . 6
65 4. Data Element Formats . . . . . . . . . . . . . . . . . . . . 7
66 4.1 Scalar numbers . . . . . . . . . . . . . . . . . . . . . . . 7
67 4.2 Octet sequences . . . . . . . . . . . . . . . . . . . . . . 7
68 4.3 Extended octet sequences . . . . . . . . . . . . . . . . . . 7
69 4.4 Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
70 4.5 Buffers . . . . . . . . . . . . . . . . . . . . . . . . . . 8
71 4.6 Data element size limits . . . . . . . . . . . . . . . . . . 8
72 4.7 Special octets . . . . . . . . . . . . . . . . . . . . . . . 8
73 4.8 Unsigned Integers (UINT) . . . . . . . . . . . . . . . . . . 9
74 5. Protocol Description . . . . . . . . . . . . . . . . . . . . 10
75 5.1 Establishment of a new session . . . . . . . . . . . . . . . 10
76 5.2 Re-use of an existing session . . . . . . . . . . . . . . . 11
77 6. Example . . . . . . . . . . . . . . . . . . . . . . . . . . 13
78 6.1 Example of establishing a new SM2 session . . . . . . . . . 13
79 6.2 Example of an SM2 session re-use . . . . . . . . . . . . . . 15
80 7. Discussion . . . . . . . . . . . . . . . . . . . . . . . . . 16
81 7.1 Extending the Java SASL API . . . . . . . . . . . . . . . . 16
82 7.2 Beyond Java . . . . . . . . . . . . . . . . . . . . . . . . 16
83 7.3 Cache management . . . . . . . . . . . . . . . . . . . . . . 16
84 7.4 DIGEST-MD5 as an underlying mechanism for SM2 . . . . . . . 17
85 8. Security Considerations . . . . . . . . . . . . . . . . . . 18
86 8.1 Caching cryptographic parameters . . . . . . . . . . . . . . 18
87 8.2 Flexibility to use new authentication mechanisms . . . . . . 18
88 8.3 When to invalidate a session . . . . . . . . . . . . . . . . 18
89 8.4 Updating the SASL Security Context from the Evidence . . . . 18
90 9. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . 20
91 References . . . . . . . . . . . . . . . . . . . . . . . . . 21
92 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . 22
93 A. Proposed extension to the Java SASL API . . . . . . . . . . 23
94 A.1 public interface SaslClientExt . . . . . . . . . . . . . . . 23
95 A.1.1 getSaslSecurityContext . . . . . . . . . . . . . . . . . . . 23
96 A.1.2 setSaslSecurityContext . . . . . . . . . . . . . . . . . . . 23
97 A.1.3 evaluateEvidence . . . . . . . . . . . . . . . . . . . . . . 24
98 A.2 public interface SaslServerExt . . . . . . . . . . . . . . . 24
99 A.2.1 getSaslSecurityContext . . . . . . . . . . . . . . . . . . . 24
100 A.2.2 setSaslSecurityContext . . . . . . . . . . . . . . . . . . . 25
101 A.2.3 evaluateEvidence . . . . . . . . . . . . . . . . . . . . . . 25
102 B. Changes since last draft . . . . . . . . . . . . . . . . . . 26
103 Full Copyright Statement . . . . . . . . . . . . . . . . . . 27
111 Naffah & Taylor Expires May 2, 2002 [Page 2]
113 Internet-Draft The SM2 SASL Mechanism November 2001
118 The family of SASL [RFC-2222] mechanisms associated with the protocol
119 described in this document are named "SM2-<SASL mechanism name>"
120 where <SASL mechanism name> is the canonical name of a SASL Mechanism
121 other than SM2. For example, "SM2-SRP" shall denote the SASL
122 mechanism using the protocol described in this document with "SRP" as
123 its underlying SASL mechanism.
125 Note that a server advertising one or more SM2 mechanisms, does not
126 preclude it from also advertising its support for the underlying
127 mechanisms used in conjunction with SM2. This ensures
128 interoperability with clients that only support the underlying
129 mechanisms but do not yet support that mechanism under SM2. In other
130 words, an SM2 mechanism constructed over an existing mechanism, say
131 "SM2-SRP", is not a replacement for "SRP". As such a server wanting,
132 or able, to provide both mechanisms SHOULD advertise them both.
167 Naffah & Taylor Expires May 2, 2002 [Page 3]
169 Internet-Draft The SM2 SASL Mechanism November 2001
174 SM2 is a caching mechanism. It relies on another SASL mechanism,
175 referred to as the underlying mechanism, to perform authentication,
176 and provide security services. The underlying mechanism MUST NOT be
179 Some SASL mechanisms, such as those based on the SRP protocol [SASL-
180 SRP] and the Digest authentication [RFC-2831], provide authentication
181 and the negotiation of a shared session key. The operations involved
182 in the establishement of connections relying on such mechanisms is
183 time-consuming, especially when involving computations of
184 cryptographic primitives and/or shared cryptographic keys. It is
185 desireable to allow both the client and the server, to be able to re-
186 use those cryptographic elements, once negotiated in an initial
187 exchange, without compromising the security of the communication.
189 If two entities are using SM2 with the same underlying mechanism,
190 they can bypass the authentication phase, on their second and
191 subsequent connections, by re-using the security layer parameters
192 negotiated during their initial exchange.
194 A SASL mechanism is described in terms of its (a) authentication
195 layer, and optionally its (b) security layer [RFC-2222]. It is worth
196 noting straight away, that SM2 implies, but does not mandate, that
197 the underlying SASL mechanism provides meaningful security services.
198 In other words, the authors do not see any justification for a
199 session-management based protocol constructed over an underlying
200 mechanism that does not provide a non-trivial security layer.
223 Naffah & Taylor Expires May 2, 2002 [Page 4]
225 Internet-Draft The SM2 SASL Mechanism November 2001
228 3. Conventions Used in this Document
230 1. A hex digit is an element of the set:
232 {0, 1, 2, 3, 4, 5, 6, 7, 8 , 9, A, B, C, D, E, F}
234 A hex digit is the representation of a 4-bit string. Examples:
240 2. An octet is an 8-bit string. In this document an octet may be
241 written as a pair of hex digits. Examples:
247 Depending on the context, one octet may be represented as
248 described above preceded by "0x", for example 0x15 shall
249 represent the 8-bit sequence 00010101.
251 3. All data is encoded and sent in network byte order (big-endian).
253 4. The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
254 NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
255 "OPTIONAL" in this document are to be interpreted as described in
279 Naffah & Taylor Expires May 2, 2002 [Page 5]
281 Internet-Draft The SM2 SASL Mechanism November 2001
284 4. Data Element Formats
286 This section describes the encoding of the data elements used by the
287 SASL mechanisms described in this document.
291 Scalar numbers are unsigned quantities. Using b[i] to refer to the
292 i-th octet being processed, the value of a two-octet scalar is:
294 ((b[0] << 8) + b[1]),
296 where << is the bit left-shift operator. The value of a four-octet
299 ((b[0] << 24) + (b[1] << 16) + (b[2] << 8) + b[3]).
304 These mechanisms generate, use and exchange sequences of octets.
305 When such entities travel on the wire, they shall be preceded by a
306 one-octet scalar quantity representing the count of following octets.
308 We shall use the syntax os(s) to denote the encoded form of the octet
311 4.3 Extended octet sequences
313 Extended sequences of octets are exchanged when using the security
314 layer. When these sequences travel on the wire, they shall be
315 preceded by a four-octet scalar quantity representing the count of
318 We shall use the syntax eos(s) to denote the encoded form of the
319 extended octet sequence.
323 The only character set for text is the UTF-8 encoding [RFC-2279] of
324 Unicode characters [ISO-10646]. All text MUST be in Unicode
325 Normalization Form KC [UNICODE-KC] without NUL characters.
327 We shall use the syntax utf8(L) to denote the string L in UTF-8
328 encoding, preceded by a two-octet scalar quantity representing the
329 count of following octets.
335 Naffah & Taylor Expires May 2, 2002 [Page 6]
337 Internet-Draft The SM2 SASL Mechanism November 2001
342 In these SASL mechanisms data is exchanged between the client and
343 server using buffers. A buffer acts as an envelope for the sequence
344 of data elements sent by one end-point of the exchange, and expected
347 A buffer MAY NOT contain other buffers. It may only contain zero,
348 one or more data elements.
350 A buffer shall be encoded as two fields: a four-octet scalar quantity
351 representing the count of following octets, and the concatenation of
352 the octets of the data element(s) contained in the buffer.
354 We shall use the syntax {A|B|C} to denote a buffer containing A, B
355 and C in that order. For example:
357 { 0x00 | utf8(umn) | eos(umir) }
359 is a buffer containing, in the designated order, a 1-octet scalar
360 quantity, and the encoded forms of a Text (umn) and an Extended Octet
363 4.6 Data element size limits
365 The following table details the size limit, in number of octets, for
366 each of the SASL data element encodings described earlier.
368 Data element type Header Size limit in octets
369 (octets) (excluding header)
370 ------------------------------------------------------------
373 Extended Octet Sequence 4 2,147,483,383
374 Buffer 4 2,147,483,643
376 An implementation MUST signal an exception if any size constraint is
381 In this mechanism certain octet values have special significance.
382 These Octets, and the name that they will be referred to, are listed
385 <NUL> The ASCII code point 0x00. It signals the start of an
386 "establishment of a new session" exchange.
391 Naffah & Taylor Expires May 2, 2002 [Page 7]
393 Internet-Draft The SM2 SASL Mechanism November 2001
396 <SOH> The ASCII code point 0x01. It signals the start of a "re-use
399 <ACK> The ASCII code point 0x06. It signals the server's acceptance
400 of a client's request to re-use an existing session; and finally
402 <NAK> The ASCII code point 0x15. It signals the server's rejection
403 of a client's request to re-use an existing session.
405 When such entities travel on the wire, they shall be encoded as 1-
406 octet Scalar numbers.
408 4.8 Unsigned Integers (UINT)
410 This mechanism uses unsigned integer values ranging from zero to
413 When such entities travel on the wire, they shall be encoded as 4-
414 octet Scalar numbers. We shall use the syntax uint(n) to denote the
415 encoding of an Unsinged Integer n.
447 Naffah & Taylor Expires May 2, 2002 [Page 8]
449 Internet-Draft The SM2 SASL Mechanism November 2001
452 5. Protocol Description
454 The next sections describe the messages exchanged between the SM2
455 client and server, and their interaction with their peers in the
456 underlying mechanism.
458 5.1 Establishment of a new session
460 The establishment of a new SM2 session delegates to the underlying
461 mechanism the authentication function. Any parameters required by
462 the underlying mechanism, MUST be passed into the SM2 mechanism when
463 it is itself initialised.
465 In an SM2 exchange, the client always initiates the exchange.
467 The first SASL buffer sent by an SM2 client contains the Special
468 Octet <NUL> indicating the initiation of the exchange, followed by
469 the initial response, which might be 0-octet long, of the client's
470 underlying mechanism.
472 From this point on, the SM2 mechanism passes the challenges and
473 responses to the underlying mechanism, and passes back the responses
474 and challenges from the underlying mechanism to the peers.
476 When the underlying mechanism exchange has concluded, the SM2 server
477 sends (a) a session identifier and (b) a Time-To-Live (TTL)
478 indication to the SM2 client. The session identifier will be used by
479 the SM2 client if/when it will later re-use this session, while the
480 TTL indicates to the SM2 client, how long, in seconds, the SM2 server
481 will attempt to keep valid this session's parameters for later re-use
482 by the SM2 client. A TTL indicator value of zero means that the
483 session is valid forever.
485 The following diagram shows the data exchanged in this process:
503 Naffah & Taylor Expires May 2, 2002 [Page 9]
505 Internet-Draft The SM2 SASL Mechanism November 2001
508 Figure 1: Establishment of a new session.
510 Underlying Underlying
511 SM2 Mechanism Mechanism SM2
512 Client Client Server Server
515 -- { <NUL> | eos(umir) } ------------------------------->
517 <------------------ challenge --
518 -- response ------------------->
521 <--------------------------- { utf8(sid) | uint(ttl) } --
525 umir the underlying mechanism initial response, if it has one,
527 sid the session identifier as set by the server.
529 ttl the session Time-To-Live indication in seconds.
532 5.2 Re-use of an existing session
534 If two entities have already been through the authentication phase,
535 and have both cached the security layer parameters, a shorter
536 exchange may take place to re-use those parameters.
538 In the exchange below, the Evidence fields (Ec for the client, and Es
539 for the server) are octet strings, possibly 0-octet long, that
540 represent mechanism-specific data. An Evidence may be injected into
541 the underlying mechanism peer's security layer context, to allow
542 computation of a different shared secret for each re-use of the
545 How a new shared secret is computed from a previously known value and
546 an Evidence is an underlying mechanism specific issue.
548 The mechanism data exchange for successfully re-using a session is
559 Naffah & Taylor Expires May 2, 2002 [Page 10]
561 Internet-Draft The SM2 SASL Mechanism November 2001
564 Figure 2: Successful re-use of an existing session.
566 Underlying Underlying
567 SM2 Mechanism Mechanism SM2
568 Client Client Server Server
571 -- { <SOH> | utf8(sid) | os(Ec) } ---------------------->
573 <---------------------------------- { <ACK> | os(Es) } --
577 Ec the client evidence,
579 Es the server evidence.
581 If the server accepts the request for re-using a session, it responds
582 with the Special Octet <ACK> and its version of the Evidence (Es).
584 On the other hand, if the server rejects the request for re-using a
585 session (including the case where an unknown session identifier has
586 been submitted), it responds with the Special Octet <NAK> only. In
587 this case, the SM2 client MUST attempt to establish a new session
588 with the peer, and if this fails it MUST report an authentication
591 This retry facility MUST only be attempted once if re-using a session
594 The data exchange when failing to re-use a session is shown below:
596 Figure 3: Failure re-using an existing session.
599 Underlying Underlying
600 SM2 Mechanism Mechanism SM2
601 Client Client Server Server
604 -- { <SOH> | utf8(sid) | os(Ec) } ---------------------->
606 <------------------------------------------- { <NAK> } --
615 Naffah & Taylor Expires May 2, 2002 [Page 11]
617 Internet-Draft The SM2 SASL Mechanism November 2001
622 The following sections show two examples: one for an establishment of
623 a new SM2 session, and the second one is for a successful re-use of
624 the session already established. The underlying mechanism used with
625 SM2 in both examples is an implementation of the SRP mechanism.
626 Lines starting with "C" denote messages sent from the client side,
627 while those stating with "S" are from the server side.
629 6.1 Example of establishing a new SM2 session
631 C1: 0000000F00000000 0A00000006000474 657374
633 S1: 000001C00100AC6B DB41324A9A9BF166 DE5E1389582FAF72 B6651987EE07FC31
634 92943DB56050A373 29CBB4A099ED8193 E0757767A13DD523 12AB4B03310DCD7F
635 48A9DA04FD50E808 3969EDB767B0CF60 95179A163AB3661A 05FBD5FAAAE82918
636 A9962F0B93B855F9 7993EC975EEAA80D 740ADBF4FF747359 D041D5C33EA71D28
637 1E446B14773BCA97 B43A23FB801676BD 207A436C6481F1D2 B9078717461A5B9D
638 32E688F877485445 23B524B0D57D5EA7 7A2775D2ECFA032C FBDBF52FB3786160
639 279004E57AE6AF87 4E7303CE53299CCC 041C7BC308D82A56 98F3A8D0C38271AE
640 35F8E9DBFBB694B5 C803D89F7AE435DE 236D525F54759B65 E372FCD68EF20FA7
641 111F9E4AFF730001 020A251CA1230431 ABA188CE00AE6D61 6E6461746F72793D
642 7265706C61792064 6574656374696F6E 2C7265706C617920 646574656374696F
643 6E2C696E74656772 6974793D686D6163 2D736861312C696E 746567726974793D
644 686D61632D6D6435 2C636F6E66696465 6E7469616C697479 3D6165732C636F6E
645 666964656E746961 6C6974793D636173 74352C636F6E6669 64656E7469616C69
646 74793D626C6F7766 6973682C6D617862 756666657273697A 653D323134373438
649 C2: 0000015F0100407D 3913C5AAABB611C5 42328A208021C934 53D2FA3F1E3F253B
650 3F46A800A8D973EF 893941AFF6E31590 D8FF8B2A3B702979 B961E0EE1F0E6FC4
651 9B0B133587B27982 C2B66EBBEB9B5F1B 8D33E62FC81393F4 88D2463CAFE0AC74
652 4985117CDA14685A F90F0A0A42751F5D B1C2C24F6D54422D D135864E2F5A346F
653 6C94836F788FDE45 01D5F30228CBB066 832D1A9E010D94B7 F8D2DC8220F7B950
654 87EA7835AD7CFB52 3D6FE2BAF68DE885 57F29BBACFB1C47F 0025A589AC0603FD
655 33BE3FA53B8AE1E9 D77D241EA1458016 B9F57FD7BBA87F9F 80DE53012564A719
656 7ABC0E028C4055BD 825DFEB253A31F48 C7393A9E872140BF 8CE479DD0D975492
657 6E5F0C5DB0860004 7465737400557265 706C617920646574 656374696F6E2C69
658 6E74656772697479 3D686D61632D6D64 352C636F6E666964 656E7469616C6974
659 793D626C6F776669 73682C6D61786275 6666657273697A65 3D32313437343833
662 S2: 000001020100A2AC B28D526F4601C90E DDF740243881C345 7B781D1D325DC95F
663 0CC8B728062D93AE 10693F97A89DB370 3612F89E130251A7 84C87AF5F016A76B
664 BAECC1EFC0DA24F2 5C2FAC77CC5A33C4 5562AAF74DB99237 12BF29F5D9B6D15D
665 94CE4680B04653C2 663B66F237E3567C 7DED5D4728536E96 3AC8DEC185D508AA
666 9F6C993CABE7A037 25BC9B002B72EED7 954F7018194810F2 FFB04F6E239BA11D
667 AC3179431CBB310D D1A87F5A9BB56C0F 80E90237A17E9982 A8EFD122228F684F
671 Naffah & Taylor Expires May 2, 2002 [Page 12]
673 Internet-Draft The SM2 SASL Mechanism November 2001
676 310170A3800F8FC4 DCD94889CE8B6AD7 6CDF0D69DF33A288 98B34AB5EA9575BA
677 4070CF3FE7D339A6 BC0B2D395395EACD A5B041B68104B683 B40B9B167B646095
680 C3: 00000015140020A0 94A727918CC8DC26 92A87C9435D53C7F 70
682 S3: 000000180012534D 322D5349442D3030 3030303030303031 00000000
684 The following is a detailed description of each step:
686 C1: An SM2 Client initiates an establishment of a new session
687 exchange. The SASL buffer contains the <NUL> Octet, followed by
688 the SRP client's initial response encoded as an Extended Octet
689 Sequence. The SRP client's initial response in this example is
690 the Text 'test' representing U --the username.
692 S1: The SM2 server engages in an "establishment of a new session"
693 exchange. It decodes the SRP client's initial response and passes
694 it to its underlying SRP server object. The SRP server evaluates
695 the initial response and sends back a SASL buffer containing:
697 1. The MPI encoding of the public shared modulus N which in this
698 example is 256-octet long.
700 2. The MPI encoding of the field generator g which in this
701 example is 1-octet long (value 0x02),
703 3. The Octet Sequence encoding of the user's salt which in this
704 example is 10-octet long, and finally
706 4. The 174-octet long Text containing the SRP server's available
707 options. In this example, this list consists of the string
708 (white spaces added for clarity): mandatory = replay
709 detection, replay detection, integrity = hmac-sha1, integrity
710 = hmac-md5, confidentiality = aes, confidentiality = cast5,
711 confidentiality = blowfish, maxbuffersize = 2147483643.
713 C2: The SRP client responds to the SRP server challenge by returning
714 a SASL buffer containing:
716 1. The 256-octet long MPI A representing the SRP client's
717 ephemeral public key,
719 2. The 4-octet long Text 'test' representing the authorization ID
720 for this exchange, and finally
722 3. The 85-octet long Text containing the client's chosen options
723 list, which in this example is (white spaces added for
727 Naffah & Taylor Expires May 2, 2002 [Page 13]
729 Internet-Draft The SM2 SASL Mechanism November 2001
732 clarity): replay detection, integrity = hmac-md5,
733 confidentiality = blowfish, maxbuffersize = 2147483643".
735 S2: The SRP server, issues a new challenge containing the 256-octet
736 long MPI B representing the SRP server's ephemeral publick key.
738 C3: The SRP client evaluates the server's challenge and responds with
739 the 20-octet Octet Sequence representing its Evidence: M1.
741 S3: The SM2 server terminates the exchange by sending to the SM2
742 client the session ID generated for this session, followed by the
743 TTL indicator. In this example the session ID is the Text "SM2-
744 SID-0000000001," while the TTL indicator is zero.
747 6.2 Example of an SM2 session re-use
749 C1: 0000001A01001253 4D322D5349442D30 3030303030303030 310465261450
751 S1: 0000000606046526 1450
753 The following is a detailed description of each step:
755 C1: An SM2 Client initiates a session re-use exchange. The SASL
758 1. The <SOH> Special Octet,
760 2. The session ID encoded as a Text. The value of this ID in the
761 example is "SM2-SID-0000000001," and finally
763 3. The Evidence of the underlying SRP client in use with the
764 session in question. In this example this evidence is 4-octet
767 S1: The SM2 server accepts the request to re-use the identified
768 session and sends back the <ACK> Special Octet followed by its
769 version of the Evidence (which in this example is 4-octet long).
783 Naffah & Taylor Expires May 2, 2002 [Page 14]
785 Internet-Draft The SM2 SASL Mechanism November 2001
790 7.1 Extending the Java SASL API
792 The recently approved Java SASL API [JSR-28] contains a new property,
793 javax.security.sasl.Sasl.REUSE, to serve as a hint when instantiating
794 client and servers, for re-using previously authenticated session
797 Appendix A contains a proposed set of interfaces that can be used by
798 Java Security API Providers to offer modular implementations of SM2-
799 capable SASL mechanisms.
801 The two new interfaces in question, SaslClientExt and SaslServerExt
802 extend SaslClient and SaslServer (from the javax.security.sasl
803 package) respectively, and include appropriate methods to handle the
808 The authors intend this mechanism to be useful for implementations of
809 SASL in languages other than Java. However, such implementations
810 MUST have the following capabilities to allow this mechanism to work:
812 1. A mechanism can create another mechanism.
814 2. The SASL Security Context, containing the crpytographic
815 parameters of a mechanism may be extracted in a form that can be
818 3. A mechanism (or a security layer) can be [re-]initialised from a
819 SASL Security Context containing cryptographic parameters stored
825 After a new session is successfully established, the SM2 server sends
826 a session identifier to the client (see Figure 2). It is the
827 responsibility of the client to ensure that it will be able to re-use
828 this value in the future. In other words, the SM2 client should have
829 access to a mapping function that looks up a session identifier to
830 re-use, from data included in a request to instantiate a new
831 underlying mechanism client. If such a session is found, then the
832 SM2 client would only need to 'recreate' the underlying client with
833 the SASL Security Context of that session.
839 Naffah & Taylor Expires May 2, 2002 [Page 15]
841 Internet-Draft The SM2 SASL Mechanism November 2001
844 7.4 DIGEST-MD5 as an underlying mechanism for SM2
846 The proposed SASL mechanism DIGEST-MD5 describes a mechanism for re-
847 use of some data negotiated in a previous exchange (section 2.2
848 "Subsequent Authentication" in [RFC-2831]). More specifically:
850 "If the client has previously authenticated to the server, and
851 remembers the values of username, realm, nonce, nonce-count,
852 cnonce, and qop that it used in that authentication, and the SASL
853 profile for a protocol permits an initial client response, then it
854 MAY perform "subsequent authentication", as defined in this
857 Such a mechanism can be used as an underlying mechanism for SM2. The
858 following notes clarify the previous statement:
860 1. An "Initial Authentication" (section 2.1 of [RFC-2831]) is the
861 exchange used in an SM2 establishment of a new session.
863 2. The SASL Security Context parameters for a DIGEST-MD5
864 implementation SHOULD include: username, realm, nonce, nonce-
865 count, cnonce, and qop (described in section 2.1.2 of [RFC-2831].
867 3. The client's Evidence Ec in an SM2 session re-use exchange, is a
868 full DIGEST-MD5 "digest-response" as described in section 2.2.1
871 4. If the DIGEST-MD5 client's mechanism "digest-response" is valid,
872 and the the DIGEST-MD5 server chose to deem that authentication
873 has succeeded, the SM2 server can successfully conclude a session
876 5. If the DIGEST-MD5 client's mechanism "digest-response" is
877 invalid, or if it is valid but the DIGEST-MD5 server decides to
878 refresh the authentication parameters by sending a new "digest-
879 challenge", then an SM2 failed session re-use message should be
880 sent back to the SM2 client.
895 Naffah & Taylor Expires May 2, 2002 [Page 16]
897 Internet-Draft The SM2 SASL Mechanism November 2001
900 8. Security Considerations
902 8.1 Caching cryptographic parameters
904 SM2 relies on the ability to extract and cache the cryptographic
905 parameters from an underlying mechanism --the SASL Security Context--
906 , and to initialise an instance of the underlying mechanism client
907 and/or server with that cached context. One might argue against this
908 practice for security reasons. Yet, most cryptographic software
909 modules have their parameters somewhere in the program memory, so SM2
910 is as safe as those modules.
912 In addition, if a salt is used (the Evidence or part of it), the
913 actual values used for each exchange will be different. This is a
914 similar concept to caching TLS [RFC-2246] sessions and hence SM2,
915 coupled with a strong underlying mechanism, should be no less secure.
917 8.2 Flexibility to use new authentication mechanisms
919 By using a second authentication mechanism to do the actual
920 authentication function, SM2 can always be configured to use the
921 latest, proven, authentication techniques for which a SASL mechanism
922 has been specified and implemented.
924 8.3 When to invalidate a session
926 The server MUST discard the existing session information when an
927 attempt to re-use the session fails. The server MUST cache the SASL
928 Security Context for a session only when a new one is established and
929 after the authentication function is successfully completed.
931 Bound by the above rule, an SM2 server is thus susceptible to a
932 denial-of-service like attack. Indeed, an attacker may repeatedly
933 attempt to re-use sessions, thus causing the server to invalidate
934 those sessions soon after they were established.
936 But this would be no different to the attacker carrying out her
937 attack on the underlying mechanism server if/when SM2 is not used.
938 The result of such an attack would be that the full underlying
939 authentication procedure would take place.
941 8.4 Updating the SASL Security Context from the Evidence
943 The SM2 mechanism will use the security layer provided by its
944 underlying mechanism.
946 The cryptographic parameters of this security layer, contained in a
947 SASL Security Context, are cached when the authentication phase is
951 Naffah & Taylor Expires May 2, 2002 [Page 17]
953 Internet-Draft The SM2 SASL Mechanism November 2001
956 complete. These parameters may be varied on a per-connection basis
957 by means of the optional Evidence parameter passed in during the
958 session re-use exchange (see Figure 3).
960 What if that Evidence is not enough to update the cryptographic
961 parameters to an acceptable security level; e.g. a weak key is
962 obtained? Two alternatives are possible:
964 1. An implementation may contain a recovery mechanism that would
965 allow it to continue the algorithm until a valid and acceptable
966 value is obtained, or
968 2. An implementation may cause an error condition that would be
969 intercepted by the SM2 peer. If it was the client, then a new
970 session would be negotiated, otherwise if it is the server, then
971 a failed re-use of a session reply would be returned (see Figure
1007 Naffah & Taylor Expires May 2, 2002 [Page 18]
1009 Internet-Draft The SM2 SASL Mechanism November 2001
1014 The following people provided valuable feedback in the preparation of
1017 Keith Burdis <keith@rucus.ru.ac.za>
1063 Naffah & Taylor Expires May 2, 2002 [Page 19]
1065 Internet-Draft The SM2 SASL Mechanism November 2001
1070 [ISO-10646] "International Standard --Information technology--
1071 Universal Multiple-Octet Coded Character Set (UCS) --
1072 Part 1 Architecture and Basic Multilingual Plane. UTF-8
1073 is described in Annex R, adopted but not yet published.
1074 UTF-16 is described in Annex Q, adopted but not yet
1075 published.", ISO/IEC 10646-1, 1993.
1077 [JSR-28] Weltman, R., "Java SASL Specification (Proposed Final
1078 Draft 2)", March 2002, <http://jcp.org/aboutJava/
1079 communityprocess/first/jsr028/index.html>.
1081 [RFC-2119] Bradner, S., "Key words for use in RFCs to Indicate
1082 Requirement Levels", BCP 0014, RFC 2119, March 1997,
1083 <http://www.ietf.org/rfc/rfc2119.txt>.
1085 [RFC-2222] Myers, J., "Simple Authentication and Security Layer
1086 (SASL)", RFC 2222, October 1997, <http://www.ietf.org/
1089 [RFC-2246] Dierks, T. and C. Allen, "The TLS Protocol Version
1090 1.0", RFC 2246, January 1999, <http://www.ietf.org/rfc/
1093 [RFC-2279] Yergeau, F., "UTF-8, a transformation format of Unicode
1094 and ISO 10646", RFC 2279, January 1998, <http://
1095 www.ietf.org/rfc/rfc2279.txt>.
1097 [RFC-2629] Rose, M., "Writing I-Ds and RFCs using XML", RFC 2629,
1098 June 1999, <http://www.ietf.org/rfc/rfc2629.txt>.
1100 [RFC-2831] Leach, P. and C. Newman, "Using Digest Authentication
1101 as a SASL Mechanism", RFC 2831, May 2000, <http://
1102 www.ietf.org/rfc/rfc2831.txt>.
1104 [SASL-SRP] Burdis, K. and R. Naffah, "Secure Remote Password SASL
1105 Mechanism", November 2001, <http://www.ietf.org/
1106 internet-drafts/draft-burdis-cat-srp-sasl-05.txt>.
1108 [UNICODE-KC] Durst, D., "Unicode Standard Annex #15: Unicode
1109 Normalization Forms.", March 2001, <http://
1110 www.unicode.org/unicode/reports/tr15>.
1119 Naffah & Taylor Expires May 2, 2002 [Page 20]
1121 Internet-Draft The SM2 SASL Mechanism November 2001
1127 Forge Research Pty. Limited
1129 Locomotive Workshop,
1130 Australian Technology Park
1135 EMail: raif@forge.com.au
1139 Forge Research Pty. Limited
1141 Locomotive Workshop,
1142 Australian Technology Park
1147 EMail: dtaylor@forge.com.au
1175 Naffah & Taylor Expires May 2, 2002 [Page 21]
1177 Internet-Draft The SM2 SASL Mechanism November 2001
1180 Appendix A. Proposed extension to the Java SASL API
1182 In the next sections, the type AlgorithmParamterSpec is imported from
1183 the java.security.spec package.
1185 A.1 public interface SaslClientExt
1187 An interface that extends the SaslClient interface.
1189 An object implementing this interface can negotiate authentication
1190 using one of the IANA-registered mechanisms, and be used as a client-
1191 side underlying mechanism for the SM2 mechanism.
1193 A.1.1 getSaslSecurityContext
1195 AlgorithmParameterSpec
1196 getSaslSecurityContext()
1197 throws SaslException;
1199 Retrieves an object that encapsulates the SASL Security Context
1200 parameters for future re-use. This method can be called only after
1201 the authentication exchange has completed (i.e., when isComplete()
1202 returns true); otherwise, a SaslException is thrown.
1204 A.1.2 setSaslSecurityContext
1207 setSaslSecurityContext(AlgorithmParameterSpec ctx)
1208 throws SaslException;
1210 Replaces the current SASL Security Context parameters of an object
1211 with those encapsulated in the designated argument.
1216 The designated instance of the object encapsulating the new values
1217 of SASL Security Context parameters to use after successful
1218 completion of this method.
1231 Naffah & Taylor Expires May 2, 2002 [Page 22]
1233 Internet-Draft The SM2 SASL Mechanism November 2001
1236 A.1.3 evaluateEvidence
1239 evaluateEvidence(byte[] peerEvidence)
1240 throws SaslException;
1242 Computes new values for all or some of the SASL Security Context
1243 parameters and returns an Evidence that will be sent to the peer.
1245 The rationale for this method is to (a) allow the peers to 're-cycle'
1246 their cryptographic paramemeters so each re-use of the exchange would
1247 be based on different values every time; and (b) allow the peers to
1248 check, in the absence of a full authentication exchange, that the
1249 peer really knows more than just the session ID.
1251 This method throws a SaslException if during the process of updating
1252 the SASL Security Context parameters, or while generating the
1253 Evidence, it encounters an exception.
1258 The peer's Evidence as received in a session re-use exchange.
1261 A.2 public interface SaslServerExt
1263 An interface that extends the SaslServer interface.
1265 An object implementing this interface can negotiate authentication
1266 using one of the IANA-registered mechanisms, and be used as a server-
1267 side underlying mechanism for the SM2 mechanism.
1269 A.2.1 getSaslSecurityContext
1271 AlgorithmParameterSpec
1272 getSaslSecurityContext()
1273 throws SaslException;
1275 Retrieves an object that encapsulates the SASL Security Context
1276 parameters for future re-use. This method can be called only after
1277 the authentication exchange has completed (i.e., when isComplete()
1278 returns true); otherwise, a SaslException is thrown.
1287 Naffah & Taylor Expires May 2, 2002 [Page 23]
1289 Internet-Draft The SM2 SASL Mechanism November 2001
1294 A.2.2 setSaslSecurityContext
1297 setSaslSecurityContext(AlgorithmParameterSpec ctx)
1298 throws SaslException;
1300 Replaces the current SASL Security Context parameters of an object
1301 with those encapsulated in the designated argument.
1306 The designated instance of the object encapsulating the new values
1307 of SASL Security Context parameters to use after successful
1308 completion of this method.
1311 A.2.3 evaluateEvidence
1314 evaluateEvidence(byte[] peerEvidence)
1315 throws SaslException;
1317 Computes new values for all or some of the SASL Security Context
1318 parameters and returns an Evidence that will be sent to the peer.
1320 The rationale for this method is to (a) allow the peers to 're-cycle'
1321 their cryptographic paramemeters so each re-use of the exchange would
1322 be based on different values every time; and (b) allow the peers to
1323 check, in the absence of a full authentication exchange, that the
1324 peer really knows more than just the session ID.
1326 This method throws a SaslException if during the process of updating
1327 the SASL Security Context parameters, or while generating the
1328 Evidence, it encounters an exception.
1333 The peer's Evidence as received in a session re-use exchange.
1345 Naffah & Taylor Expires May 2, 2002 [Page 24]
1347 Internet-Draft The SM2 SASL Mechanism November 2001
1350 Appendix B. Changes since last draft
1352 Added the restriction that all text should be in Unicode
1353 Normalization form KC with NULs prohibited.
1355 Re-worded the section on the Java SASL API.
1357 Updated the References.
1401 Naffah & Taylor Expires May 2, 2002 [Page 25]
1403 Internet-Draft The SM2 SASL Mechanism November 2001
1406 Full Copyright Statement
1408 Copyright (C) The Internet Society (2001). All Rights Reserved.
1410 This document and translations of it may be copied and furnished to
1411 others, and derivative works that comment on or otherwise explain it
1412 or assist in its implementation may be prepared, copied, published
1413 and distributed, in whole or in part, without restriction of any
1414 kind, provided that the above copyright notice and this paragraph are
1415 included on all such copies and derivative works. However, this
1416 document itself may not be modified in any way, such as by removing
1417 the copyright notice or references to the Internet Society or other
1418 Internet organizations, except as needed for the purpose of
1419 developing Internet standards in which case the procedures for
1420 copyrights defined in the Internet Standards process must be
1421 followed, or as required to translate it into languages other than
1424 The limited permissions granted above are perpetual and will not be
1425 revoked by the Internet Society or its successors or assigns.
1427 This document and the information contained herein is provided on an
1428 "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
1429 TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
1430 BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
1431 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
1432 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
1436 Funding for the RFC Editor function is currently provided by the
1457 Naffah & Taylor Expires May 2, 2002 [Page 26]