diff options
author | Jeremy Harris <jgh146exb@wizmail.org> | 2022-02-27 22:32:41 +0000 |
---|---|---|
committer | Jeremy Harris <jgh146exb@wizmail.org> | 2022-02-27 22:36:12 +0000 |
commit | 03b0db9171517bb1975136df7ea95a01341b7db8 (patch) | |
tree | 76c6a897d07df662b0d07415d492f07784a96bd5 | |
parent | 7d238090f5fbd23d7077eba95c1ba8f2ee016a00 (diff) |
AUTH GSASL SCRAM: handling of error return from library
-rw-r--r-- | src/src/auths/gsasl_exim.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/src/src/auths/gsasl_exim.c b/src/src/auths/gsasl_exim.c index 495ad1189..8f74f4d75 100644 --- a/src/src/auths/gsasl_exim.c +++ b/src/src/auths/gsasl_exim.c @@ -897,24 +897,27 @@ if (tls_out.channelbinding) for(s = NULL; ;) { uschar * outstr; - BOOL fail; + BOOL fail = TRUE; rc = gsasl_step64(sctx, CS s, CSS &outstr); - fail = initial - ? smtp_write_command(sx, SCMD_FLUSH, - outstr ? "AUTH %s %s\r\n" : "AUTH %s\r\n", - ablock->public_name, outstr) <= 0 - : outstr - ? smtp_write_command(sx, SCMD_FLUSH, "%s\r\n", outstr) <= 0 - : FALSE; - if (outstr && *outstr) free(outstr); - if (fail) + if (rc == GSASL_NEEDS_MORE || rc == GSASL_OK) { - yield = FAIL_SEND; - goto done; + fail = initial + ? smtp_write_command(sx, SCMD_FLUSH, + outstr ? "AUTH %s %s\r\n" : "AUTH %s\r\n", + ablock->public_name, outstr) <= 0 + : outstr + ? smtp_write_command(sx, SCMD_FLUSH, "%s\r\n", outstr) <= 0 + : FALSE; + free(outstr); + if (fail) + { + yield = FAIL_SEND; + goto done; + } + initial = FALSE; } - initial = FALSE; if (rc != GSASL_NEEDS_MORE) { @@ -969,7 +972,7 @@ switch (prop) HDEBUG(D_auth) debug_printf(" filling in\n"); gsasl_property_set(sctx, GSASL_CB_TLS_UNIQUE, CCS tls_out.channelbinding); - break; + return GSASL_OK; case GSASL_SCRAM_SALTED_PASSWORD: { uschar * client_spassword = |