GSS_S_PROMPTING_NEEDED is a bit
[cyrus-sasl.git] / doc / draft-newman-sasl-c-api-xx.txt
1
2
3
4
5
6
7 Network Working Group                                          C. Newman
8 Internet Draft: SASL C API                                      Innosoft
9 Document: draft-newman-sasl-c-api-01.txt                     A. Melnikov
10                                                          MessagingDirect
11                                                            February 2003
12                                                    Expires in six months
13
14
15              Simple Authentication and Security Layer C API
16
17
18 Status of this memo
19
20    This document is an Internet-Draft and is in full conformance with
21    all provisions of Section 10 of RFC2026 [RFC2026].
22
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.
26
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."
31
32    The list of current Internet-Drafts can be accessed at
33    http://www.ietf.org/ietf/1id-abstracts.txt
34
35    The list of Internet-Draft Shadow Directories can be accessed at
36    http://www.ietf.org/shadow.html.
37
38 Abstract
39
40    Almost every protocol needs authentication.  However, there does not
41    exist an authentication mechanism suitable for all organizations, nor
42    is it likely that a small fixed set of authentication mechanisms will
43    remain suitable.  SASL [SASL] provides the on-the-wire framework for
44    authentication (and a security layer) which separates the design of
45    authentication mechanisms from the protocols in which they're used.
46
47    The SASL protocol model suggests a software architecture where
48    application protocols call a generic API to authenticate which in
49    turn calls a generic plug-in interface for extensible authentication
50    modules.  This memo documents the API used in one implementation of
51    this architecture in the hope that it will be useful to others.  An
52    associated memo documenting the plug-in interface is forthcoming.
53
54 1.     Conventions Used in this Memo
55
56
57
58 Newman et al.             Expires: August 2003          FORMFEED[Page 1]
59
60
61
62
63
64 INTERNET DRAFT                 SASL C API                  February 2003
65
66
67    The key words "MUST", "MUST NOT", "SHOULD", "SHOULD NOT", and "MAY"
68    in this document are to be interpreted as defined in "Key words for
69    use in RFCs to Indicate Requirement Levels" [KEYWORDS].
70
71    This assumes familiarity the SASL [SASL] specification.
72
73  1.1.   Concepts
74
75    The following concepts are necessary to understand this
76    specification.
77
78 realm
79      A realm is a name (usually a domain-style name) associated with a
80      set of users on a server.  One realm may span multiple servers.
81      Alternatively, a single server may have multiple realms.  Thus
82      there may be multiple users with the username "chris" on the same
83      server, each in a different realm.  Some authentication mechanisms
84      have a special field for the realm (e.g., DIGEST-MD5).  For other
85      mechanisms, a realm can be specified by the client by using the
86      syntax "username@realm" in the username field.
87
88 service
89      A service is a basic function provided by one or more protocols.
90      The GSSAPI service name [GSSAPI] registry is available at:
91
92       <http://www.iana.org/numbers.html#G>
93
94      This registry is used by SASL and the SASL API. The service name
95      may be used for service-specific passwords for advanced users, or
96      advanced authentication mechanisms may restrict the services a
97      given server may offer.
98
99
100 virtual domain
101      When a single server has multiple realms and there is a DNS server
102      entry for each realm pointing to the same server IP address, then
103      those realms are "virtual domains".  Virtual domains are extremely
104      popular with web hosting services and are becoming more popular
105      with POP mail services.  The key to providing virtual domain sup-
106      port is that the client informs the server of the domain it
107      believes it is speaking to either through a special protocol ele-
108      ment or by using a username of the form "user@realm".
109
110
111 2.     Overview of the SASL C API
112
113    The SASL API is initialized once at process startup. The
114    sasl_server_init() and sasl_client_init() functions provide basic
115
116
117
118 Newman et al.             Expires: August 2003          FORMFEED[Page 2]
119
120
121
122
123
124 INTERNET DRAFT                 SASL C API                  February 2003
125
126
127    initialization.
128
129    When a network connection occurs where SASL will be used, a connec-
130    tion-specific context is created for authentication with
131    sasl_client_new() or sasl_server_new().  The API implementation must
132    support multi-threaded servers and clients by creating the connection
133    context in a thread-safe fashion permitting multiple contexts in a
134    given process.  At this point, the caller may adjust security policy
135    for the context, and the set of mechanisms which are enabled is
136    determined by requirements from the configuration or by the caller.
137
138    The server end of the API may request a list of enabled authentica-
139    tion mechanisms either in general or for a specific user.  The client
140    may either select a single mechanism or request a list from the
141    server (if the SASL profile for the protocol in question supports
142    that) and pass the list to the API for automated mechanism selection
143    by configured policy.
144
145    The SASL exchange begins with sasl_client_start() which determines if
146    one of the desired mechanisms is available on the client and may gen-
147    erate an initial client response.  The client then sends the appro-
148    priate protocol message to initiate the SASL exchange that the server
149    passes to sasl_server_start().
150
151    The SASL exchange continues with calls to sasl_client_step() and
152    sasl_server_step(), until the server indicates completion or the
153    client cancels the exchange.
154
155    The server queries the user name and user realm resulting from the
156    exchange with the sasl_getprop() routine.
157
158    A connection context is released with sasl_dispose() and process ter-
159    mination is indicated with sasl_done().
160
161    There are a number of utility functions and customization functions
162    available in the API for additional services.
163
164    Note, that all functions described in this documen can be implemented
165    as macroses, so an application using this API MUST NOT assume that
166    they are functions.
167
168    An application or library trying to use SASL API described in this
169    document must include "sasl.h" include file.
170
171 3.     Basic SASL API Routines
172
173    This section describes the types and functions likely to be used by
174    every caller of the SASL API.
175
176
177
178 Newman et al.             Expires: August 2003          FORMFEED[Page 3]
179
180
181
182
183
184 INTERNET DRAFT                 SASL C API                  February 2003
185
186
187  3.1.   Basic SASL API Data Structures
188
189    The following datastructures are basic to the SASL API.
190
191   3.1.1. sasl_callback_t
192
193    The sasl_callback_t structure is used for the caller of the SASL API
194    to provide services to both the core SASL API and SASL plug-ins via
195    callbacks.  The most important callback is the "getopt" callback (see
196    section 3.3.3) which is used to retrieve security policy option set-
197    tings from the caller's preferences.
198
199    typedef struct sasl_callback {
200        unsigned long id;
201        int (*proc)();
202        void *context;
203    } sasl_callback_t;
204
205    id is the label for the callback (XXX IANA registry needed), proc is
206    a function pointer whose exact type is determined by the id, and con-
207    text is a context variable which will be passed to the callback (usu-
208    ally as the first argument).  The last callback in the list of call-
209    backs is indicated with an id of SASL_CB_LIST_END.
210
211    If proc is NULL, this means that the application doesn't want to
212    specify a corresponding callback, but would provide the necessary
213    data via interaction.  See also section 3.1.4.
214
215   3.1.2. sasl_secret_t
216
217    The sasl_secret_t structure is used to hold text or binary passwords
218    for the client API.
219
220    typedef struct sasl_secret {
221        unsigned long len;
222        unsigned char data[1];
223    } sasl_secret_t;
224
225    The len field holds the length of the password, while the data field
226    holds the actual data.  The structure is variable sized: enough space
227    must be reserved after the data field to hold the desired password.
228    An additional that binary passwords are permitted to contain '\0'
229    characters.
230
231   3.1.3. sasl_conn_t
232
233    The sasl_conn_t data type is an opaque data type which reflects the
234    SASL context for a single server connection.  Only one SASL API call
235
236
237
238 Newman et al.             Expires: August 2003          FORMFEED[Page 4]
239
240
241
242
243
244 INTERNET DRAFT                 SASL C API                  February 2003
245
246
247    using a given sasl_conn_t as an argument may be active at a time.
248    However, each sasl_conn_t is independent and thus the SASL API may be
249    used in a true multi-processor multi-threaded environment.
250
251   3.1.4. sasl_interact_t
252
253    The sasl_interact_t structure is used by sasl_client_start and
254    sasl_client_step to request certain information from the application,
255    when the application did not provide corresponding callbacks. For
256    example, an application may choose to present a single dialog to the
257    user in order to collect all required information interactively.
258
259    typedef struct sasl_interact {
260        unsigned long id;
261        const char *challenge;
262        const char *prompt;
263        const char *defresult;
264        const void *result;
265        unsigned len;
266    } sasl_interact_t;
267
268    The id field holds the value of the callback ID. The prompt field
269    contains a string that should be presented to the user. If non-NULL,
270    challenge is a NUL-terminated string that will allow the user to pre-
271    sent a specific credential when prompted. This is different from the
272    prompt in that the prompt is more like a label for a text box (for
273    example "Response:" while challenge is a string that tells the user
274    what specifically is required by the response (for example, an OTP
275    challenge string). The defresult field contains a default value, if
276    any. Upon return from sasl_client_* the "result" field points to the
277    defresult. The client must present the information in the challenge
278    and the prompt to the user and store the result and its length in the
279    result and the len fields respectively.
280
281    For example, SASL_CB_PASS interaction may contain the following
282    information:
283     id - SASL_CB_PASS
284     challenge - NULL
285     prompt - "Password:"
286     defresult - NULL (no default).
287
288  3.2.   Basic SASL API Client Routines
289
290    This section discusses the functions likely to be used by every
291    client caller of the SASL API.
292
293   3.2.1. sasl_client_init function
294
295
296
297
298 Newman et al.             Expires: August 2003          FORMFEED[Page 5]
299
300
301
302
303
304 INTERNET DRAFT                 SASL C API                  February 2003
305
306
307 Arguments:
308             sasl_callback_t *callbacks
309
310 Results:
311             SASL_OK        -- Success
312             SASL_NOMEM     -- Not enough memory
313             SASL_BADVERS   -- Mechanism version mismatch
314             SASL_BADPARAM  -- Error in config file
315
316       This function initializes the client routines for the SASL API.
317
318       The callbacks argument is the default list of callbacks (see sec-
319       tion 3.1.1 for definition of sasl_callback_t structure) and SHOULD
320       include the sasl_getopt_t callback (see section 3.3.3). The call-
321       backs may be NULL.  On success, SASL_OK is returned, and on fail-
322       ure a SASL C API error code such as the ones listed above is
323       returned.  This function may be called a second time to change the
324       default callbacks used for new connections, but the first call
325       must be made in a single-threaded environment.  The data refer-
326       enced by the sasl_callback_t structure must persist until
327       sasl_done() is called.
328
329   3.2.2. sasl_client_new function
330
331 Arguments:
332             const char *service,
333             const char *server_name,
334             const char *iplocalport,
335             const char *ipremoteport,
336             const sasl_callback_t *prompt_supp,
337             unsigned int flags,
338             sasl_conn_t **pconn
339
340 Results:
341             SASL_OK        -- Success
342             SASL_NOTINIT   -- SASL API not initialized
343             SASL_NOMECH    -- No mechanisms available
344             SASL_NOMEM     -- Not enough memory
345
346       This function creates a client connection context variable.  As
347       long as each thread uses its own connection context, the SASL C
348       API is thread-safe.
349
350       The service argument is an IANA registered GSSAPI service element
351       as defined in section 1.1.  It MUST NOT be NULL.
352
353       The server_name is the host name or IP address of the server to
354       which the client is connecting. NULL may be used for server_name,
355
356
357
358 Newman et al.             Expires: August 2003          FORMFEED[Page 6]
359
360
361
362
363
364 INTERNET DRAFT                 SASL C API                  February 2003
365
366
367       but may result in advanced mechanisms such as Kerberos being
368       unavailable.
369
370       The iplocalport is the string with the client IPv4/IPv6 address,
371       followed by ":" and than by port number. An IPv6 address must be
372       enclosed in "[" and "]". NULL may be used for iplocalport, but may
373       result in mechanisms requiring IP address being unavailable.
374
375       The ipremoteport is the string with the server IPv4/IPv6 address,
376       followed by ":" and than by port number. An IPv6 address must be
377       enclosed in "[" and "]". NULL may be used for ipremoteport, but
378       may result in mechanisms requiring IP address being unavailable.
379
380       User input to the SASL C API may be provided in two ways: either
381       by supplying callbacks (prompt_supp) to this function, or by using
382       an interaction model with the sasl_client_start/sasl_client_step
383       functions. Callbacks are more convenient to obtain information
384       programmatically, such as pulling authentication information
385       directly from a configuration file. Interactions are more conve-
386       nient if one wants to get all the data in parallel, for example by
387       displaying a single dialog box instead of a separate popup for
388       authentication name, authorization, password, etc.
389
390       The prompt_supp is a list of supported user prompting callbacks
391       discussed in the section 3.1.1. The prompt_supp argument MAY be
392       NULL, which means that interactions (i.e. prompt_need parameter to
393       sasl_client_start (see 3.2.3) and sasl_client_step (see 3.2.4))
394       are used instead of callbacks. If prompt_supp is NULL, the
395       prompt_need argument to sasl_client_start (see 3.2.3) and
396       sasl_client_step (see 3.2.4) MUST NOT be NULL.
397
398       The flags argument represents client-supported security flags.
399       The only values currently supported are SASL_SECURITY_LAYER to
400       indicate the client supports the SASL security layer, or 0 to
401       indicate it doesn't.
402
403       The pconn argument is set to point to the newly created connection
404       context.  The sasl_conn_t type is opaque to the calling applica-
405       tion.
406
407   3.2.3. sasl_client_start function
408
409
410
411
412
413
414
415
416
417
418 Newman et al.             Expires: August 2003          FORMFEED[Page 7]
419
420
421
422
423
424 INTERNET DRAFT                 SASL C API                  February 2003
425
426
427 Arguments:
428             sasl_conn_t *conn,
429             const char *mechlist,
430             sasl_interact_t **prompt_need,
431             const char **clientout,
432             unsigned int *clientoutlen,
433             const char **mech
434
435 Results:
436             SASL_NOTINIT   -- SASL API not initialized
437             SASL_BADPARAM  -- conn or mechlist is NULL
438             SASL_NOMECH    -- No matching mechanisms available
439             SASL_NOMEM     -- Not enough memory
440             SASL_INTERACT  -- User interaction needed to continue
441                               (see prompt_need description below)
442             SASL_OK        -- Success
443
444       This selects an authentication mechanism to use and optionally
445       generates an initial client response.
446
447       The conn argument is the connection context from sasl_client_new.
448
449       The mechlist argument is a '\0' terminated string containing one
450       or more SASL mechanism names.  All characters in the string that
451       are not permitted in a SASL mechanism name [SASL] are ignored
452       except for the purposes of delimiting mechanism names (this per-
453       mits passing direct results from many protocol capability lists
454       unparsed).  Unknown mechanism names are ignored (although
455       SASL_NOMECH is returned if no known mechanisms are found).  Mecha-
456       nisms are tried in an implementation-dependent order. Implementa-
457       tions SHOULD try to use the most secure mechanism possible, within
458       the constraints specified by the application (e.g. SSF value).
459
460       For applications which support interactions, the prompt_need argu-
461       ment should initially point to a NULL pointer. If the selected
462       mechanism needs information from the user (for example, username
463       or password), then prompt_need will be set to point to an array of
464       sasl_interact_t structures (terminated by an entry with id equal
465       to SASL_CB_LIST_END), and sasl_client_start will return
466       SASL_INTERACT.  After that the client must fill in the requested
467       information and call this function again with the same parameters.
468
469       Applications that do not support interactions MUST pass NULL for
470       prompt_need.
471
472       The clientout and clientoutlen parameters are set to the initial
473       client response, if any.  If a protocol's SASL profile uses base64
474       encoding, this represents the data prior to the encoding (see
475
476
477
478 Newman et al.             Expires: August 2003          FORMFEED[Page 8]
479
480
481
482
483
484 INTERNET DRAFT                 SASL C API                  February 2003
485
486
487       sasl_encode64).  If a protocol's SASL profile doesn't include an
488       optional initial client response, then these may be NULL and 0
489       respectively. The memory used by clientout is interally managed by
490       the SASL API and may be overwritten on the next call to
491       sasl_client_step or a call to sasl_dispose.
492
493       The mech argument is set to point to a '\0' terminated string
494       specifying the mechanism actually selected using all uppercase
495       letters.  It may be NULL if the client does not care which mecha-
496       nism was selected from mechlist.
497
498       If sasl_client_start is called a second time using the same con-
499       nection context, it will discard any cached information (e.g., the
500       username and password) and restart the exchange from the begin-
501       ning. <<???>>
502
503   3.2.4. sasl_client_step function
504
505 Arguments:
506             sasl_conn_t *conn,
507             const char *serverin,
508             unsigned int serverinlen,
509             sasl_interact_t **prompt_need,
510             const char **clientout,
511             unsigned int *clientoutlen
512
513 Results:
514             SASL_NOTINIT     -- SASL API not initialized
515             SASL_NOMECH      -- sasl_client_start not called
516             SASL_BADPROT     -- server protocol incorrect/cancelled
517             SASL_BADSERV     -- server failed mutual auth
518             SASL_INTERACT    -- user interaction needed
519             SASL_OK          -- success
520
521       This routine performs one step in an authentication sequence.
522
523       The conn argument must be a connection context created by
524       sasl_client_new and used in a previous call to sasl_client_start.
525
526       The serverin and serverinlen parameters hold the SASL octet string
527       received from the server.  Note that for those SASL profiles which
528       base64 encode the exchange, this is the result after the removal
529       of the base64 encoding (see the sasl_decode64 routine below). The
530       serverin MUST have a terminating NUL character not counted by
531       serverinlen
532
533       The prompt_need argument is the same as for sasl_client_start.
534
535
536
537
538 Newman et al.             Expires: August 2003          FORMFEED[Page 9]
539
540
541
542
543
544 INTERNET DRAFT                 SASL C API                  February 2003
545
546
547       The clientout and clientoutlen parameters hold the SASL octet
548       string to encode (if necessary) and send to the server.
549
550  3.3.   Basic SASL API Callback Routines
551
552       This section describes the basic callback functions needed for a
553       simple client implementation.  See the definition of sasl_call-
554       back_t in section 3.1.1 for a description of the basic callback
555       structure.
556
557   3.3.1. sasl_getsimple_t
558
559 Arguments:
560             void *context,
561             int id,
562             const char **result,
563             unsigned *len
564
565 Results:
566             SASL_OK          -- success
567             SASL_FAIL        -- error
568
569       This callback is used by the SASL API to request a simple constant
570       string from the application.  This is used with id SASL_CB_USER
571       for the username, SASL_CB_AUTHNAME for the authentication name (if
572       different), and SASL_CB_LANGUAGE for a comma separated list of RFC
573       1766 language tags.
574
575       The context is the context variable from the sasl_callback_t
576       structure, the id is the id from the sasl_callback_t structure,
577       and the callback is expected to set the result to a constant
578       string and the len to the length of that string.  The result and
579       len parameters are never NULL.
580
581   3.3.2. sasl_getsecret_t
582
583 Arguments:
584             sasl_conn_t *conn,
585             void *context,
586             int id,
587             sasl_secret_t **psecret
588
589 Results:
590             SASL_OK          -- success
591             SASL_FAIL        -- error
592
593       This callback is expected to create, prompt or locate a secret and
594       set it in the connection context with sasl_setprop.  The conn
595
596
597
598 Newman et al.             Expires: August 2003         FORMFEED[Page 10]
599
600
601
602
603
604 INTERNET DRAFT                 SASL C API                  February 2003
605
606
607       argument is the connection context, the context and id parameters
608       are from the sasl_callback_t structure. The id SASL_CB_PASS is
609       used to request a clear text password.
610
611   3.3.3. sasl_getopt_t
612
613 Arguments:
614             void *context,
615             const char *plugin_name,
616             const char *option,
617             const char **result,
618             unsigned int *len
619
620 Results:
621             SASL_OK          -- success
622             SASL_FAIL        -- error
623
624       This callback is used by the SASL API to read options from the
625       application.  This allows a SASL configuration to be encapsulated
626       in the caller's configuration system. Configuration items may be
627       mechanism-specific and are arbitrary strings. If the application
628       does not provide a sasl_getopt_t callback, then the API MAY obtain
629       configuration information from other sources, for example from a
630       config file.
631
632       The context is the context variable from the sasl_callback_t
633       structure, the plugin_name is the name of plugin (or NULL), the
634       option is the option name, and the callback is expected to set the
635       result to a string valid till next call to sasl_getopt_t in the
636       same thread and the len to the length of that string.  The result
637       and len parameters are never NULL. If the name of plugin is NULL,
638       a general SASL option is requested, otherwise a plugin specific
639       version.
640
641  3.4.   Basic SASL C API Utility Routines
642
643       This section describes utility functions provided as part of the
644       SASL API which may be used both by clients and servers.
645
646   3.4.1. sasl_decode64 function
647
648
649
650
651
652
653
654
655
656
657
658 Newman et al.             Expires: August 2003         FORMFEED[Page 11]
659
660
661
662
663
664 INTERNET DRAFT                 SASL C API                  February 2003
665
666
667 Arguments:
668             const char *in,
669             unsigned int inlen,
670             char *out,
671             unsigned int outmax,
672             unsigned int *outlen
673
674 Results:
675             SASL_BUFOVER    -- output buffer too small
676             SASL_BADPROT    -- invalid base64 string
677             SASL_OK         -- successful decode
678
679       This utility routine converts a base64 string of length inlen
680       pointed by in into an octet string. It is useful for SASL profiles
681       which use base64 such as the IMAP [IMAP4] and POP [POP-AUTH] pro-
682       files.  The output is copied to the buffer specified by the out
683       parameter.  It is NUL terminated and the length of the output is
684       placed in the outlen parameter if outlen is non-NULL. The lenght
685       doesn't include the terminating NUL character.
686
687       When the size of the output buffer, as specified by outmax, is too
688       small, the function returns SASL_BUFOVER error code and the
689       required length is stored in the outlen parameter if it is not
690       NULL.
691
692       The function may also return SASL_BADPROT error code when it
693       encounters an invalid base64 character.
694
695   3.4.2. sasl_encode64 function
696
697 Arguments:
698             const char *in,
699             unsigned int inlen,
700             char *out,
701             unsigned int outmax,
702             unsigned int *outlen
703
704 Results:
705             SASL_BUFOVER    -- output buffer too small
706             SASL_OK         -- successful decode
707
708       This utility routine converts an octet string of length inlen
709       pointed by in into a base64 string. It is useful for SASL profiles
710       which use base64 such as the IMAP [IMAP4] and POP [POP-AUTH] pro-
711       files.
712
713       The output is copied to the buffer specified by the out parameter.
714       It is NUL terminated and the length of the output is placed in the
715
716
717
718 Newman et al.             Expires: August 2003         FORMFEED[Page 12]
719
720
721
722
723
724 INTERNET DRAFT                 SASL C API                  February 2003
725
726
727       outlen parameter if outlen is non-NULL. The lenght doesn't include
728       the terminating NUL character.
729
730       When the size of the output buffer, as specified by outmax, is too
731       small, the function returns SASL_BUFOVER error code and the
732       required length is stored in the outlen parameter if it is not
733       NULL.
734
735   3.4.3. sasl_errstring function
736
737 Arguments:
738             int saslerr,
739             const char *langlist,
740             const char **outlang
741
742 Results:
743             const char *
744
745       This converts a SASL error number into a constant string.  The
746       second argument MAY be NULL for the default language, or a comma-
747       separated list of RFC 1766 language tags.  The final parameter is
748       set to the RFC 1766 language tag of the string returned which will
749       be "i-default" if no matching language is found.  The strings are
750       UTF-8.  This requires no context so it may be used for the result
751       of an sasl_*_init or sasl_*_new result code.
752
753   3.4.4. sasl_errdetail function
754
755 Arguments:
756             sasl_conn_t *conn
757
758 Results:
759             const char *
760
761       This converts the last SASL error code that occured on a connec-
762       tion to UTF8 string. It uses the SASL_CB_LANGUAGE callback (see
763       section 3.3.1) to determine the language to use. It may return
764       more detailed information than sasl_errstring does.
765
766   3.4.5. sasl_seterror function
767
768
769
770
771
772
773
774
775
776
777
778 Newman et al.             Expires: August 2003         FORMFEED[Page 13]
779
780
781
782
783
784 INTERNET DRAFT                 SASL C API                  February 2003
785
786
787 Arguments:
788             sasl_conn_t *conn
789             unsigned flags,
790             const char *fmt,
791              ...
792
793 Results:
794             none
795
796       This function sets sets the error string which will be returned by
797       sasl_errdetail.  It uses syslog()-style formatting (i.e. printf-
798       style with %m as the string form of an errno error).
799
800       Messages should be sensitive to the current language setting. If
801       there is no SASL_CB_LANGUAGE callback for the connection, text
802       MUST be in US-ASCII.  Otherwise UTF-8 is used and use of RFC 2482
803       for mixed-language text is encouraged.
804
805       <<This will also trigger a call to the SASL logging callback (if
806       any) with a level of SASL_LOG_FAIL unless the SASL_NOLOG flag is
807       set.>>
808
809       This function may be used by server callbacks.
810
811       If conn is NULL, the function does nothing.
812
813   3.4.6. sasl_erasebuffer function
814
815 Arguments:
816             char *buf,
817             unsigned len
818
819 Results:
820             none
821
822       This function fills the buffer buf of the lenght len with '\0'
823       characters.  The function may be used to clear from memory sensi-
824       tive informations, like passwords.
825
826  3.5.   Basic SASL C API Server Routines
827
828       This section describes the basic routines for a server implementa-
829       tion of a SASL profile.
830
831   3.5.1. sasl_server_init function
832
833
834
835
836
837
838 Newman et al.             Expires: August 2003         FORMFEED[Page 14]
839
840
841
842
843
844 INTERNET DRAFT                 SASL C API                  February 2003
845
846
847 Arguments:
848             const sasl_callback_t *callbacks,
849             const char *appname
850
851 Results:
852             SASL_BADPARAM     -- error in config file
853             SASL_NOMEM        -- out of memory
854             SASL_BADVERS      -- Plug-in version mismatch
855             SASL_OK           -- success
856
857       This function initializes the server routines for the SASL C API.
858
859       The callbacks argument is the default list of callbacks (see sec-
860       tion 3.1.1 for definition of sasl_callback_t structure) and SHOULD
861       include the sasl_getopt_t callback (see section 3.3.3). The call-
862       backs may be NULL. The appname argument is the name of the calling
863       application and may be used by server plug-ins for logging.  On
864       success, SASL_OK is returned, and on failure a SASL C API error
865       code is returned.  This function may be called a second time to
866       change the default callbacks, but the first call must be made in a
867       single-threaded environment. The data referenced by the
868       sasl_callback_t structure must persist until sasl_done() is
869       called.
870
871       appname specifies the application name. SASL API may use it, for
872       example, for logging or to read an application specific configura-
873       tion. A library must pass NULL as appname.  appname can be also be
874       set with sasl_setprop function, and can be queried with sasl_get-
875       prop. <<Specify option name here>>
876
877   3.5.2. sasl_server_new function
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898 Newman et al.             Expires: August 2003         FORMFEED[Page 15]
899
900
901
902
903
904 INTERNET DRAFT                 SASL C API                  February 2003
905
906
907 Arguments:
908             const char *service,
909             const char *serverFQDN,
910             const char *user_realm,
911             const char *iplocalport,
912             const char *ipremoteport,
913             const sasl_callback_t *callbacks,
914             unsigned int flags,
915             sasl_conn_t **pconn
916
917 Results:
918             SASL_OK        -- success
919             SASL_NOTINIT   -- SASL API not initialized
920             SASL_BADPARAM  -- Invalid parameter supplied
921             SASL_NOMECH    -- No mechanisms available
922             SASL_NOMEM     -- Not enough memory
923
924       This function creates a server connection context variable.  As
925       long as each thread uses its own connection context, the SASL C
926       API is thread-safe.
927
928       The service argument is an IANA registered GSSAPI service element
929       as defined in section 1.1. It MUST NOT be NULL.
930
931       The serverFQDN is the fully qualified name of the server. It MUST
932       NOT be NULL.
933
934       The user_realm specifies the default realm. A realm defines a set
935       of users on the system for systems which support multiple user
936       communities ("realms"). If user_realm is NULL, the value of
937       serverFQDN is used as the default realm.
938
939       The iplocalport is the string with the server IPv4/IPv6 address,
940       followed by ":" and than by port number. An IPv6 address must be
941       enclosed in "[" and "]". NULL may be used for iplocalport, but may
942       result in mechanisms requiring IP address being unavailable.
943
944       The ipremoteport is the string with the client IPv4/IPv6 address,
945       followed by ":" and than by port number. An IPv6 address must be
946       enclosed in "[" and "]". NULL may be used for ipremoteport, but
947       may result in mechanisms requiring IP address being unavailable.
948
949       The callbacks argument is a set of server callbacks which may
950       include a connection-specific sasl_getopt_t and/or an authoriza-
951       tion routine.
952
953       The flags argument represents server-supported security flags. The
954       only values currently supported are SASL_SECURITY_LAYER to
955
956
957
958 Newman et al.             Expires: August 2003         FORMFEED[Page 16]
959
960
961
962
963
964 INTERNET DRAFT                 SASL C API                  February 2003
965
966
967       indicate the server supports the SASL security layer, or 0 to
968       indicate it doesn't.
969
970       The pconn argument is set to point to the newly created connection
971       context.
972
973   3.5.3. sasl_server_start function
974
975 Arguments:
976             sasl_conn_t *conn,
977             const char *mech,
978             const char *clientin,
979             insigned int clientinlen,
980             const char **serverout,
981             unsigned int *serveroutlen
982
983 Results:
984             SASL_CONTINUE  -- Another authentication step required
985             SASL_OK        -- Authentication Complete
986             SASL_NOTINIT   -- SASL API not initialized
987             SASL_BADPARAM  -- Invalid parameter supplied
988             SASL_BADPROT   -- Client protocol error
989             SASL_NOMECH    -- Mechanism not supported
990             SASL_NOVERIFY  -- User exists, but no verifier exists for
991                               the mechanism
992             SASL_TRANS     -- A password transition is needed to use mechanism
993
994       This begins an authentication exchange and is called after the
995       client sends the initial authentication command.  The mech argu-
996       ment is the mechanism name the client is requesting.  If the
997       client includes an optional initial-response, it is passed in the
998       clientin and clientinlen fields.  Otherwise NULL and 0 are passed
999       for those arguments. The serverout and serveroutlen are filled in
1000       with the server response, if any.  If SASL_CONTINUE is returned,
1001       the server will need to wait for another client message and call
1002       sasl_server_step.  If SASL_OK is returned, the authentication is
1003       completed successfully, although server out data may be supplied.
1004
1005   3.5.4. sasl_server_step function
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018 Newman et al.             Expires: August 2003         FORMFEED[Page 17]
1019
1020
1021
1022
1023
1024 INTERNET DRAFT                 SASL C API                  February 2003
1025
1026
1027 Arguments:
1028             sasl_conn_t *conn,
1029             const char *clientin,
1030             insigned int clientinlen,
1031             const char **serverout,
1032             unsigned int *serveroutlen
1033
1034 Results:
1035             SASL_CONTINUE  -- Another authentication step required
1036             SASL_OK        -- Authentication Complete
1037             SASL_NOTINIT   -- SASL API not initialized
1038             SASL_NOMECH    -- sasl_server_start not called
1039             SASL_BADPARAM  -- Invalid parameter supplied
1040             SASL_BADPROT   -- Client protocol error
1041             SASL_NOVERIFY  -- User exists, but no verifier exists for
1042                               the mechanism
1043             SASL_TRANS     -- A password transition is needed to use mechanism
1044
1045       This routine performs one step in an authentication sequence.
1046
1047       The conn argument must be a connection context created by
1048       sasl_server_new and used in a previous call to sasl_server_start.
1049
1050       The clientin and clientinlen parameters hold the SASL octet string
1051       received from the client.  Note that for those SASL profiles which
1052       base64 encode the exchange, this is the result after the removal
1053       of the base64 encoding (see the sasl_decode64 routine). The cli-
1054       entin MUST have a terminating NUL character not counted by
1055       serverinlen.
1056
1057       The serverout and serveroutlen parameters hold the SASL octet
1058       string to encode (if necessary) and send to the client. If
1059       SASL_CONTINUE is returned, the server will need to wait for
1060       another client message and call sasl_server_step.  If SASL_OK is
1061       returned, the authentication is completed successfully, although
1062       server out data may be supplied.
1063
1064  3.6.   Common SASL API Routines
1065
1066       This section describes the routines that are common to both
1067       clients and servers.
1068
1069   3.6.1. sasl_listmech function
1070
1071
1072
1073
1074
1075
1076
1077
1078 Newman et al.             Expires: August 2003         FORMFEED[Page 18]
1079
1080
1081
1082
1083
1084 INTERNET DRAFT                 SASL C API                  February 2003
1085
1086
1087 Arguments:
1088             sasl_conn_t *conn,
1089             const char *user,
1090             const char *prefix,
1091             const char *sep,
1092             const char *suffix,
1093             char **result,
1094             unsigned int *plen,
1095             unsigned *pcount
1096
1097 Results:
1098             SASL_OK        -- Success
1099             SASL_NOMEM     -- Not enough memory
1100             SASL_NOMECH    -- No enabled mechanisms
1101
1102       This returns a list of enabled SASL mechanisms in a NUL-terminated
1103       string.  The list is constructed by placing the prefix string at
1104       the beginning, placing the sep string between any pair of mecha-
1105       nisms and placing the suffix string at the end.
1106
1107       When calling this function plen and pcount MAY be NULL.
1108
1109       This function returns the list of client side SASL mechanisms, if
1110       the conn was created by sasl_client_new and the list of server
1111       side mechanisms, if the conn was created by sasl_server_new. The
1112       list returned by this function must persist till a next call to
1113       sasl_free_listmech or sasl_listmech.
1114
1115   3.6.2. sasl_free_listmech function
1116
1117 Arguments:
1118             sasl_conn_t *conn,
1119             char **result
1120
1121 Results:
1122             none
1123
1124       This disposes of the result string returned by sasl_listmech.
1125
1126   3.6.3. sasl_setprop function
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138 Newman et al.             Expires: August 2003         FORMFEED[Page 19]
1139
1140
1141
1142
1143
1144 INTERNET DRAFT                 SASL C API                  February 2003
1145
1146
1147 Arguments:
1148             sasl_conn_t *conn,
1149             int propnum,
1150             const void *value
1151
1152 Results:
1153             SASL_OK          -- property set
1154             SASL_BADPARAM    -- invalid propnum or value
1155             SASL_NOMEM       -- not enough memory to perform operation
1156
1157       This sets a property in a connection context. Commonly used prop-
1158       erties with their descriptions are listed below:
1159
1160       SASL_SSF_EXTERNAL
1161
1162       Security layer strength factor (SSF) -- an unsigned integer usable
1163       by the caller to specify approximate security layer strength
1164       desired. It roughly corresponds to the effective key length for
1165       encryption, e.g.
1166        0   = no protection
1167        1   = integrity protection only >1   = key lenght of the cipher
1168
1169       SASL_SSF_EXTERNAL property denotes SSF of the external security
1170       layer (e.g.  provided by TLS). The value parameter points to
1171       sasl_ssf_t, that is described as follows:
1172
1173       typedef unsigned sasl_ssf_t;
1174
1175
1176
1177       SASL_SEC_PROPS
1178
1179       The value parameter for SASL_SEC_PROPS points to sasl_secu-
1180       rity_properties_t structure defined below. A particular implemen-
1181       tation may extend it with additional fields.
1182
1183       typedef struct sasl_security_properties
1184       {
1185           sasl_ssf_t min_ssf;
1186           sasl_ssf_t max_ssf;
1187
1188           unsigned maxbufsize;
1189
1190           /* bitfield for attacks to protect against */
1191           unsigned security_flags;
1192       } sasl_security_properties_t;
1193
1194       The min_ssf and the max_ssf define the minimal and the maximal
1195
1196
1197
1198 Newman et al.             Expires: August 2003         FORMFEED[Page 20]
1199
1200
1201
1202
1203
1204 INTERNET DRAFT                 SASL C API                  February 2003
1205
1206
1207       acceptable SSF.
1208
1209       The maxbufsize specifies the biggest buffer size that the
1210       client/server is able to decode. 0 means that security layer is
1211       not supported.
1212
1213       The security_flags is a bitmask of the various security flags
1214       described below:
1215
1216        SASL_SEC_NOPLAINTEXT          -- don't permit mechanisms susceptible to simple
1217                                         passive attack (e.g., PLAIN, LOGIN)
1218        SASL_SEC_NOACTIVE             -- protection from active (non-dictionary) attacks
1219                                         during authentication exchange.
1220                                         Authenticates server.
1221        SASL_SEC_NODICTIONARY         -- don't permit mechanisms susceptible to passive
1222                                         dictionary attack
1223        SASL_SEC_FORWARD_SECRECY      -- require forward secrecy between sessions
1224                                         (breaking one won't help break next)
1225        SASL_SEC_NOANONYMOUS          -- don't permit mechanisms that allow anonymous login
1226        SASL_SEC_PASS_CREDENTIALS     -- require mechanisms which pass client
1227                                         credentials, and allow mechanisms which can pass
1228                                         credentials to do so
1229        SASL_SEC_MUTUAL_AUTH          -- require mechanisms which provide mutual
1230                                         authentication
1231
1232       SASL_AUTH_EXTERNAL
1233
1234       The value parameter for SASL_AUTH_EXTERNAL property points to the
1235       external authentication ID as provided by external authentication
1236       method, e.g. TLS, PPP or IPSec.
1237
1238   3.6.4. sasl_getprop function
1239
1240 Arguments:
1241             sasl_conn_t *conn,
1242             int propnum,
1243             const void **pvalue
1244
1245 Results:
1246             SASL_OK        -- Success
1247             SASL_NOTDONE   -- Authentication exchange must complete prior to
1248                               retrieving this attribute
1249             SASL_BADPARAM  -- bad property number
1250
1251       This requests a pointer to a constant property available through
1252       the SASL API.  The most common use by servers is to get the
1253       SASL_USERNAME property which returns the authorization identity
1254       (user to login as) from the SASL mechanism as a UTF-8 string in
1255
1256
1257
1258 Newman et al.             Expires: August 2003         FORMFEED[Page 21]
1259
1260
1261
1262
1263
1264 INTERNET DRAFT                 SASL C API                  February 2003
1265
1266
1267       the pvalue parameter.  Additional properties are listed in section
1268       6.
1269
1270   3.6.5. sasl_dispose function
1271
1272 Arguments:
1273             sasl_conn_t **pconn
1274
1275 Results:
1276             none
1277
1278       This function disposes of the connection state created with
1279       sasl_client_new or sasl_server_new, and sets the pointer to NULL.
1280       If the pconn is already NULL the function does nothing.
1281
1282   3.6.6. sasl_done function
1283
1284 Arguments:
1285             none
1286
1287 Results:
1288             none
1289
1290       A SASL application that is finished with the SASL API must call
1291       this function.  This function frees any memory allocated by the
1292       SASL library or any other library state. After this call most of
1293       the SASL API function will again return the SASL_NOTINIT error
1294       code.
1295
1296       There must be a call to sasl_done for every successful call to
1297       sasl_server_init or sasl_client_init made. Only the final
1298       sasl_done does the actual cleanup; the preceding calls simply
1299       decrement an internal reference count.
1300
1301       Connection states MUST be disposed of with sasl_dispose before
1302       calling this function.
1303
1304 4.     SASL Security Layer Routines
1305
1306       This section describes the routines need to support a security
1307       layer.
1308
1309  4.1. sasl_encode function
1310
1311
1312
1313
1314
1315
1316
1317
1318 Newman et al.             Expires: August 2003         FORMFEED[Page 22]
1319
1320
1321
1322
1323
1324 INTERNET DRAFT                 SASL C API                  February 2003
1325
1326
1327 Arguments:
1328             sasl_conn_t *conn,
1329             const char *input,
1330             unsigned int inputlen,
1331             const char **output,
1332             unsigned int *outputlen
1333
1334 Results:
1335             SASL_OK        -- Success (returns input if no layer negotiated)
1336             SASL_NOTDONE   -- Security layer negotiation not finished
1337             SASL_BADPARAM  -- inputlen is greater than the SASL_MAXOUTBUF property
1338
1339       This function encodes a block of data for transmission using secu-
1340       rity layer (if any). The output and outputlen are filled in with
1341       the encoded data and its length respectively. If there is no secu-
1342       rity layer the input buffer is returned in the output. Otherwise,
1343       the output is only valid until a next call to sasl_encode or
1344       sasl_dispose.
1345
1346  4.1. sasl_decode function
1347
1348 Arguments:
1349             sasl_conn_t *conn,
1350             const char *input,
1351             unsigned int inputlen,
1352             const char **output,
1353             unsigned int *outputlen
1354
1355 Results:
1356             SASL_OK        -- Success (returns input if no layer negotiated)
1357             SASL_NOTDONE   -- Security layer negotiation not finished
1358             SASL_BADMAC    -- Bad message integrity check
1359
1360       This function decodes a block of data received using security
1361       layer (if any). The output and outputlen are filled in with the
1362       decoded data and its length respectively. If there is no security
1363       layer the input buffer is returned in the output. Otherwise, the
1364       output is only valid until a next call to sasl_decode or sasl_dis-
1365       pose.
1366
1367 5.     Advanced SASL API Routines
1368
1369       This section describes the less frequently used functions avail-
1370       able in the SASL API.
1371
1372  5.1.   Additional Initialization Routines
1373
1374   5.1.1. sasl_set_mutex function
1375
1376
1377
1378 Newman et al.             Expires: August 2003         FORMFEED[Page 23]
1379
1380
1381
1382
1383
1384 INTERNET DRAFT                 SASL C API                  February 2003
1385
1386
1387 Arguments:
1388             sasl_mutex_alloc_t  *mutex_alloc,
1389             sasl_mutex_lock_t   *mutex_lock,
1390             sasl_mutex_unlock_t *mutex_unlock,
1391             sasl_mutex_free_t   *mutex_free
1392
1393 Results:
1394             None
1395
1396       The sasl_set_mutex call sets the callbacks which the SASL API and
1397       plug-ins will use whenever exclusive access to a process shared
1398       resource is needed.  A single-threaded client or server need not
1399       call this.  The types are designed to be compatible with the LDAP
1400       API [LDAP-API]:
1401
1402       typedef void *sasl_mutex_alloc_t(void);
1403
1404       On success, this returns a pointer to an allocated and initialized
1405       mutex structure.  On failure, it returns NULL.
1406
1407       typedef int sasl_mutex_lock_t(void *mutex);
1408
1409       This will block the current thread until it is possible to get an
1410       exclusive lock on a mutex allocated by the mutex_alloc callback.
1411       On success it returns 0, on failure due to deadlock or bad parame-
1412       ter, it returns -1.
1413
1414       typedef int sasl_mutex_unlock_t(void *mutex);
1415
1416       This releases a lock on a mutex allocated by the mutex_alloc call-
1417       back.  On success it returns 0, on failure due to an already
1418       unlocked mutex, or bad parameter, it returns -1.
1419
1420       typedef void sasl_mutex_free_t(void *mutex);
1421
1422       This disposes of a mutex allocated by mutex_alloc.
1423
1424   5.1.2. sasl_set_alloc function
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438 Newman et al.             Expires: August 2003         FORMFEED[Page 24]
1439
1440
1441
1442
1443
1444 INTERNET DRAFT                 SASL C API                  February 2003
1445
1446
1447 Arguments:
1448             sasl_malloc_t  *malloc,
1449             sasl_calloc_t  *calloc,
1450             sasl_realloc_t *realloc,
1451             sasl_free_t    *free
1452
1453 Results:
1454             None
1455
1456       This sets the memory allocation functions which the SASL API will
1457       use.  The SASL API will use its own routines (usually the standard
1458       C library) if these are not set.
1459
1460       typedef void *sasl_malloc_t(unsigned long mem_size);
1461
1462       This allocates memory mem_size bytes of memory.  The memory is not
1463       initialized to any particular value.  It returns NULL on a fail-
1464       ure, or when mem_size is 0.
1465
1466       typedef void *sasl_calloc_t(unsigned long elem_size,
1467                       unsigned long num_elem);
1468
1469       This allocates elem_size * num_elem bytes of memory.  The memory
1470       is initialized to 0.  It returns NULL on a failure or when either
1471       elem_size and/or num_elem is 0.
1472
1473       typedef void *sasl_realloc_t(void *mem_ptr, unsigned long
1474       new_size);
1475
1476       This changes the size of a memory block previously allocated by
1477       malloc or calloc, and returns a pointer to the new location (which
1478       may be different from mem_ptr).  If mem_ptr is NULL, it is identi-
1479       cal to the malloc function.
1480
1481       It returns NULL on a failure or when new_size is 0. On failure the
1482       original block is unchanged. When new_size is 0 the function works
1483       as the free function.
1484
1485       typedef void sasl_free_t(void *mem_ptr);
1486
1487       This releases the memory in mem_ptr that was allocated by the mal-
1488       loc or the calloc or resized by the realloc. If mem_ptr is NULL,
1489       the function does nothing and returns immediately. The contents of
1490       the memory may be altered by this call.
1491
1492 6.     Additional Properties
1493
1494       <<To be completed>>
1495
1496
1497
1498 Newman et al.             Expires: August 2003         FORMFEED[Page 25]
1499
1500
1501
1502
1503
1504 INTERNET DRAFT                 SASL C API                  February 2003
1505
1506
1507       SASL_SSF          -- security layer security strength factor,
1508                            if 0, call to sasl_encode, sasl_decode unnecessary
1509       SASL_MAXOUTBUF    -- security layer max output buf unsigned
1510       SASL_DEFUSERREALM -- default realm passed to sasl_server_new or set with
1511                            sasl_setprop
1512       SASL_GETOPTCTX    -- context for getopt callback
1513       SASL_CALLBACK     -- current callback function list
1514       SASL_IPLOCALPORT  -- iplocalport string passed to sasl_server_new/
1515                            sasl_client_new
1516       SASL_IPREMOTEPORT -- ipremoteport string passed to sasl_server_new/
1517                            sasl_client_new
1518       SASL_SERVICE      -- service passed to sasl_*_new
1519       SASL_SERVERFQDN   -- serverFQDN passed to sasl_*_new
1520       SASL_AUTHSOURCE   -- name of the active plugin, if any
1521       SASL_MECHNAME     -- active SASL mechanism name, if any
1522       SASL_AUTHUSER     -- authentication/admin user (authorization id?)
1523
1524 7.     References
1525
1526       [IMAP4] Crispin, M., "Internet Message Access Protocol - Version
1527       4rev1", RFC 2060, University of Washington, December 1996.
1528
1529       [KEYWORDS] Bradner, "Key words for use in RFCs to Indicate
1530       Requirement Levels", RFC 2119, Harvard University, March 1997.
1531
1532       [POP3] Myers, J., Rose, M., "Post Office Protocol - Version 3",
1533       RFC 1939, Carnegie Mellon, Dover Beach Consulting, Inc., May 1996.
1534
1535       [POP-AUTH] Myers, "POP3 AUTHentication command", RFC 1734,
1536       Carnegie Mellon, December 1994.
1537
1538       [SASL] Myers, "Simple Authentication and Security Layer (SASL)",
1539       RFC 2222, Netscape Communications, October 1997.
1540
1541       [GSSAPI]
1542
1543 8.    Acknowledgements
1544
1545       The editor would like to thank Rob Siemborski and Ken Murchison
1546       for providing useful feedback and suggestions.
1547
1548 9.    Author's and Editor's Addresses
1549
1550
1551      Author:
1552
1553      Chris Newman
1554      Innosoft International, Inc.
1555
1556
1557
1558 Newman et al.             Expires: August 2003         FORMFEED[Page 26]
1559
1560
1561
1562
1563
1564 INTERNET DRAFT                 SASL C API                  February 2003
1565
1566
1567      1050 Lakes Drive
1568      West Covina, CA 91790 USA
1569
1570      Email: chris.newman@innosoft.com
1571
1572
1573      Editor:
1574
1575      Alexey Melnikov
1576      ACI WorldWide/MessagingDirect
1577      59 Clarendon Road
1578      Watford, Hertfordshire, WD17 1FQ, UK
1579
1580      Email: mel@messagingdirect.com
1581
1582
1583 10.    Full Copyright Statement
1584
1585    Copyright (C) The Internet Society (2003).  All Rights Reserved.
1586
1587    This document and translations of it may be copied and furnished to
1588    others, and derivative works that comment on or otherwise explain it
1589    or assist in its implementation may be prepared, copied, published
1590    and distributed, in whole or in part, without restriction of any
1591    kind, provided that the above copyright notice and this paragraph are
1592    included on all such copies and derivative works.  However, this doc-
1593    ument itself may not be modified in any way, such as by removing the
1594    copyright notice or references to the Internet Society or other
1595    Internet organizations, except as needed for the purpose of develop-
1596    ing Internet standards in which case the procedures for copyrights
1597    defined in the Internet Standards process must be followed, or as
1598    required to translate it into languages other than English.
1599
1600    The limited permissions granted above are perpetual and will not be
1601    revoked by the Internet Society or its successors or assigns.
1602
1603    This document and the information contained herein is provided on an
1604    "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
1605    TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
1606    BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
1607    HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MER-
1608    CHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
1609
1610 Acknowledgement
1611
1612    Funding for the RFC Editor function is currently provided by the
1613    Internet Society.
1614
1615
1616
1617
1618 Newman et al.             Expires: August 2003         FORMFEED[Page 27]
1619
1620
1621
1622
1623
1624 INTERNET DRAFT                 SASL C API                  February 2003
1625
1626
1627 A. Appendix A -- Design Goals
1628
1629    The design goals of the SASL C API are as follows:
1630
1631
1632 o   To be simple and practical to use.
1633
1634 o   To provide related utility services in addition to core SASL func-
1635     tionality.
1636
1637 o   To be reasonably extensible.
1638
1639 o   To be suitable for use in a multi-threaded server or client.
1640
1641 o   To avoid dependancies on a specific memory allocation system, thread
1642     package or network model.
1643
1644 o   To be an independent service rather than a new layer.
1645
1646
1647 B.     SASL API Index
1648
1649 <<To be completed>>
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678 Newman et al.             Expires: August 2003         FORMFEED[Page 28]
1679
1680
1681