SASL_ENCODE(3)

✨ SASL_ENCODE(3) ✨

okay bestie, welcome to the Cyrus SASL docs, this one's the sasl_encode page and it's genuinely so useful, come sit with me πŸ’–


🌸 SYNOPSIS 🌸

#include <sasl/sasl.h>

int sasl_encode(sasl_conn_t *conn,
                const char * input,
                unsigned inputlen,
                const char ** output,
                unsigned * outputlen);

int sasl_encodev(sasl_conn_t *conn,
                 const struct iovec * invec,
                 unsigned numiov,
                 const char ** output,
                 unsigned * outputlen);

like, look at those signatures, they're giving clean interface energy πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so sasl_encode encodes data that you're about to send off to a remote host β€” and not just any remote host, one you've already had a successful authentication session with. no cap, that part matters πŸ”₯

if there's a negotiated security layer happening, the data gets signed/encrypted, and then you send the output to the remote host without modification. literally do not touch it, bestie, just pass it along πŸ™ˆ

and if there's no security layer? then the output is identical to the input. same vibes, no glow-up, periodt.

sasl_encodev does the same thing, but for a struct iovec instead of a character buffer. iconic versatility honestly πŸŽ€

int sasl_encode(sasl_conn_t *conn,

const char * input,

unsigned inputlen,

const char ** output,

unsigned * outputlen);

🌈 Parameters 🌈

  • conn – is the SASL connection context
  • output – contains the decoded data and is allocated/freed by the library.
  • outputlen – length of output.
int sasl_encodev(sasl_conn_t *conn,

const struct iovec * invec,

unsigned numiov,

const char ** output,

unsigned * outputlen);

πŸ’œ Parameters πŸ’œ

  • conn – is the SASL connection context
  • output – contains the decoded data and is allocated/freed by the library.
  • outputlen – length of output.
not me pointing out that output is allocated AND freed by the library β€” so don't you dare try to free it yourself, that's their job, let them cook 🫢

⭐ RETURN VALUE ⭐

SASL callback functions should return SASL return codes. See sasl.h for a complete list. SASL_OK indicates success. 🌟

other return codes indicate errors and should be handled. do not ignore them, fr fr, handle your errors bestie 😭


πŸ‘‘ SEE ALSO πŸ‘‘

RFC 4422, :saslman:sasl(3), sasl_decode(3), sasl_errors(3)


πŸ’– AUTHOR πŸ’–

The Cyrus Team


1993-2016, The Cyrus Team


and that's the whole page, bestie!! this was Cyrus SASL 2.1.28, dated February 18, 2022 β€” go forth and encode responsibly, mwah πŸ’‹πŸ¦‹βœ¨