gsasl_step(3)

๐Ÿ’… gsasl_step โ€” the tiny function that does ONE step of the whole SASL thing

okay bestie, gather round, because this is a gsasl manpage (from the gsasl manual set, fr) and we're about to make it make sense ๐ŸŒธ


โœจ NAME โœจ

gsasl_step โ€” it's an API function, periodt. that's the whole name, no notes ๐Ÿ’–


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

lowkey the vibe is: you include the header, you call the function, you get an int back:

#include <gsasl.h>

int gsasl_step(Gsasl_session * sctx, const char * input, size_t
input_len, char ** output, size_t * output_len);

that's it. that's the whole summoning circle ๐ŸŽ€


๐ŸŒธ ARGUMENTS ๐ŸŒธ

here's who's who at the function party ๐Ÿ‘‘

  • Gsasl_session * sctx โ€” your libgsasl session handle. the main character of this whole operation ๐Ÿ’…
  • const char * input โ€” the input byte array. bytes coming in, bestie ๐Ÿ“ฅ
  • size_t input_len โ€” size of that input byte array. like, how many bytes we talking ๐Ÿงฎ
  • char ** output โ€” a newly allocated output byte array. fresh out the allocator, no cap โœจ
  • size_t * output_len โ€” pointer to the output variable that holds the size of the output byte array. so you know exactly how big your gift is ๐ŸŽ

๐Ÿ’œ DESCRIPTION ๐Ÿ’œ

so what does it DO. it performs one step of SASL authentication. one. step. like a lil dance move in a much longer routine ๐Ÿ•บ

here's the pipeline, and I need you to follow me on this:

  • it reads data from the other end (from input and input_len) ๐Ÿ“–
  • it processes that data โ€” and yes, this can potentially invoke callbacks to the application, so heads up, your app might get paged ๐Ÿ‘€
  • it writes data to the server, into the newly allocated variable output, plus output_len which tells you the length of output ๐Ÿ“ค
okay this next part is IMPORTANT so listen up ๐Ÿ”ฅ

the contents of the output buffer are unspecified if this function returns anything other than GSASL_OK or GSASL_NEEDS_MORE. unspecified. do not touch. do not read. do not trust it. it's giving mystery box but the bad kind ๐Ÿ’€

but โ€” if the function DOES return GSASL_OK or GSASL_NEEDS_MORE, then the output buffer is allocated by this function, and bestie, it is your responsibility to deallocate it by calling gsasl_free(output). it's yours now. take care of it. don't leak it, I'm begging ๐Ÿ™

Return value: returns GSASL_OK if authentication terminated successfully, GSASL_NEEDS_MORE if more data is needed, or an error code. three moods, pick one ๐Ÿ˜Œ


๐Ÿ› REPORTING BUGS ๐Ÿ›

found a bug? (first of all, relatable.) report bugs to <bug-gsasl@gnu.org> ๐Ÿ“ง

general guidelines for reporting bugs live here: https://www.gnu.org/gethelp/

and the GNU SASL home page is: https://www.gnu.org/software/gsasl/ ๐Ÿ 


Copyright ยฉ 2002-2026 Simon Josefsson.

copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. so like, go wild, but keep the receipts ๐Ÿงพ๐Ÿ’–


๐ŸŒˆ SEE ALSO ๐ŸŒˆ

the full documentation for gsasl is maintained as a Texinfo manual. if the info and gsasl programs are properly installed at your site, the command

info gsasl

should give you access to the complete manual. iykyk ๐Ÿ“šโœจ

as an alternative you may obtain the manual from:

https://www.gnu.org/software/libidn/gsasl/manual/

and that's the whole page, bestie ๐Ÿซถ this was gsasl version 2.2.4, dated with the gsasl_step(3) energy we all know and love โ€” mwah, slay, go authenticate responsibly ๐Ÿ’…โญ

๐Ÿ“ฆ where this page comes from