Move SSL-code in mysql_auth.c and pam_client_session.cc to

a separate function in ssl.cc

Removes some duplicate code.
This commit is contained in:
Esa Korhonen
2017-08-04 14:53:52 +03:00
parent 8ef8ee6600
commit ed05d24a9a
5 changed files with 58 additions and 62 deletions

View File

@ -113,7 +113,8 @@ typedef struct mxs_authenticator
#define MXS_AUTH_FAILED_SSL 3 /**< SSL authentication failed */
#define MXS_AUTH_INCOMPLETE 4 /**< Authentication is not yet complete */
#define MXS_AUTH_SSL_INCOMPLETE 5 /**< SSL connection is not yet complete */
#define MXS_AUTH_NO_SESSION 6
#define MXS_AUTH_SSL_COMPLETE 6 /**< SSL connection complete or not required */
#define MXS_AUTH_NO_SESSION 7
/** Return values for the loadusers entry point */
#define MXS_AUTH_LOADUSERS_OK 0 /**< Users loaded successfully */

View File

@ -76,4 +76,16 @@ bool ssl_required_by_dcb(struct dcb *dcb);
bool ssl_required_but_not_negotiated(struct dcb *dcb);
const char* ssl_method_type_to_string(ssl_method_type_t method_type);
/**
* Helper function for client ssl authentication. Authenticates and checks changes
* in ssl status.
*
* @param dcb Client dcb
*
* @return MXS_AUTH_FAILED_SSL or MXS_AUTH_FAILED on error. MXS_AUTH_SSL_INCOMPLETE
* if ssl authentication is in progress and should be retried, MXS_AUTH_SSL_COMPLETE
* if ssl authentication is complete or not required.
*/
int ssl_authenticate_check_status(struct dcb *dcb);
MXS_END_DECLS