SASL_SERVER_NEW(3)

✨ sasl_server_new ✨

okay bestie, gather round, because we're talking about sasl_server_new from the Cyrus SASL manual β€” page 3, section 3, the whole vibe πŸ’…


🌸 NAME 🌸

sasl_server_new β€” Cyrus SASL documentation. that's it, that's the name, she's iconic and she knows it πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

#include <sasl/sasl.h>

int sasl_server_new(const char *service,
                const char *serverFQDN,
                const char *user_realm,
                const char *iplocalport,
                const char *ipremoteport,
                const sasl_callback_t *callbacks,
                unsigned flags,
                sasl_conn_t ** pconn);

πŸ’– DESCRIPTION πŸ’–

here's the whole signature again so your eyes can vibe with it:

int sasl_server_new(const char *service,

const char *serverFQDN,

const char *user_realm,

const char *iplocalport,

const char *ipremoteport,

const sasl_callback_t *callbacks,

unsigned flags,

sasl_conn_t ** pconn);

so sasl_server_new() creates a brand new SASL context ✨ and this context? she's the main character for all SASL calls for one connection. not some of them. all of them. and she handles both authentication and the integrity/encryption layers after authentication. multitasking queen 🫢

🌈 Parameters 🌈

  • service – the registered name of the service using SASL, usually the protocol name (e.g. "imap"). it's giving "hi, this is who I am" πŸ’β™€οΈ
  • serverFQDN – the fully qualified server domain name. if it's NULL, it means use gethostname(). super useful for multi-homed servers, no cap.
  • user_realm – the domain of the user agent. usually you don't need this at all (NULL is the default) πŸ™ˆ
  • 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. these strings 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)
  • ipremoteport – the IP and port of the remote side of the connection, or NULL (see iplocalport above, same rules apply bestie) πŸ”₯
  • flags – connection flags (peep the section below πŸ‘‡)
  • pconn – a pointer to the connection context that the library allocates. this structure is gonna be used for all future SASL calls for this connection. she's in it for the long haul πŸ’œ

πŸ¦‹ Connection flags πŸ¦‹

flags that may be passed to sasl_server_new():

  • SASL_SUCCESS_DATA β€” the protocol supports a server-last send ✨
  • SASL_NEED_PROXY β€” force the use of a mechanism that supports an authorization id that is not the authentication id πŸ‘€

⭐ RETURN VALUE ⭐

SASL callback functions should return SASL return codes. see sasl.h for a complete list, fr fr. SASL_OK indicates success πŸŽ‰

other return codes indicate errors and should either be handled, or the authentication session should be quit. like, no negotiating on this one πŸ’€

okay so real talk: if you get something that isn't SASL_OK, handle it or bail. don't just ignore it and hope for the best, that's not the vibe.

πŸ‘‘ SEE ALSO πŸ‘‘

RFC 4422,:saslman:sasl(3), sasl_server_init(3), sasl_server_start(3), sasl_server_step(3), sasl_setprop(3), sasl_errors(3)

the whole girl gang, go read them 🫢


πŸ’… AUTHOR πŸ’…

The Cyrus Team. legends only.


1993-2016, The Cyrus Team


and that's the tea bestie πŸŽ€ this page is from Cyrus SASL version 2.1.28, dated February 18, 2022 β€” mwah, historic, iconic, obsessed πŸ’–βœ¨πŸ¦‹