summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2020-11-01 12:27:04 -0700
committerEduardo Chappa <chappa@washington.edu>2020-11-01 12:27:04 -0700
commit649572ba29dfab09cb77a5c2f6f5d12e9822792c (patch)
treea9b3b2c64321f4ab302a70852b72e7443e4fbeba
parent6486d2b43ee2ce595a4b292cd2620f56d7c20757 (diff)
downloadalpine-649572ba29dfab09cb77a5c2f6f5d12e9822792c.tar.xz
* Improvements to the cancel authentication logic to not to make it
have a delay when cancelling authentication.
-rw-r--r--imap/src/c-client/auth_bea.c2
-rw-r--r--imap/src/c-client/auth_oa2.c2
-rw-r--r--imap/src/c-client/imap4r1.c25
-rw-r--r--pith/pine.hlp2
4 files changed, 14 insertions, 17 deletions
diff --git a/imap/src/c-client/auth_bea.c b/imap/src/c-client/auth_bea.c
index 64c3aa6..d9f5e06 100644
--- a/imap/src/c-client/auth_bea.c
+++ b/imap/src/c-client/auth_bea.c
@@ -150,7 +150,7 @@ long auth_oauthbearer_client (authchallenge_t challenger,authrespond_t responder
if(oauth2.param[OA2_Id].value) fs_give((void **) &oauth2.param[OA2_Id].value);
if(oauth2.param[OA2_Secret].value) fs_give((void **) &oauth2.param[OA2_Secret].value);
if(oauth2.param[OA2_Tenant].value) fs_give((void **) &oauth2.param[OA2_Tenant].value);
- if (!ret || !oauth2.name)
+ if (!ret)
*trial = 65535; /* don't retry if bad protocol */
return ret;
}
diff --git a/imap/src/c-client/auth_oa2.c b/imap/src/c-client/auth_oa2.c
index dac8796..b446b40 100644
--- a/imap/src/c-client/auth_oa2.c
+++ b/imap/src/c-client/auth_oa2.c
@@ -169,7 +169,7 @@ long auth_oauth2_client (authchallenge_t challenger,authrespond_t responder, cha
if(oauth2.param[OA2_Id].value) fs_give((void **) &oauth2.param[OA2_Id].value);
if(oauth2.param[OA2_Secret].value) fs_give((void **) &oauth2.param[OA2_Secret].value);
if(oauth2.param[OA2_Tenant].value) fs_give((void **) &oauth2.param[OA2_Tenant].value);
- if (!ret || !oauth2.name)
+ if (!ret)
*trial = 65535; /* don't retry if bad protocol */
return ret;
}
diff --git a/imap/src/c-client/imap4r1.c b/imap/src/c-client/imap4r1.c
index 7343122..344eada 100644
--- a/imap/src/c-client/imap4r1.c
+++ b/imap/src/c-client/imap4r1.c
@@ -1215,23 +1215,20 @@ long imap_auth (MAILSTREAM *stream,NETMBX *mb,char *tmp,char *usr)
ok = (*at->client) (imap_challenge,imap_response,base,"imap",mb,stream,
net_port(LOCAL->netstream),&trial,usr);
LOCAL->sensitive = NIL; /* unhide */
-
- if(base && ok && !trial){ /* return now or see below for the same code */
- mm_log ("IMAP Authentication cancelled",ERROR);
- return NIL;
- }
+ if(!base){
/* make sure have a response */
- if (!(reply = &LOCAL->reply)->tag)
- reply = imap_fake (stream,tag,
+ if (!(reply = &LOCAL->reply)->tag)
+ reply = imap_fake (stream,tag,
"[CLOSED] IMAP connection broken (authenticate)");
- else if (compare_cstring (reply->tag,tag))
- while (compare_cstring ((reply = imap_reply (stream,tag))->tag,tag))
- imap_soutr (stream,"*");
+ else if (compare_cstring (reply->tag,tag))
+ while (compare_cstring ((reply = imap_reply (stream,tag))->tag,tag))
+ imap_soutr (stream,"*");
/* good if SASL ok and success response */
- if (ok && imap_OK (stream,reply)){
- if(stream->auth.name) fs_give((void **) &stream->auth.name);
- stream->auth.name = cpystr(at->name); /* save method name */
- return T;
+ if (ok && imap_OK (stream,reply)){
+ if(stream->auth.name) fs_give((void **) &stream->auth.name);
+ stream->auth.name = cpystr(at->name); /* save method name */
+ return T;
+ }
}
if (!trial) { /* if main program requested cancellation */
mm_log ("IMAP Authentication cancelled",ERROR);
diff --git a/pith/pine.hlp b/pith/pine.hlp
index 054ba3e..002b804 100644
--- a/pith/pine.hlp
+++ b/pith/pine.hlp
@@ -140,7 +140,7 @@ with help text for the config screen and the composer that didn't have any
reasonable place to be called from.
Dummy change to get revision in pine.hlp
============= h_revision =================
-Alpine Commit 513 2020-11-01 01:40:24
+Alpine Commit 514 2020-11-01 12:25:08
============= h_news =================
<HTML>
<HEAD>