7 INTERNET-DRAFT P. Leach
8 Obsoletes: 2831 Microsoft
9 Intended category: Standards track C. Newman
15 Using Digest Authentication as a SASL Mechanism
16 draft-melnikov-rfc2831bis-00.txt
20 This document is an Internet-Draft and is in full conformance with
21 all provisions of Section 10 of RFC2026 [RFC2026].
23 Internet-Drafts are working documents of the Internet Engineering
24 Task Force (IETF), its areas, and its working groups. Note that other
25 groups may also distribute working documents as Internet-Drafts.
27 Internet-Drafts are draft documents valid for a maximum of six months
28 and may be updated, replaced, or obsoleted by other documents at any
29 time. It is inappropriate to use Internet-Drafts as reference
30 material or to cite them other than as "work in progress."
32 The list of current Internet-Drafts can be accessed at
33 http://www.ietf.org/ietf/1id-abstracts.txt
35 The list of Internet-Draft Shadow Directories can be accessed at
36 http://www.ietf.org/shadow.html.
40 Copyright (C) The Internet Society (2002). All Rights Reserved.
44 This specification defines how HTTP Digest Authentication [Digest]
45 can be used as a SASL [RFC 2222] mechanism for any protocol that has
46 a SASL profile. It is intended both as an improvement over CRAM-MD5
47 [RFC 2195] and as a convenient way to support a single authentication
48 mechanism for web, mail, LDAP, and other protocols.
52 1 INTRODUCTION.....................................................2
53 1.1 CONVENTIONS AND NOTATION......................................3
54 1.2 REQUIREMENTS..................................................3
55 2 AUTHENTICATION...................................................4
59 Leach & Newman Expires: October 2002 [Page 1]
65 INTERNET DRAFT Digest SASL Mechanism April 2002
68 2.1 INITIAL AUTHENTICATION........................................4
69 2.1.1 Step One...................................................4
70 2.1.2 Step Two...................................................7
71 2.1.3 Step Three................................................13
72 2.2 SUBSEQUENT AUTHENTICATION....................................13
73 2.2.1 Step one..................................................14
74 2.2.2 Step Two..................................................14
75 2.3 INTEGRITY PROTECTION.........................................14
76 2.4 CONFIDENTIALITY PROTECTION...................................15
77 3 SECURITY CONSIDERATIONS.........................................16
78 3.1 AUTHENTICATION OF CLIENTS USING DIGEST AUTHENTICATION........16
79 3.2 COMPARISON OF DIGEST WITH PLAINTEXT PASSWORDS................17
80 3.3 REPLAY ATTACKS...............................................17
81 3.4 ONLINE DICTIONARY ATTACKS....................................17
82 3.5 OFFLINE DICTIONARY ATTACKS...................................17
83 3.6 MAN IN THE MIDDLE............................................18
84 3.7 CHOSEN PLAINTEXT ATTACKS.....................................18
85 3.8 SPOOFING BY COUNTERFEIT SERVERS..............................18
86 3.9 STORING PASSWORDS............................................18
87 3.10 MULTIPLE REALMS.............................................19
88 3.11 SUMMARY.....................................................19
89 4 EXAMPLE.........................................................19
90 5 REFERENCES......................................................21
91 6 AUTHORS' ADDRESSES..............................................22
92 7 ABNF............................................................23
93 7.1 AUGMENTED BNF................................................23
94 7.2 BASIC RULES..................................................25
95 8 SAMPLE CODE.....................................................27
96 9 FULL COPYRIGHT STATEMENT........................................29
100 This specification describes the use of HTTP Digest Access
101 Authentication as a SASL mechanism. The authentication type
102 associated with the Digest SASL mechanism is "DIGEST-MD5".
104 This specification is intended to be upward compatible with the
105 "md5-sess" algorithm of HTTP/1.1 Digest Access Authentication
106 specified in [Digest]. The only difference in the "md5-sess"
107 algorithm is that some directives not needed in a SASL mechanism have
108 had their values defaulted.
110 There is one new feature for use as a SASL mechanism: integrity
111 protection on application protocol messages after an authentication
114 Also, compared to CRAM-MD5, DIGEST-MD5 prevents chosen plaintext
115 attacks, and permits the use of third party authentication servers,
119 Leach & Newman Expires: October 2002 [Page 2]
125 INTERNET DRAFT Digest SASL Mechanism April 2002
128 mutual authentication, and optimized reauthentication if a client has
129 recently authenticated to a server.
131 1.1 Conventions and Notation
133 This specification uses the same ABNF notation and lexical
134 conventions as HTTP/1.1 specification; see appendix A.
136 Let { a, b, ... } be the concatenation of the octet strings a, b, ...
138 Let H(s) be the 16 octet MD5 hash [RFC 1321] of the octet string s.
140 Let KD(k, s) be H({k, ":", s}), i.e., the 16 octet hash of the string
141 k, a colon and the string s.
143 Let HEX(n) be the representation of the 16 octet MD5 hash n as a
144 string of 32 hex digits (with alphabetic characters always in lower
145 case, since MD5 is case sensitive).
147 Let HMAC(k, s) be the 16 octet HMAC-MD5 [RFC 2104] of the octet
148 string s using the octet string k as a key.
150 Let unq(X) be the value of the quoted-string X without the
151 surrounding quotes and with all escape characters "\\" removed. For
152 example for the quoted-string "Babylon" the value of unq("Babylon")
153 is Babylon; for the quoted string "ABC\"123\\" the value of
154 unq("ABC\"123\\") is ABC"123\.
156 The value of a quoted string constant as an octet string does not
157 include any terminating null character.
161 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
162 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
163 document are to be interpreted as described in RFC 2119 [RFC 2119].
165 An implementation is not compliant if it fails to satisfy one or more
166 of the MUST level requirements for the protocols it implements. An
167 implementation that satisfies all the MUST level and all the SHOULD
168 level requirements for its protocols is said to be "unconditionally
169 compliant"; one that satisfies all the MUST level requirements but
170 not all the SHOULD level requirements for its protocols is said to be
171 "conditionally compliant."
179 Leach & Newman Expires: October 2002 [Page 3]
185 INTERNET DRAFT Digest SASL Mechanism April 2002
190 The following sections describe how to use Digest as a SASL
191 authentication mechanism.
193 2.1 Initial Authentication
195 If the client has not recently authenticated to the server, then it
196 must perform "initial authentication", as defined in this section. If
197 it has recently authenticated, then a more efficient form is
198 available, defined in the next section.
202 The server starts by sending a challenge. The data encoded in the
203 challenge contains a string formatted according to the rules for a
204 "digest-challenge" defined as follows:
239 Leach & Newman Expires: October 2002 [Page 4]
245 INTERNET DRAFT Digest SASL Mechanism April 2002
249 1#( realm | nonce | qop-options | stale | maxbuf | charset
250 algorithm | cipher-opts | auth-param )
252 realm = "realm" "=" <"> realm-value <">
253 realm-value = qdstr-val
254 nonce = "nonce" "=" <"> nonce-value <">
255 nonce-value = *qdtext
256 qop-options = "qop" "=" <"> qop-list <">
257 qop-list = 1#qop-value
258 qop-value = "auth" | "auth-int" | "auth-conf" |
260 stale = "stale" "=" "true"
261 maxbuf = "maxbuf" "=" maxbuf-value
262 maxbuf-value = 1*DIGIT
263 charset = "charset" "=" "utf-8"
264 algorithm = "algorithm" "=" "md5-sess"
265 cipher-opts = "cipher" "=" <"> 1#cipher-value <">
266 cipher-value = "3des" | "des" | "rc4-40" | "rc4" |
268 auth-param = token "=" ( token | quoted-string )
270 The meanings of the values of the directives used above are as
274 Mechanistically, a string which can enable users to know which
275 username and password to use, in case they might have different
276 ones for different servers. Conceptually, it is the name of a
277 collection of accounts that might include the user's account. This
278 string should contain at least the name of the host performing the
279 authentication and might additionally indicate the collection of
280 users who might have access. An example might be
281 "registered_users@gotham.news.example.com". This directive is
282 optional; if not present, the client SHOULD solicit it from the
283 user or be able to compute a default; a plausible default might be
284 the realm supplied by the user when they logged in to the client
285 system. Multiple realm directives are allowed, in which case the
286 user or client must choose one as the realm for which to supply to
287 username and password.
290 A server-specified data string which MUST be different each time a
291 digest-challenge is sent as part of initial authentication. It is
292 recommended that this string be base64 or hexadecimal data. Note
293 that since the string is passed as a quoted string, the
294 double-quote character is not allowed unless escaped (see section
295 7.2). The contents of the nonce are implementation dependent. The
299 Leach & Newman Expires: October 2002 [Page 5]
305 INTERNET DRAFT Digest SASL Mechanism April 2002
308 security of the implementation depends on a good choice. It is
309 RECOMMENDED that it contain at least 64 bits of entropy. The nonce
310 is opaque to the client. This directive is required and MUST
311 appear exactly once; if not present, or if multiple instances are
312 present, the client should abort the authentication exchange.
315 A quoted string of one or more tokens indicating the "quality of
316 protection" values supported by the server. The value "auth"
317 indicates authentication; the value "auth-int" indicates
318 authentication with integrity protection; the value "auth-conf"
319 indicates authentication with integrity protection and encryption.
320 This directive is optional; if not present it defaults to "auth".
321 The client MUST ignore unrecognized options; if the client
322 recognizes no option, it should abort the authentication exchange.
325 The "stale" directive is not used in initial authentication. See
326 the next section for its use in subsequent authentications. This
327 directive may appear at most once; if multiple instances are
328 present, the client should abort the authentication exchange.
331 A number indicating the size of the largest buffer the server is
332 able to receive when using "auth-int" or "auth-conf". If this
333 directive is missing, the default value is 65536. This directive
334 may appear at most once; if multiple instances are present, the
335 client should abort the authentication exchange.
338 This directive, if present, specifies that the server supports
339 UTF-8 [UTF-8] encoding for the username and password. If present,
340 the username and password MUST be in Unicode Normalization Form KC
341 [UNICODE-NORMALIZATION] (without NUL character) encoded as UTF-8
342 [UTF-8]. If not present, the username and password must be
343 encoded in ISO 8859-1 (of which
344 US-ASCII is a subset). The directive is needed for backwards
345 compatibility with HTTP Digest, which only supports ISO 8859-1.
346 This directive may appear at most once; if multiple instances are
347 present, the client should abort the authentication exchange.
350 This directive is required for backwards compatibility with HTTP
351 Digest., which supports other algorithms. . This directive is
352 required and MUST appear exactly once; if not present, or if
353 multiple instances are present, the client should abort the
354 authentication exchange.
359 Leach & Newman Expires: October 2002 [Page 6]
365 INTERNET DRAFT Digest SASL Mechanism April 2002
369 A list of ciphers that the server supports. This directive must be
370 present exactly once if "auth-conf" is offered in the
371 "qop-options" directive, in which case the "3des" cipher is
372 mandatory-to-implement. The client MUST ignore unrecognized
373 options; if the client recognizes no option, it should abort the
374 authentication exchange.
377 the Data Encryption Standard (DES) cipher [FIPS] in cipher
378 block chaining (CBC) mode with a 56 bit key.
381 the "triple DES" cipher in CBC mode with EDE with the same key
382 for each E stage (aka "two keys mode") for a total key length
386 the RC4 cipher with a 128 bit, 40 bit, and 56 bit key,
389 auth-param This construct allows for future extensions; it may appear
390 more than once. The client MUST ignore any unrecognized
393 For use as a SASL mechanism, note that the following changes are made
394 to "digest-challenge" from HTTP: the following Digest options (called
395 "directives" in HTTP terminology) are unused (i.e., MUST NOT be sent,
396 and MUST be ignored if received):
401 The size of a digest-challenge MUST be less than 2048 bytes.
405 The client makes note of the "digest-challenge" and then responds
406 with a string formatted and computed according to the rules for a
407 "digest-response" defined as follows:
419 Leach & Newman Expires: October 2002 [Page 7]
425 INTERNET DRAFT Digest SASL Mechanism April 2002
428 digest-response = 1#( username | realm | nonce | cnonce |
429 nonce-count | qop | digest-uri | response |
430 maxbuf | charset | cipher | authzid |
433 username = "username" "=" <"> username-value <">
434 username-value = qdstr-val
435 cnonce = "cnonce" "=" <"> cnonce-value <">
436 cnonce-value = *qdtext
437 nonce-count = "nc" "=" nc-value
439 qop = "qop" "=" qop-value
440 digest-uri = "digest-uri" "=" <"> digest-uri-value <">
441 digest-uri-value = serv-type "/" host [ "/" serv-name ]
443 host = 1*( ALPHA | DIGIT | "-" | "." )
445 response = "response" "=" response-value
446 response-value = 32LHEX
447 LHEX = "0" | "1" | "2" | "3" |
448 "4" | "5" | "6" | "7" |
449 "8" | "9" | "a" | "b" |
450 "c" | "d" | "e" | "f"
451 cipher = "cipher" "=" cipher-value
452 authzid = "authzid" "=" <"> authzid-value <">
453 authzid-value = qdstr-val
457 The user's name in the specified realm, encoded according to the
458 value of the "charset" directive. This directive is required and
459 MUST be present exactly once; otherwise, authentication fails.
462 The realm containing the user's account. This directive is
463 required if the server provided any realms in the
464 "digest-challenge", in which case it may appear exactly once and
465 its value SHOULD be one of those realms. If the directive is
466 missing, "realm-value" will set to the empty string when computing
467 A1 (see below for details).
470 The server-specified data string received in the preceding digest-
471 challenge. This directive is required and MUST be present exactly
472 once; otherwise, authentication fails.
479 Leach & Newman Expires: October 2002 [Page 8]
485 INTERNET DRAFT Digest SASL Mechanism April 2002
489 A client-specified data string which MUST be different each time a
490 digest-response is sent as part of initial authentication. The
491 cnonce-value is an opaque quoted string value provided by the
492 client and used by both client and server to avoid chosen
493 plaintext attacks, and to provide mutual authentication. The
494 security of the implementation depends on a good choice. It is
495 RECOMMENDED that it contain at least 64 bits of entropy. This
496 directive is required and MUST be present exactly once; otherwise,
497 authentication fails.
500 The nc-value is the hexadecimal count of the number of requests
501 (including the current request) that the client has sent with the
502 nonce value in this request. For example, in the first request
503 sent in response to a given nonce value, the client sends
504 "nc=00000001". The purpose of this directive is to allow the
505 server to detect request replays by maintaining its own copy of
506 this count - if the same nc-value is seen twice, then the request
507 is a replay. See the description below of the construction of the
508 response value. This directive is required and MUST be present
509 exactly once; otherwise, authentication fails.
512 Indicates what "quality of protection" the client accepted. If
513 present, it may appear exactly once and its value MUST be one of
514 the alternatives in qop-options. If not present, it defaults to
515 "auth". These values affect the computation of the response. Note
516 that this is a single token, not a quoted list of alternatives.
519 Indicates the type of service, such as "www" for web service,
520 "ftp" for FTP service, "smtp" for mail delivery service, etc. The
521 service name as defined in the SASL profile for the protocol see
522 section 4 of [RFC 2222], registered in the IANA registry of
523 "service" elements for the GSSAPI host-based service name form
527 The DNS host name or IP address for the service requested. The
528 DNS host name must be the fully-qualified canonical name of the
529 host. The DNS host name is the preferred form; see notes on
530 server processing of the digest-uri.
539 Leach & Newman Expires: October 2002 [Page 9]
545 INTERNET DRAFT Digest SASL Mechanism April 2002
549 Indicates the name of the service if it is replicated. The service
550 is considered to be replicated if the client's service-location
551 process involves resolution using standard DNS lookup operations,
552 and if these operations involve DNS records (such as SRV, or MX)
553 which resolve one DNS name into a set of other DNS names. In this
554 case, the initial name used by the client is the "serv-name", and
555 the final name is the "host" component. For example, the incoming
556 mail service for "example.com" may be replicated through the use
557 of MX records stored in the DNS, one of which points at an SMTP
558 server called "mail3.example.com"; it's "serv-name" would be
559 "example.com", it's "host" would be "mail3.example.com". If the
560 service is not replicated, or the serv-name is identical to the
561 host, then the serv-name component MUST be omitted.
564 Indicates the principal name of the service with which the client
565 wishes to connect, formed from the serv-type, host, and serv-name.
566 For example, the FTP service on "ftp.example.com" would have a
567 "digest-uri" value of "ftp/ftp.example.com"; the SMTP server from
568 the example above would have a "digest-uri" value of
569 "smtp/mail3.example.com/example.com".
571 Servers SHOULD check that the supplied value is correct. This will
572 detect accidental connection to the incorrect server. It is also so
573 that clients will be trained to provide values that will work with
574 implementations that use a shared back-end authentication service
575 that can provide server authentication.
577 The serv-type component should match the service being offered. The
578 host component should match one of the host names of the host on
579 which the service is running, or it's IP address. Servers SHOULD NOT
580 normally support the IP address form, because server authentication
581 by IP address is not very useful; they should only do so if the DNS
582 is unavailable or unreliable. The serv-name component should match
583 one of the service's configured service names.
585 This directive may appear at most once; if multiple instances are
586 present, the client should abort the authentication exchange.
588 Note: In the HTTP use of Digest authentication, the digest-uri is the
589 URI (usually a URL) of the resource requested -- hence the name of
593 A string of 32 hex digits computed as defined below, which proves
594 that the user knows a password. This directive is required and
595 MUST be present exactly once; otherwise, authentication fails.
599 Leach & Newman Expires: October 2002 [Page 10]
605 INTERNET DRAFT Digest SASL Mechanism April 2002
609 A number indicating the size of the largest buffer the client is
610 able to receive. If this directive is missing, the default value
611 is 65536. This directive may appear at most once; if multiple
612 instances are present, the server should abort the authentication
616 This directive, if present, specifies that the client has used
617 UTF-8 [UTF-8] encoding for the username and password. If present,
618 the username and password MUST be in Unicode Normalization Form KC
619 [UNICODE-NORMALIZATION] (without NUL character) encoded as UTF-8
620 [UTF-8]. If not present, the username and password must be encoded
621 in ISO 8859-1 (of which
622 US-ASCII is a subset). The client should send this directive only
623 if the server has indicated it supports UTF-8 [UTF-8]. The
624 directive is needed for backwards compatibility with HTTP Digest,
625 which only supports ISO 8859-1.
628 32 hex digits, where the alphabetic characters MUST be lower case,
629 because MD5 is not case insensitive.
632 The cipher chosen by the client. This directive MUST appear
633 exactly once if "auth-conf" is negotiated; if required and not
634 present, authentication fails.
637 The "authorization ID" in Unicode Normalization Form KC [UNICODE-
638 NORMALIZATION] without NUL character, encoded in UTF-8 [UTF-8].
639 This directive is optional. If present, and the authenticating
640 user has sufficient privilege, and the server supports it, then
641 after authentication the server will use this identity for making
642 all accesses and access checks. If the client specifies it, and
643 the server does not support it, then the response-value will be
644 incorrect, and authentication will fail.
646 The size of a digest-response MUST be less than 4096 bytes.
648 2.1.2.1 Response-value
650 The definition of "response-value" above indicates the encoding for
651 its value -- 32 lower case hex characters. The following definitions
652 show how the value is computed.
654 Although qop-value and components of digest-uri-value may be
655 case-insensitive, the case which the client supplies in step two is
659 Leach & Newman Expires: October 2002 [Page 11]
665 INTERNET DRAFT Digest SASL Mechanism April 2002
668 preserved for the purpose of computing and verifying the
672 HEX( KD ( HEX(H(A1)),
673 { nonce-value, ":" nc-value, ":",
674 cnonce-value, ":", qop-value, ":", HEX(H(A2)) }))
676 If authzid is specified, then A1 is
679 A1 = { H( { unq(username-value), ":", unq(realm-value), ":", passwd } ),
680 ":", nonce-value, ":", cnonce-value, ":", unq(authzid-value) }
682 If authzid is not specified, then A1 is
685 A1 = { H( { unq(username-value), ":", unq(realm-value), ":", passwd } ),
686 ":", nonce-value, ":", cnonce-value }
692 The "username-value", "realm-value" and "passwd" are encoded
693 according to the value of the "charset" directive. If "charset=UTF-8"
694 is present, and all the characters of "username-value"/"passwd" are,
695 after converting to Unicode Normalization Form KC [UNICODE-
696 NORMALIZATION], in the ISO 8859-1 character set, then it must be
697 converted to ISO 8859-1 before being hashed. This is so that
698 authentication databases that store the hashed username, realm and
699 password (which is common) can be shared compatibly with HTTP, which
700 specifies ISO 8859-1. A sample implementation of this conversion is
703 If the "qop" directive's value is "auth", then A2 is:
705 A2 = { "AUTHENTICATE:", digest-uri-value }
707 If the "qop" value is "auth-int" or "auth-conf" then A2 is:
709 A2 = { "AUTHENTICATE:", digest-uri-value,
710 ":00000000000000000000000000000000" }
712 Note that "AUTHENTICATE:" must be in upper case, and the second
713 string constant is a string with a colon followed by 32 zeros.
715 These apparently strange values of A2 are for compatibility with
719 Leach & Newman Expires: October 2002 [Page 12]
725 INTERNET DRAFT Digest SASL Mechanism April 2002
728 HTTP; they were arrived at by setting "Method" to "AUTHENTICATE" and
729 the hash of the entity body to zero in the HTTP digest calculation of
732 Also, in the HTTP usage of Digest, several directives in the
733 "digest-challenge" sent by the server have to be returned by the
734 client in the "digest-response". These are:
739 These directives are not needed when Digest is used as a SASL
740 mechanism (i.e., MUST NOT be sent, and MUST be ignored if received).
744 The server receives and validates the "digest-response". The server
745 checks that the nonce-count is "00000001". If it supports subsequent
746 authentication (see section 2.2), it saves the value of the nonce and
747 the nonce-count. It sends a message formatted as follows:
749 response-auth = "rspauth" "=" response-value
751 where response-value is calculated as above, using the values sent in
752 step two, except that if qop is "auth", then A2 is
754 A2 = { ":", digest-uri-value }
756 And if qop is "auth-int" or "auth-conf" then A2 is
758 A2 = { ":", digest-uri-value, ":00000000000000000000000000000000" }
760 Compared to its use in HTTP, the following Digest directives in the
761 "digest-response" are unused:
768 2.2 Subsequent Authentication
770 If the client has previously authenticated to the server, and
771 remembers the values of username, realm, nonce, nonce-count, cnonce,
772 and qop that it used in that authentication, and the SASL profile for
773 a protocol permits an initial client response, then it MAY perform
774 "subsequent authentication", as defined in this section.
779 Leach & Newman Expires: October 2002 [Page 13]
785 INTERNET DRAFT Digest SASL Mechanism April 2002
790 The client uses the values from the previous authentication and sends
791 an initial response with a string formatted and computed according to
792 the rules for a "digest-response", as defined above, but with a
793 nonce-count one greater than used in the last "digest-response".
797 The server receives the "digest-response". If the server does not
798 support subsequent authentication, then it sends a
799 "digest-challenge", and authentication proceeds as in initial
800 authentication. If the server has no saved nonce and nonce-count from
801 a previous authentication, then it sends a "digest-challenge", and
802 authentication proceeds as in initial authentication. Otherwise, the
803 server validates the "digest-response", checks that the nonce-count
804 is one greater than that used in the previous authentication using
805 that nonce, and saves the new value of nonce-count.
807 If the response is invalid, then the server sends a
808 "digest-challenge", and authentication proceeds as in initial
809 authentication (and should be configurable to log an authentication
810 failure in some sort of security audit log, since the failure may be
811 a symptom of an attack). The nonce-count MUST NOT be incremented in
812 this case: to do so would allow a denial of service attack by sending
813 an out-of-order nonce-count.
815 If the response is valid, the server MAY choose to deem that
816 authentication has succeeded. However, if it has been too long since
817 the previous authentication, or for any other reason, the server MAY
818 send a new "digest-challenge" with a new value for nonce. The
819 challenge MAY contain a "stale" directive with value "true", which
820 says that the client may respond to the challenge using the password
821 it used in the previous response; otherwise, the client must solicit
822 the password anew from the user. This permits the server to make sure
823 that the user has presented their password recently. (The directive
824 name refers to the previous nonce being stale, not to the last use of
825 the password.) Except for the handling of "stale", after sending the
826 "digest-challenge" authentication proceeds as in the case of initial
829 2.3 Integrity Protection
831 If the server offered "qop=auth-int" and the client responded
832 "qop=auth-int", then subsequent messages, up to but not including the
833 next subsequent authentication, between the client and the server
839 Leach & Newman Expires: October 2002 [Page 14]
845 INTERNET DRAFT Digest SASL Mechanism April 2002
848 MUST be integrity protected. Using as a base session key the value of
849 H(A1) as defined above the client and server calculate a pair of
850 message integrity keys as follows.
852 The key for integrity protecting messages from client to server is:
855 "Digest session key to client-to-server signing key magic constant"})
857 The key for integrity protecting messages from server to client is:
860 "Digest session key to server-to-client signing key magic constant"})
862 where MD5 is as specified in [RFC 1321]. If message integrity is
863 negotiated, a MAC block for each message is appended to the message.
864 The MAC block is 16 bytes: the first 10 bytes of the HMAC-MD5 [RFC
865 2104] of the message, a 2-byte message type number in network byte
866 order with value 1, and the 4-byte sequence number in network byte
867 order. The message type is to allow for future extensions such as
870 MAC(Ki, SeqNum, msg) = (HMAC(Ki, {SeqNum, msg})[0..9], 0x0001,
873 where Ki is Kic for messages sent by the client and Kis for those
874 sent by the server. The sequence number is initialized to zero, and
875 incremented by one for each message sent.
877 Upon receipt, MAC(Ki, SeqNum, msg) is computed and compared with the
878 received value; the message is discarded if they differ.
880 2.4 Confidentiality Protection
882 If the server sent a "cipher-opts" directive and the client responded
883 with a "cipher" directive, then subsequent messages between the
884 client and the server MUST be confidentiality protected. Using as a
885 base session key the value of H(A1) as defined above the client and
886 server calculate a pair of message integrity keys as follows.
888 The key for confidentiality protecting messages from client to server
891 Kcc = MD5({H(A1)[0..n-1],
892 "Digest H(A1) to client-to-server sealing key magic constant"})
894 The key for confidentiality protecting messages from server to client
899 Leach & Newman Expires: October 2002 [Page 15]
905 INTERNET DRAFT Digest SASL Mechanism April 2002
908 Kcs = MD5({H(A1)[0..n-1],
909 "Digest H(A1) to server-to-client sealing key magic constant"})
911 where MD5 is as specified in [RFC 1321]. For cipher "rc4-40" n is 5;
912 for "rc4-56" n is 7; for the rest n is 16. The key for the "rc4-*"
913 ciphers is all 16 bytes of Kcc or Kcs; the key for "des" is the first
914 7 bytes; the key for "3des" is the first 14 bytes. The IV for "des"
915 and "3des" is the last 8 bytes of Kcc or Kcs.
917 If message confidentiality is negotiated, each message is encrypted
918 with the chosen cipher and a MAC block is appended to the message.
920 The MAC block is a variable length padding prefix followed by 16
921 bytes formatted as follows: the first 10 bytes of the HMAC-MD5 [RFC
922 2104] of the message, a 2-byte message type number in network byte
923 order with value 1, and the 4-byte sequence number in network byte
924 order. If the blocksize of the chosen cipher is not 1 byte, the
925 padding prefix is one or more octets each containing the number of
926 padding bytes, such that total length of the encrypted part of the
927 message is a multiple of the blocksize. The padding and first 10
928 bytes of the MAC block are encrypted along with the message.
930 SEAL(Ki, Kc, SeqNum, msg) =
931 {CIPHER(Kc, {msg, pad, HMAC(Ki, {SeqNum, msg})[0..9])}), 0x0001,
934 where CIPHER is the chosen cipher, Ki and Kc are Kic and Kcc for
935 messages sent by the client and Kis and Kcs for those sent by the
936 server. The sequence number is initialized to zero, and incremented
937 by one for each message sent.
939 Upon receipt, the message is decrypted, HMAC(Ki, {SeqNum, msg}) is
940 computed and compared with the received value; the message is
941 discarded if they differ.
943 3 Security Considerations
945 3.1 Authentication of Clients using Digest Authentication
947 Digest Authentication does not provide a strong authentication
948 mechanism, when compared to public key based mechanisms, for example.
949 However, since it prevents chosen plaintext attacks, it is stronger
950 than (e.g.) CRAM-MD5, which has been proposed for use with LDAP [10],
951 POP and IMAP (see RFC 2195 [9]). It is intended to replace the much
952 weaker and even more dangerous use of plaintext passwords; however,
953 since it is still a password based mechanism it avoids some of the
954 potential deployabilty issues with public-key, OTP or similar
959 Leach & Newman Expires: October 2002 [Page 16]
965 INTERNET DRAFT Digest SASL Mechanism April 2002
968 Digest Authentication offers no confidentiality protection beyond
969 protecting the actual password. All of the rest of the challenge and
970 response are available to an eavesdropper, including the user's name
971 and authentication realm.
973 3.2 Comparison of Digest with Plaintext Passwords
975 The greatest threat to the type of transactions for which these
976 protocols are used is network snooping. This kind of transaction
977 might involve, for example, online access to a mail service whose use
978 is restricted to paying subscribers. With plaintext password
979 authentication an eavesdropper can obtain the password of the user.
980 This not only permits him to access anything in the database, but,
981 often worse, will permit access to anything else the user protects
982 with the same password.
986 Replay attacks are defeated if the client or the server chooses a
987 fresh nonce for each authentication, as this specification requires.
989 3.4 Online dictionary attacks
991 If the attacker can eavesdrop, then it can test any overheard
992 nonce/response pairs against a (potentially very large) list of
993 common words. Such a list is usually much smaller than the total
994 number of possible passwords. The cost of computing the response for
995 each password on the list is paid once for each challenge.
997 The server can mitigate this attack by not allowing users to select
998 passwords that are in a dictionary.
1000 3.5 Offline dictionary attacks
1002 If the attacker can choose the challenge, then it can precompute the
1003 possible responses to that challenge for a list of common words. Such
1004 a list is usually much smaller than the total number of possible
1005 passwords. The cost of computing the response for each password on
1006 the list is paid just once.
1008 Offline dictionary attacks are defeated if the client chooses a fresh
1009 nonce for each authentication, as this specification requires.
1019 Leach & Newman Expires: October 2002 [Page 17]
1025 INTERNET DRAFT Digest SASL Mechanism April 2002
1028 3.6 Man in the Middle
1030 Digest authentication is vulnerable to "man in the middle" (MITM)
1031 attacks. Clearly, a MITM would present all the problems of
1032 eavesdropping. But it also offers some additional opportunities to
1035 A possible man-in-the-middle attack would be to substitute a weaker
1036 qop scheme for the one(s) sent by the server; the server will not be
1037 able to detect this attack. For this reason, the client should always
1038 use the strongest scheme that it understands from the choices
1039 offered, and should never choose a scheme that does not meet its
1040 minimum requirements.
1042 3.7 Chosen plaintext attacks
1044 A chosen plaintext attack is where a MITM or a malicious server can
1045 arbitrarily choose the challenge that the client will use to compute
1046 the response. The ability to choose the challenge is known to make
1047 cryptanalysis much easier [8].
1049 However, Digest does not permit the attack to choose the challenge as
1050 long as the client chooses a fresh nonce for each authentication, as
1051 this specification requires.
1053 3.8 Spoofing by Counterfeit Servers
1055 If a user can be led to believe that she is connecting to a host
1056 containing information protected by a password she knows, when in
1057 fact she is connecting to a hostile server, then the hostile server
1058 can obtain challenge/response pairs where it was able to partly
1059 choose the challenge. There is no known way that this can be
1062 3.9 Storing passwords
1064 Digest authentication requires that the authenticating agent (usually
1065 the server) store some data derived from the user's name and password
1066 in a "password file" associated with a given realm. Normally this
1067 might contain pairs consisting of username and H({ username-value,
1068 ":", realm-value, ":", passwd }), which is adequate to compute H(A1)
1069 as described above without directly exposing the user's password.
1071 The security implications of this are that if this password file is
1072 compromised, then an attacker gains immediate access to documents on
1073 the server using this realm. Unlike, say a standard UNIX password
1074 file, this information need not be decrypted in order to access
1075 documents in the server realm associated with this file. On the other
1079 Leach & Newman Expires: October 2002 [Page 18]
1085 INTERNET DRAFT Digest SASL Mechanism April 2002
1088 hand, decryption, or more likely a brute force attack, would be
1089 necessary to obtain the user's password. This is the reason that the
1090 realm is part of the digested data stored in the password file. It
1091 means that if one Digest authentication password file is compromised,
1092 it does not automatically compromise others with the same username
1093 and password (though it does expose them to brute force attack).
1095 There are two important security consequences of this. First the
1096 password file must be protected as if it contained plaintext
1097 passwords, because for the purpose of accessing documents in its
1098 realm, it effectively does.
1100 A second consequence of this is that the realm string should be
1101 unique among all realms that any single user is likely to use. In
1102 particular a realm string should include the name of the host doing
1105 3.10 Multiple realms
1107 Use of multiple realms may mean both that compromise of a the
1108 security database for a single realm does not compromise all
1109 security, and that there are more things to protect in order to keep
1110 the whole system secure.
1114 By modern cryptographic standards Digest Authentication is weak,
1115 compared to (say) public key based mechanisms. But for a large range
1116 of purposes it is valuable as a replacement for plaintext passwords.
1117 Its strength may vary depending on the implementation.
1121 This example shows the use of the Digest SASL mechanism with the
1122 IMAP4 AUTHENTICATE command [RFC 2060].
1124 In this example, "C:" and "S:" represent a line sent by the client or
1125 server respectively including a CRLF at the end. Linebreaks and
1126 indentation within a "C:" or "S:" are editorial and not part of the
1127 protocol. The password in this example was "secret". Note that the
1128 base64 encoding of the challenges and responses is part of the IMAP4
1129 AUTHENTICATE command, not part of the Digest specification itself.
1131 S: * OK elwood.innosoft.com PMDF IMAP4rev1 V6.0-9
1133 S: * CAPABILITY IMAP4 IMAP4rev1 ACL LITERAL+ NAMESPACE QUOTA
1134 UIDPLUS AUTH=CRAM-MD5 AUTH=DIGEST-MD5 AUTH=PLAIN
1139 Leach & Newman Expires: October 2002 [Page 19]
1145 INTERNET DRAFT Digest SASL Mechanism April 2002
1148 C: a AUTHENTICATE DIGEST-MD5
1149 S: + cmVhbG09ImVsd29vZC5pbm5vc29mdC5jb20iLG5vbmNlPSJPQTZNRzl0
1150 RVFHbTJoaCIscW9wPSJhdXRoIixhbGdvcml0aG09bWQ1LXNlc3MsY2hh
1152 C: Y2hhcnNldD11dGYtOCx1c2VybmFtZT0iY2hyaXMiLHJlYWxtPSJlbHdvb2
1153 QuaW5ub3NvZnQuY29tIixub25jZT0iT0E2TUc5dEVRR20yaGgiLG5jPTAw
1154 MDAwMDAxLGNub25jZT0iT0E2TUhYaDZWcVRyUmsiLGRpZ2VzdC11cmk9Im
1155 ltYXAvZWx3b29kLmlubm9zb2Z0LmNvbSIscmVzcG9uc2U9ZDM4OGRhZDkw
1156 ZDRiYmQ3NjBhMTUyMzIxZjIxNDNhZjcscW9wPWF1dGg=
1157 S: + cnNwYXV0aD1lYTQwZjYwMzM1YzQyN2I1NTI3Yjg0ZGJhYmNkZmZmZA==
1159 S: a OK User logged in
1162 The base64-decoded version of the SASL exchange is:
1164 S: realm="elwood.innosoft.com",nonce="OA6MG9tEQGm2hh",qop="auth",
1165 algorithm=md5-sess,charset=utf-8
1166 C: charset=utf-8,username="chris",realm="elwood.innosoft.com",
1167 nonce="OA6MG9tEQGm2hh",nc=00000001,cnonce="OA6MHXh6VqTrRk",
1168 digest-uri="imap/elwood.innosoft.com",
1169 response=d388dad90d4bbd760a152321f2143af7,qop=auth
1170 S: rspauth=ea40f60335c427b5527b84dbabcdfffd
1172 The password in this example was "secret".
1174 This example shows the use of the Digest SASL mechanism with the
1175 ACAP, using the same notational conventions and password as in the
1176 previous example. Note that ACAP does not base64 encode and uses
1177 fewer round trips that IMAP4.
1179 S: * ACAP (IMPLEMENTATION "Test ACAP server") (SASL "CRAM-MD5"
1180 "DIGEST-MD5" "PLAIN")
1181 C: a AUTHENTICATE "DIGEST-MD5"
1183 S: realm="elwood.innosoft.com",nonce="OA9BSXrbuRhWay",qop="auth",
1184 algorithm=md5-sess,charset=utf-8
1186 C: charset=utf-8,username="chris",realm="elwood.innosoft.com",
1187 nonce="OA9BSXrbuRhWay",nc=00000001,cnonce="OA9BSuZWMSpW8m",
1188 digest-uri="acap/elwood.innosoft.com",
1189 response=6084c6db3fede7352c551284490fd0fc,qop=auth
1191 S: rspauth=2f0b3d7c3c2e486600ef710726aa2eae) "AUTHENTICATE
1199 Leach & Newman Expires: October 2002 [Page 20]
1205 INTERNET DRAFT Digest SASL Mechanism April 2002
1208 The server uses the values of all the directives, plus knowledge of
1209 the users password (or the hash of the user's name, server's realm
1210 and the user's password) to verify the computations above. If they
1211 check, then the user has authenticated.
1215 [Digest] Franks, J., et al., "HTTP Authentication: Basic and Digest
1216 Access Authentication", RFC 2617, June 1999.
1218 [ISO-8859] ISO-8859. International Standard--Information Processing--
1219 8-bit Single-Byte Coded Graphic Character Sets --
1220 Part 1: Latin alphabet No. 1, ISO-8859-1:1987.
1221 Part 2: Latin alphabet No. 2, ISO-8859-2, 1987.
1222 Part 3: Latin alphabet No. 3, ISO-8859-3, 1988.
1223 Part 4: Latin alphabet No. 4, ISO-8859-4, 1988.
1224 Part 5: Latin/Cyrillic alphabet, ISO-8859-5, 1988.
1225 Part 6: Latin/Arabic alphabet, ISO-8859-6, 1987.
1226 Part 7: Latin/Greek alphabet, ISO-8859-7, 1987.
1227 Part 8: Latin/Hebrew alphabet, ISO-8859-8, 1988.
1228 Part 9: Latin alphabet No. 5, ISO-8859-9, 1990.
1230 [RFC 822] Crocker, D., "Standard for The Format of ARPA Internet
1231 Text Messages," STD 11, RFC 822, August 1982.
1233 [RFC 1321] Rivest, R., "The MD5 Message-Digest Algorithm", RFC 1321,
1236 [RFC 2052] Gulbrandsen, A. and P. Vixie, "A DNS RR for specifying the
1237 location of services (DNS SRV)", RFC 2052, October 1996.
1239 [RFC 2060] Crispin, M., "Internet Message Access Protocol - Version
1240 4rev1", RFC 2060, December 1996.
1242 [RFC 2104] Krawczyk, H., Bellare, M. and R. Canetti, "HMAC: Keyed-
1243 Hashing for Message Authentication", RFC 2104, February
1246 [RFC 2195] Klensin, J., Catoe, R. and P. Krumviede, "IMAP/POP
1247 AUTHorize Extension for Simple Challenge/Response", RFC
1248 2195, September 1997.
1259 Leach & Newman Expires: October 2002 [Page 21]
1265 INTERNET DRAFT Digest SASL Mechanism April 2002
1268 [RFC 2119] Bradner, S., "Key words for use in RFCs to Indicate
1269 Requirement Levels", BCP 14, RFC 2119, March 1997.
1271 [RFC 2222] Myers, J., "Simple Authentication and Security Layer
1272 (SASL)", RFC 2222, October 1997.
1274 [UNICODE-NORMALIZATION] Davis, Durst, "Unicode Standard Annex #15:
1275 Unicode Normalization Forms",
1276 http://www.unicode.org/unicode/reports/tr15/, March 2001.
1278 [UTF-8] Yergeau, "UTF-8, a transformation format of ISO 10646", RFC
1281 [USASCII] US-ASCII. Coded Character Set - 7-Bit American Standard
1282 Code for Information Interchange. Standard ANSI X3.4-1986,
1285 6 Authors' Addresses
1292 EMail: paulle@microsoft.com
1296 Innosoft International, Inc.
1298 West Covina, CA 91790 USA
1300 EMail: chris.newman@innosoft.com
1304 ACI WorldWide/MessagingDirect
1305 22 The Quadrant, Richmond, Surrey, UK
1307 Email: mel@messagingdirect.com
1319 Leach & Newman Expires: October 2002 [Page 22]
1325 INTERNET DRAFT Digest SASL Mechanism April 2002
1330 What follows is the definition of the notation as is used in the
1331 HTTP/1.1 specification (RFC 2616) and the HTTP authentication
1332 specification (RFC 2617); it is reproduced here for ease of
1333 reference. Since it is intended that a single Digest implementation
1334 can support both HTTP and SASL-based protocols, the same notation is
1335 used in both to facilitate comparison and prevention of unwanted
1336 differences. Since it is cut-and-paste from the HTTP specifications,
1337 not all productions may be used in this specification. It is also not
1338 quite legal ABNF; again, the errors were copied from the HTTP
1343 All of the mechanisms specified in this document are described in
1344 both prose and an augmented Backus-Naur Form (BNF) similar to that
1345 used by RFC 822 [RFC 822]. Implementers will need to be familiar with
1346 the notation in order to understand this specification.
1379 Leach & Newman Expires: October 2002 [Page 23]
1385 INTERNET DRAFT Digest SASL Mechanism April 2002
1388 The augmented BNF includes the following constructs:
1391 The name of a rule is simply the name itself (without any
1392 enclosing "<" and ">") and is separated from its definition by the
1393 equal "=" character. White space is only significant in that
1394 indentation of continuation lines is used to indicate a rule
1395 definition that spans more than one line. Certain basic rules are
1396 in uppercase, such as SP, LWS, HT, CRLF, DIGIT, ALPHA, etc. Angle
1397 brackets are used within definitions whenever their presence will
1398 facilitate discerning the use of rule names.
1401 Quotation marks surround literal text. Unless stated otherwise,
1402 the text is case-insensitive.
1405 Elements separated by a bar ("|") are alternatives, e.g., "yes |
1406 no" will accept yes or no.
1409 Elements enclosed in parentheses are treated as a single element.
1410 Thus, "(elem (foo | bar) elem)" allows the token sequences
1411 "elem foo elem" and "elem bar elem".
1414 The character "*" preceding an element indicates repetition. The
1415 full form is "<n>*<m>element" indicating at least <n> and at most
1416 <m> occurrences of element. Default values are 0 and infinity so
1417 that "*(element)" allows any number, including zero; "1*element"
1418 requires at least one; and "1*2element" allows one or two.
1421 Square brackets enclose optional elements; "[foo bar]" is
1422 equivalent to "*1(foo bar)".
1425 Specific repetition: "<n>(element)" is equivalent to
1426 "<n>*<n>(element)"; that is, exactly <n> occurrences of (element).
1427 Thus 2DIGIT is a 2-digit number, and 3ALPHA is a string of three
1428 alphabetic characters.
1431 A construct "#" is defined, similar to "*", for defining lists of
1432 elements. The full form is "<n>#<m>element" indicating at least
1433 <n> and at most <m> elements, each separated by one or more commas
1434 (",") and OPTIONAL linear white space (LWS). This makes the usual
1435 form of lists very easy; a rule such as
1439 Leach & Newman Expires: October 2002 [Page 24]
1445 INTERNET DRAFT Digest SASL Mechanism April 2002
1448 ( *LWS element *( *LWS "," *LWS element ))
1451 Wherever this construct is used, null elements are allowed, but do
1452 not contribute to the count of elements present. That is,
1453 "(element), , (element) " is permitted, but counts as only two
1454 elements. Therefore, where at least one element is required, at
1455 least one non-null element MUST be present. Default values are 0
1456 and infinity so that "#element" allows any number, including zero;
1457 "1#element" requires at least one; and "1#2element" allows one or
1461 A semi-colon, set off some distance to the right of rule text,
1462 starts a comment that continues to the end of line. This is a
1463 simple way of including useful notes in parallel with the
1467 The grammar described by this specification is word-based. Except
1468 where noted otherwise, linear white space (LWS) can be included
1469 between any two adjacent words (token or quoted-string), and
1470 between adjacent words and separators, without changing the
1471 interpretation of a field. At least one delimiter (LWS and/or
1472 separators) MUST exist between any two tokens (for the definition
1473 of "token" below), since they would otherwise be interpreted as a
1478 The following rules are used throughout this specification to
1479 describe basic parsing constructs. The US-ASCII coded character set
1480 is defined by ANSI X3.4-1986 [USASCII].
1482 OCTET = <any 8-bit sequence of data>
1483 CHAR = <any US-ASCII character (octets 0 - 127)>
1484 UPALPHA = <any US-ASCII uppercase letter "A".."Z">
1485 LOALPHA = <any US-ASCII lowercase letter "a".."z">
1486 ALPHA = UPALPHA | LOALPHA
1487 DIGIT = <any US-ASCII digit "0".."9">
1488 CTL = <any US-ASCII control character
1489 (octets 0 - 31) and DEL (127)>
1490 CR = <US-ASCII CR, carriage return (13)>
1491 LF = <US-ASCII LF, linefeed (10)>
1492 SP = <US-ASCII SP, space (32)>
1493 HT = <US-ASCII HT, horizontal-tab (9)>
1494 <"> = <US-ASCII double-quote mark (34)>
1499 Leach & Newman Expires: October 2002 [Page 25]
1505 INTERNET DRAFT Digest SASL Mechanism April 2002
1508 All linear white space, including folding, has the same semantics as
1509 SP. A recipient MAY replace any linear white space with a single SP
1510 before interpreting the field value or forwarding the message
1513 LWS = [CRLF] 1*( SP | HT )
1515 The TEXT rule is only used for descriptive field contents and values
1516 that are not intended to be interpreted by the message parser. Words
1517 of *TEXT contains characters either from ISO-8859-1 [ISO 8859]
1521 TEXT = <any OCTET except CTLs,
1524 A CRLF is allowed in the definition of TEXT only as part of a header
1525 field continuation. It is expected that the folding LWS will be
1526 replaced with a single SP before interpretation of the TEXT value.
1528 Hexadecimal numeric characters are used in several protocol elements.
1530 HEX = "A" | "B" | "C" | "D" | "E" | "F"
1531 | "a" | "b" | "c" | "d" | "e" | "f" | DIGIT
1533 Many HTTP/1.1 header field values consist of words separated by LWS
1534 or special characters. These special characters MUST be in a quoted
1535 string to be used within a parameter value.
1537 token = 1*<any CHAR except CTLs or separators>
1538 separators = "(" | ")" | "<" | ">" | "@"
1539 | "," | ";" | ":" | "\" | <">
1540 | "/" | "[" | "]" | "?" | "="
1541 | "{" | "}" | SP | HT
1543 A string of text is parsed as a single word if it is quoted using
1546 quoted-string = ( <"> qdstr-val <"> )
1547 qdstr-val = *( qdtext | quoted-pair )
1548 qdtext = <any TEXT except <"> and "\">
1550 Note that LWS is NOT implicit between the double-quote marks (<">)
1551 surrounding a qdstr-val and the qdstr-val; any LWS will be considered
1552 part of the qdstr-val. This is also the case for quotation marks
1553 surrounding any other construct.
1559 Leach & Newman Expires: October 2002 [Page 26]
1565 INTERNET DRAFT Digest SASL Mechanism April 2002
1568 The backslash character ("\") MAY be used as a single-character
1569 quoting mechanism only within qdstr-val and comment constructs.
1571 quoted-pair = "\" CHAR
1573 The value of this construct is CHAR. Note that an effect of this rule
1574 is that backslash itself MUST be quoted.
1578 The sample implementation in [Digest] also applies to DIGEST-MD5.
1580 The following code implements the conversion from UTF-8 to 8859-1 if
1583 /* if the string is entirely in the 8859-1 subset of UTF-8, then
1584 * translate to 8859-1 prior to MD5
1586 void MD5_UTF8_8859_1(MD5_CTX *ctx, const unsigned char *base,
1589 const unsigned char *scan, *end;
1593 for (scan = base; scan < end; ++scan) {
1594 if (*scan > 0xC3) break; /* abort if outside 8859-1 */
1595 if (*scan >= 0xC0 && *scan <= 0xC3) {
1596 if (++scan == end || *scan < 0x80 || *scan > 0xBF)
1600 /* if we found a character outside 8859-1, don't alter string
1603 MD5Update(ctx, base, len);
1607 /* convert to 8859-1 prior to applying hash
1610 for (scan = base; scan < end && *scan < 0xC0; ++scan)
1612 if (scan != base) MD5Update(ctx, base, scan - base);
1613 if (scan + 1 >= end) break;
1614 cbuf = ((scan[0] & 0x3) << 6) | (scan[1] & 0x3f);
1615 MD5Update(ctx, &cbuf, 1);
1619 Leach & Newman Expires: October 2002 [Page 27]
1625 INTERNET DRAFT Digest SASL Mechanism April 2002
1629 } while (base < end);
1679 Leach & Newman Expires: October 2002 [Page 28]
1685 INTERNET DRAFT Digest SASL Mechanism April 2002
1688 9 Full Copyright Statement
1690 Copyright (C) The Internet Society (2002). All Rights Reserved.
1692 This document and translations of it may be copied and furnished to
1693 others, and derivative works that comment on or otherwise explain it
1694 or assist in its implementation may be prepared, copied, published
1695 and distributed, in whole or in part, without restriction of any
1696 kind, provided that the above copyright notice and this paragraph are
1697 included on all such copies and derivative works. However, this
1698 document itself may not be modified in any way, such as by removing
1699 the copyright notice or references to the Internet Society or other
1700 Internet organizations, except as needed for the purpose of
1701 developing Internet standards in which case the procedures for
1702 copyrights defined in the Internet Standards process must be
1703 followed, or as required to translate it into languages other than
1706 The limited permissions granted above are perpetual and will not be
1707 revoked by the Internet Society or its successors or assigns.
1709 This document and the information contained herein is provided on an
1710 "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
1711 TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
1712 BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
1713 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
1714 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
1718 Funding for the RFC Editor function is currently provided by the
1739 Leach & Newman Expires: October 2002 [Page 29]