diff options
author | Eduardo Chappa <chappa@washington.edu> | 2019-05-04 12:41:11 -0600 |
---|---|---|
committer | Eduardo Chappa <chappa@washington.edu> | 2019-05-04 12:41:11 -0600 |
commit | c024a78dbaa9b42db7f18b0fea1894c41e2b0d67 (patch) | |
tree | 441e7308e4577ac8766c44edda682704aa432262 /imap/src/c-client/auth_pla.c | |
parent | 19cde66486e27063a9af8cfd79c6eb7f106b9111 (diff) | |
download | alpine-c024a78dbaa9b42db7f18b0fea1894c41e2b0d67.tar.xz |
* Initial release of XOAUTH2 authentication support in Alpine for
Gmail.
Diffstat (limited to 'imap/src/c-client/auth_pla.c')
-rw-r--r-- | imap/src/c-client/auth_pla.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/imap/src/c-client/auth_pla.c b/imap/src/c-client/auth_pla.c index ef991f1d..6cc26c71 100644 --- a/imap/src/c-client/auth_pla.c +++ b/imap/src/c-client/auth_pla.c @@ -55,7 +55,7 @@ long auth_plain_client (authchallenge_t challenger,authrespond_t responder, char *service,NETMBX *mb,void *stream, unsigned long *trial,char *user) { - char *u,pwd[MAILTMPLEN]; + char *u, *pwd = NIL; void *challenge; unsigned long clen; long ret = NIL; @@ -70,9 +70,8 @@ long auth_plain_client (authchallenge_t challenger,authrespond_t responder, (*responder) (stream,NIL,0); ret = LONGT; /* will get a BAD response back */ } - pwd[0] = NIL; /* prompt user if empty challenge */ - mm_login (mb,user,pwd,*trial); - if (!pwd[0]) { /* empty challenge or user requested abort */ + mm_login (mb,user, &pwd,*trial); + if (!pwd) { /* empty challenge or user requested abort */ (*responder) (stream,NIL,0); *trial = 0; /* cancel subsequent attempts */ ret = LONGT; /* will get a BAD response back */ @@ -100,9 +99,10 @@ long auth_plain_client (authchallenge_t challenger,authrespond_t responder, } memset (response,0,rlen); /* erase credentials */ fs_give ((void **) &response); + fs_give ((void **) &pwd); } } - memset (pwd,0,MAILTMPLEN); /* erase password */ + if(pwd) fs_give ((void **) &pwd); if (!ret) *trial = 65535; /* don't retry if bad protocol */ return ret; } |