SASL_CLIENT_NEW(3)

✨ SASL_CLIENT_NEW ✨

okay bestie, gather round, because this is the Cyrus SASL manual page for sasl_client_new and she is iconic πŸ’…


🌸 NAME 🌸

sasl_client_new β€” Cyrus SASL documentation


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <sasl/sasl.h>

int sasl_client_new(const char *service,
                    const char *serverFQDN,
                    const char *iplocalport,
                    const char *ipremoteport,
                    const sasl_callback_t *prompt_supp,
                    unsigned flags,
                    sasl_conn_t ** pconn);

πŸ’– DESCRIPTION πŸ’–

so like, here's the whole signature again, laid out all dramatic for you:

int sasl_client_new(const char *service,

const char *serverFQDN,

const char *iplocalport,

const char *ipremoteport,

const sasl_callback_t *prompt_supp,

unsigned flags,

sasl_conn_t ** pconn);

sasl_client_new() creates a new SASL context. one context per connection, that's the rule. This context gets used for all the SASL calls for one connection, no cap. And it handles both the authentication part and the integrity/encryption layers after authentication. she does it all πŸ’…

πŸŽ€ Parameters πŸŽ€

  • service β€” the registered name of the service (usually the protocol name) using SASL (e.g. "imap"). yes bestie, like that.
  • serverFQDN β€” the fully qualified domain name of the server (e.g. "serverhost.example.com"). full government name energy ✨
  • iplocalport β€” the IP and port of the local side of the connection, or NULL. If iplocalport is NULL it will disable mechanisms that require IP address information. This string must be in one of the following formats: "a.b.c.d;port" (IPv4), "e:f:g:h:i:j:k:l;port" (IPv6), or "e:f:g:h:i:j:a.b.c.d;port" (IPv6). three formats, pick your fighter
  • ipremoteport β€” the IP and port of the remote side of the connection, or NULL (see iplocalport). same rules, other end of the wire 🫢
  • prompt_supp β€” a list of client interactions supported that is unique to this connection. If this parameter is NULL the global callbacks (specified in sasl_client_init(3)) will be used. See sasl_callbacks(3) for more information. lowkey the "if you don't bring your own, we use the group chat's" option 😭
  • flags β€” are connection flags (see below). we're getting to those, hold on πŸƒβ€β™€οΈ
  • pconn β€” the connection context allocated by the library. This structure will be used for all future SASL calls for this connection. she's the main character of this connection, periodt πŸ‘‘

🌈 Connection Flags 🌈

Flags that may be passed to sasl_client_new():

  • SASL_SUCCESS_DATA β€” The protocol supports a server-last send. yes ma'am, server gets the last word on this one πŸ’€
  • SASL_NEED_PROXY β€” Force the use of a mechanism that supports an authorization id that is not the authentication id. forcing it fr fr, no negotiating.

⭐ RETURN VALUE ⭐

SASL callback functions should return SASL return codes. See sasl.h for a complete list. SASL_OK indicates success. we love a success story πŸ’š

The following return codes indicate errors and should either be handled or the authentication session should be quit:

  • SASL_NOMECH β€” No mechanism meets requested properties
  • SASL_BADPARAM β€” Error in config file
  • SASL_NOMEM β€” Not enough memory to complete operation
ok so real talk bestie: those three? either handle them properly or quit the whole authentication session. no vibing through an error, that's not the move πŸ™ˆ

🧚 SEE ALSO 🧚

RFC 4422,:saslman:sasl(3), sasl_callbacks(3), sasl_client_init(3), sasl_client_start(3), sasl_client_step(3), sasl_setprop(3)

go read those too, they're all in the same friend group 🌸


πŸ‘‘ AUTHOR πŸ‘‘

The Cyrus Team


1993-2016, The Cyrus Team


and that's the whole page, bestie!! version 2.1.28, dated February 18, 2022 β€” sending you love and successful SASL handshakes always πŸ«Άβœ¨πŸ’–