SASL_CLIENT_STEP(3)
π SASL_CLIENT_STEP(3) β Cyrus SASL, bestie edition π
okay so you're deep in the Cyrus SASL docs (that's the manual name, iykyk) and you found the one that does the β¨negotiation stepβ¨. pull up a chair, we're doing this together.
β¨ NAME β¨
sasl_client_step β Cyrus SASL documentation, but make it a group chat π«Ά
πΈ SYNOPSIS πΈ
#include <sasl/sasl.h>
int sasl_client_step(sasl_conn_t *conn,
const char *serverin,
unsigned serverinlen,
sasl_interact_t ** prompt_need,
const char ** clientout,
unsigned * clientoutlen);
π DESCRIPTION π
int sasl_client_step(sasl_conn_t *conn,
const char *serverin,
unsigned serverinlen,
sasl_interact_t ** prompt_need,
const char ** clientout,
unsigned * clientoutlen);
sasl_client_step() performs a step in the authentication negotiation. literally one single step, like one foot in front of the other πΆβοΈ
it returns SASL_OK if the whole negotiation is successful and SASL_CONTINUE if this step is ok but at least one more step is needed. so SASL_CONTINUE is giving "not yet bestie, keep going" energy.
π¨ IMPORTANT REALITY CHECK: a client should not assume an authentication negotiation is successful just because the server signaled success via protocol. i.e. if the server said β. OK Authentication succeededβ in IMAP,sasl_client_stepshould still be called one more time with aserverinlenof zero. yes fr fr, one more time. don't skip it, don't be that girl π
If SASL_INTERACT is returned, the library needs some values to be filled in before it can proceed. the prompt_need structure will be filled in with requests. the application should fulfill these requests and call sasl_client_start again with identical parameters (the prompt_need parameter will be the same pointer as before but filled in by the application). same pointer, new contents, no cap π
π¦ Parameters π¦
connβ is the SASL connection context. your little context holder, the main character of the connection π«Άserverinβ is the data given by the server (decoded if the protocol encodes requests sent over the wire)serverinlenβ is the length ofserverinclientoutβ is created. It is the initial client response to send to the server. It is the job of the client to send it over the network to the server. any protocol specific encoding (such as base64 encoding) necessary needs to be done by the client. so like, the library hands you the goods, you do the wrapping and the mailing πclientoutlenβ length ofclientout.
π₯ RETURN VALUE π₯
SASL callback functions should return SASL return codes. See sasl.h for a complete list.
SASL_CONTINUEindicates success and that there are more steps needed in the authentication. (success but keep it moving β¨)SASL_OKindicates that the authentication is complete. (we ate, periodt π)
other return codes indicate errors and should either be handled or the authentication session should be quit. like, genuinely quit. don't just leave it hanging there π
π SEE ALSO π
RFC 4422,:saslman:sasl(3), sasl_callbacks(3), sasl_client_init(3), sasl_client_new(3), sasl_client_start(3), sasl_errors(3)
the whole friend group, go say hi π
π AUTHOR π
The Cyrus Team π
π COPYRIGHT π
1993-2016, The Cyrus Team
and that's the tea, bestie π this was Cyrus SASL 2.1.28, dated February 18, 2022 β mwah, iconic, no notes π β¨π¦
π¦ where this page comes from
- alpine 3.22: cyrus-sasl-doc 2.1.28-r8 Β· BSD-3-Clause-Attribution AND BSD-4-Clause
- alpine 3.23: cyrus-sasl-doc 2.1.28-r9 Β· BSD-3-Clause-Attribution AND BSD-4-Clause
- alpine 3.24: cyrus-sasl-doc 2.1.28-r9 Β· BSD-3-Clause-Attribution AND BSD-4-Clause
- centos-stream 10: cyrus-sasl-devel 2.1.28-27.el10 Β· BSD-Attribution-HPND-disclaimer
- fedora 43: cyrus-sasl-devel 2.1.28-33.fc43 Β· BSD-Attribution-HPND-disclaimer
- fedora 43: cyrus-sasl-devel 2.1.28-33.fc43 Β· BSD-Attribution-HPND-disclaimer
- fedora 44: cyrus-sasl-devel 2.1.28-35.fc44 Β· BSD-Attribution-HPND-disclaimer
- fedora 44: cyrus-sasl-devel 2.1.28-35.fc44 Β· BSD-Attribution-HPND-disclaimer
- opensuse-leap 16.0: cyrus-sasl-bdb-devel 2.1.28-160000.4.1 Β· BSD-4-Clause
- opensuse-leap 16.0: cyrus-sasl-bdb-devel 2.1.28-160000.4.1 Β· BSD-4-Clause
- opensuse-leap 16.0: cyrus-sasl-bdb-devel 2.1.28-160000.4.1 Β· BSD-4-Clause
- opensuse-leap 16.0: cyrus-sasl-bdb-devel 2.1.28-160000.4.1 Β· BSD-4-Clause
- opensuse-leap 16.0: cyrus-sasl-devel 2.1.28-160000.4.1 Β· BSD-4-Clause
- opensuse-leap 16.0: cyrus-sasl-devel 2.1.28-160000.4.1 Β· BSD-4-Clause
- opensuse-leap 16.0: cyrus-sasl-devel 2.1.28-160000.4.1 Β· BSD-4-Clause
- opensuse-leap 16.0: cyrus-sasl-devel 2.1.28-160000.4.1 Β· BSD-4-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms