| 1005 | } |
| 1006 | |
| 1007 | static 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 | |
| 1027 | static int auth_cram_md5(struct imap_store *ctx, const char *prompt) |
| 1028 | { |
nothing calls this directly
no test coverage detected