SASL plain authentication support. More...
#include <stdlib.h>
Go to the source code of this file.
Functions | |
size_t | mutt_sasl_plain_msg (char *buf, size_t buflen, const char *cmd, const char *authz, const char *user, const char *pass) |
Construct a base64 encoded SASL PLAIN message. | |
SASL plain authentication support.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file sasl_plain.h.
size_t mutt_sasl_plain_msg | ( | char * | buf, |
size_t | buflen, | ||
const char * | cmd, | ||
const char * | authz, | ||
const char * | user, | ||
const char * | pass | ||
) |
Construct a base64 encoded SASL PLAIN message.
buf | Destination buffer |
buflen | Available space in the destination buffer |
cmd | Protocol-specific string the prepend to the PLAIN message |
authz | Authorization identity |
user | Authentication identity (username) |
pass | Password |
>0 | Success, number of chars in the command string |
0 | Error |
This function can be used to build a protocol-specific SASL Response message using the PLAIN mechanism. The protocol specific command is given in the cmd parameter. The function appends a space, encodes the string derived from authz\0user\0pass using base64 encoding, and stores the result in buf. If cmd is either NULL or the empty string, the initial space is skipped.
authz, user, and pass can each be up to 255 bytes, making up for a 765 bytes string. Add the two NULL bytes in between plus one at the end and we get 768.
Definition at line 56 of file sasl_plain.c.