Authenticator API extract-entrypoint returns bool
Extraction either succeeds or fails, it does not need to return defined integer values.
This commit is contained in:
@ -272,24 +272,23 @@ static void copy_client_information(DCB *dcb, GWBUF *buffer)
|
||||
*
|
||||
* @param dcb Client DCB
|
||||
* @param read_buffer Buffer containing the client's response
|
||||
* @return MXS_AUTH_SUCCEEDED if authentication can continue, MXS_AUTH_FAILED if
|
||||
* authentication failed
|
||||
* @return True if authentication can continue, false if not
|
||||
*/
|
||||
static int gssapi_auth_extract(DCB *dcb, GWBUF *read_buffer)
|
||||
static bool gssapi_auth_extract(DCB *dcb, GWBUF *read_buffer)
|
||||
{
|
||||
int rval = MXS_AUTH_FAILED;
|
||||
int rval = false;
|
||||
gssapi_auth_t *auth = (gssapi_auth_t*)dcb->authenticator_data;
|
||||
|
||||
switch (auth->state)
|
||||
{
|
||||
case GSSAPI_AUTH_INIT:
|
||||
copy_client_information(dcb, read_buffer);
|
||||
rval = MXS_AUTH_SUCCEEDED;
|
||||
rval = true;
|
||||
break;
|
||||
|
||||
case GSSAPI_AUTH_DATA_SENT:
|
||||
store_client_token(dcb, read_buffer);
|
||||
rval = MXS_AUTH_SUCCEEDED;
|
||||
rval = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -199,17 +199,17 @@ bool extract_principal_name(DCB *dcb, GWBUF *buffer)
|
||||
* @brief Extract data from a MySQL packet
|
||||
* @param dcb Backend DCB
|
||||
* @param buffer Buffer containing a complete packet
|
||||
* @return MXS_AUTH_INCOMPLETE if authentication is ongoing, MXS_AUTH_SUCCEEDED
|
||||
* if authentication is complete and MXS_AUTH_FAILED if authentication failed.
|
||||
* @return True if authentication is ongoing or complete,
|
||||
* false if authentication failed.
|
||||
*/
|
||||
static int gssapi_backend_auth_extract(DCB *dcb, GWBUF *buffer)
|
||||
static bool gssapi_backend_auth_extract(DCB *dcb, GWBUF *buffer)
|
||||
{
|
||||
int rval = MXS_AUTH_FAILED;
|
||||
bool rval = false;
|
||||
gssapi_auth_t *auth = (gssapi_auth_t*)dcb->authenticator_data;
|
||||
|
||||
if (auth->state == GSSAPI_AUTH_INIT && extract_principal_name(dcb, buffer))
|
||||
{
|
||||
rval = MXS_AUTH_INCOMPLETE;
|
||||
rval = true;
|
||||
}
|
||||
else if (auth->state == GSSAPI_AUTH_DATA_SENT)
|
||||
{
|
||||
@ -217,7 +217,7 @@ static int gssapi_backend_auth_extract(DCB *dcb, GWBUF *buffer)
|
||||
if (mxs_mysql_is_ok_packet(buffer))
|
||||
{
|
||||
auth->state = GSSAPI_AUTH_OK;
|
||||
rval = MXS_AUTH_SUCCEEDED;
|
||||
rval = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user