summaryrefslogtreecommitdiffstats
path: root/account.h
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2021-03-05 18:52:48 -0800
committerKevin McCarthy <kevin@8t8.us>2021-03-08 14:19:06 -0800
commit191b0513b43d5e603f99292faa5f8ebcc1be3823 (patch)
tree835573e952f10cc4912cff6b72b518b7f30f3fc1 /account.h
parentfcc6299184208e9a38890979ebb9f1c1356c18eb (diff)
Fix $ssl_client_cert usage with SMTP.
The ssl and gnutls client-cert setup code was calling mutt_account_getuser(). This caused two problems. First, it's not necessarily the case that there will be a username. Second, populating the user would cause smtp_open() to check for AUTH capabilities and call smtp_auth - even if the user is already authenticated by the cert. The server won't advertize AUTH if they already authenticated, causing a connection abort. Remove prompt for mutt_account_getuser() in the ssl and gnutls client certificate connection code. The SASL code has callbacks, so I don't understand why it would need this. Let's take it out and see if anyone screams 8-P. If necessary, we can add a mutt_account_getuser() call to the very beginning of imap_auth_sasl(). Revamp the openssl ssl_passwd_cb() prompt. From the man pages, it appears to be used for the cert decryption. There's no need to call mutt_account_getuser() and use the generic mutt_account_getpass() just to read a password in. Instead create a callback function version to customize the prompt for a client cert with just the host. Change the SMTP authentication test to check if the AUTH capabilities are set, instead of if the user field is set before calling smtp_auth().
Diffstat (limited to 'account.h')
-rw-r--r--account.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/account.h b/account.h
index 2eccb7f4..9f485cfd 100644
--- a/account.h
+++ b/account.h
@@ -55,6 +55,8 @@ int mutt_account_fromurl (ACCOUNT* account, ciss_url_t* url);
void mutt_account_tourl (ACCOUNT* account, ciss_url_t* url);
int mutt_account_getuser (ACCOUNT* account);
int mutt_account_getlogin (ACCOUNT* account);
+int _mutt_account_getpass (ACCOUNT* account,
+ void (*prompt_func) (char *, size_t, ACCOUNT *));
int mutt_account_getpass (ACCOUNT* account);
void mutt_account_unsetpass (ACCOUNT* account);
int mutt_account_getoauthbearer (ACCOUNT* account, BUFFER *authbearer, int xoauth2);