From 497eb8f2d18895adebf9ca5879e95cc3dd453878 Mon Sep 17 00:00:00 2001 From: Thomas Roessler Date: Tue, 25 Jan 2000 17:49:31 +0000 Subject: [PATCH] Fix GSSAPI support. From Lawrence Greenfield . --- imap/auth.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/imap/auth.c b/imap/auth.c index 73ac9fb09..b440c3178 100644 --- a/imap/auth.c +++ b/imap/auth.c @@ -170,9 +170,19 @@ static int imap_auth_gss (IMAP_DATA* idata, const char* user) do { /* build token */ - maj_stat = gss_init_sec_context (&min_stat, GSS_C_NO_CREDENTIAL, &context, - target_name, NULL, 0, 0, NULL, sec_token, NULL, &send_token, - (unsigned int*) &cflags, NULL); + maj_stat = gss_init_sec_context (&min_stat, + GSS_C_NO_CREDENTIAL, + &context, + target_name, + GSS_C_NO_OID, + GSS_C_MUTUAL_FLAG | GSS_C_SEQUENCE_FLAG, + 0, + GSS_C_NO_CHANNEL_BINDINGS, + sec_token, + NULL, + &send_token, + (unsigned int*) &cflags, + NULL); if (maj_stat != GSS_S_COMPLETE && maj_stat != GSS_S_CONTINUE_NEEDED) { dprint (1, (debugfile, "Error exchanging credentials\n")); @@ -227,6 +237,7 @@ static int imap_auth_gss (IMAP_DATA* idata, const char* user) dprint (2, (debugfile, "Couldn't unwrap security level data\n")); gss_release_buffer (&min_stat, &send_token); + mutt_socket_write(idata->conn, "*\r\n"); return -1; } dprint (2, (debugfile, "Credential exchange complete\n")); @@ -238,6 +249,7 @@ static int imap_auth_gss (IMAP_DATA* idata, const char* user) dprint (2, (debugfile, "Server requires integrity or privace\n")); gss_release_buffer (&min_stat, &send_token); + mutt_socket_write(idata->conn, "*\r\n"); return -1; } @@ -265,6 +277,7 @@ static int imap_auth_gss (IMAP_DATA* idata, const char* user) { dprint (2, (debugfile, "Error creating login request\n")); + mutt_socket_write(idata->conn, "*\r\n"); return -1; } @@ -278,6 +291,7 @@ static int imap_auth_gss (IMAP_DATA* idata, const char* user) { dprint (1, (debugfile, "Error receiving server response.\n")); + mutt_socket_write(idata->conn, "*\r\n"); return -1; } if (imap_code (buf1)) -- 2.40.0