summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2021-12-15 17:50:00 -0800
committerKevin McCarthy <kevin@8t8.us>2021-12-23 14:59:01 -0800
commit68caf9140c8217ecf6c848460c4b4d27996b2922 (patch)
tree37e5ee6ded751efaa7e9460baaaca9ba9d109926 /main.c
parente3faeb0355ad3ac53696d0d4d9eee3e2fd9b595e (diff)
Add GNU SASL support for authentication.
It turns out Cyrus SASL's license may not be compatible with GPL programs, see Debian Bug 999672. So, add support for the GNU SASL library, using configure option --with-gsasl. I haven't touched the Cyrus SASL code in Mutt all that much in the past, but I've done my best to keep the gsasl code clean and simple. There are likely mistakes to be fixed and additions to be made, though. I queried the gsasl mailing list about the need for a socket wrapper (as is done for the cyrus code), and it seems this should no longer be needed. As long as GSASL_QOP is left at the default (qop-auth), the client should ask for authentication, and not negotiate integrity or confidentiality. (Thanks to Phil Pennock and Simon Josefsson for their reponses - although the blame is fully on *me* if this turns out to be incorrect). Therefore there is no CONNECTION wrapping in this implementation. Add multiline response support for SMTP authentication (which is probably not actually needed). Also add arbitrary line length for the SASL server responses (the RFCs note that for SASL, the protocol line lengths don't apply).
Diffstat (limited to 'main.c')
-rw-r--r--main.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/main.c b/main.c
index 3fd930b6..f281fa27 100644
--- a/main.c
+++ b/main.c
@@ -38,10 +38,14 @@
#include "sidebar.h"
#endif
-#ifdef USE_SASL
+#ifdef USE_SASL_CYRUS
#include "mutt_sasl.h"
#endif
+#ifdef USE_SASL_GNU
+#include "mutt_sasl_gnu.h"
+#endif
+
#ifdef USE_IMAP
#include "imap/imap.h"
#endif
@@ -339,11 +343,16 @@ static void show_version (void)
"-USE_SSL_GNUTLS "
#endif
-#ifdef USE_SASL
+#ifdef USE_SASL_CYRUS
"+USE_SASL "
#else
"-USE_SASL "
#endif
+#ifdef USE_SASL_GNU
+ "+USE_GSASL "
+#else
+ "-USE_GSASL "
+#endif
#ifdef USE_GSS
"+USE_GSS "
#else
@@ -1394,9 +1403,12 @@ cleanup_and_exit:
#ifdef USE_IMAP
imap_logout_all ();
#endif
-#ifdef USE_SASL
+#ifdef USE_SASL_CYRUS
mutt_sasl_done ();
#endif
+#ifdef USE_SASL_GNU
+ mutt_gsasl_done ();
+#endif
#ifdef USE_AUTOCRYPT
mutt_autocrypt_cleanup ();
#endif