MCPcopy Index your code
hub / github.com/git/git / auth_plain

Function auth_plain

imap-send.c:1007–1025  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1005}
1006
1007static int auth_plain(struct imap_store *ctx, const char *prompt UNUSED)
1008{
1009 int ret;
1010 char *b64;
1011
1012 b64 = plain_base64(ctx->cfg->user, ctx->cfg->pass);
1013 if (!b64)
1014 return error("PLAIN: base64 encoding failed");
1015
1016 /* Send the base64-encoded response */
1017 ret = socket_write(&ctx->imap->buf.sock, b64, strlen(b64));
1018 if (ret != (int)strlen(b64)) {
1019 free(b64);
1020 return error("IMAP error: sending PLAIN response failed");
1021 }
1022
1023 free(b64);
1024 return 0;
1025}
1026
1027static int auth_cram_md5(struct imap_store *ctx, const char *prompt)
1028{

Callers

nothing calls this directly

Calls 3

plain_base64Function · 0.85
errorFunction · 0.85
socket_writeFunction · 0.85

Tested by

no test coverage detected