MCPcopy Create free account
hub / github.com/git/git / auth_xoauth2

Function auth_xoauth2

imap-send.c:1065–1083  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1063}
1064
1065static int auth_xoauth2(struct imap_store *ctx, const char *prompt UNUSED)
1066{
1067 int ret;
1068 char *b64;
1069
1070 b64 = xoauth2_base64(ctx->cfg->user, ctx->cfg->pass);
1071 if (!b64)
1072 return error("XOAUTH2: base64 encoding failed");
1073
1074 /* Send the base64-encoded response */
1075 ret = socket_write(&ctx->imap->buf.sock, b64, strlen(b64));
1076 if (ret != (int)strlen(b64)) {
1077 free(b64);
1078 return error("IMAP error: sending XOAUTH2 response failed");
1079 }
1080
1081 free(b64);
1082 return 0;
1083}
1084
1085#else
1086

Callers

nothing calls this directly

Calls 3

xoauth2_base64Function · 0.85
errorFunction · 0.85
socket_writeFunction · 0.85

Tested by

no test coverage detected