diff --git a/src/internal.c b/src/internal.c index 2f48a3fb8..dfee448fc 100644 --- a/src/internal.c +++ b/src/internal.c @@ -10400,13 +10400,8 @@ static int GetRecordHeader(WOLFSSL* ssl, const byte* input, word32* inOutIdx, else { WOLFSSL_MSG("SSL version error"); /* send alert per RFC5246 Appendix E. Backward Compatibility */ - if (ssl->options.side == WOLFSSL_CLIENT_END) { -#ifdef WOLFSSL_MYSQL_COMPATIBLE - SendAlert(ssl, alert_fatal, wc_protocol_version); -#else - SendAlert(ssl, alert_fatal, protocol_version); -#endif - } + if (ssl->options.side == WOLFSSL_CLIENT_END) + SendAlert(ssl, alert_fatal, wolfssl_alert_protocol_version); WOLFSSL_ERROR_VERBOSE(VERSION_ERROR); return VERSION_ERROR; /* only use requested version */ } @@ -18471,24 +18466,12 @@ const char* AlertTypeToString(int type) return decrypt_error_str; } - #ifdef WOLFSSL_MYSQL_COMPATIBLE - /* catch name conflict for enum protocol with MYSQL build */ - case wc_protocol_version: - { - static const char wc_protocol_version_str[] = - "wc_protocol_version"; - return wc_protocol_version_str; - } - - #else - case protocol_version: + case wolfssl_alert_protocol_version: { static const char protocol_version_str[] = "protocol_version"; return protocol_version_str; } - - #endif case insufficient_security: { static const char insufficient_security_str[] = diff --git a/src/tls.c b/src/tls.c index 8c0c8bbd1..f40f410b5 100644 --- a/src/tls.c +++ b/src/tls.c @@ -6038,11 +6038,7 @@ static int TLSX_SupportedVersions_Parse(WOLFSSL* ssl, const byte* input, set = 1; } if (!set) { - #ifdef WOLFSSL_MYSQL_COMPATIBLE - SendAlert(ssl, alert_fatal, wc_protocol_version); - #else - SendAlert(ssl, alert_fatal, protocol_version); - #endif + SendAlert(ssl, alert_fatal, wolfssl_alert_protocol_version); WOLFSSL_ERROR_VERBOSE(VERSION_ERROR); return VERSION_ERROR; } diff --git a/src/tls13.c b/src/tls13.c index 87191db85..af8a7e15f 100644 --- a/src/tls13.c +++ b/src/tls13.c @@ -5671,11 +5671,7 @@ int DoTls13ClientHello(WOLFSSL* ssl, const byte* input, word32* inOutIdx, /* this check pass for DTLS Major (0xff) */ if (args->pv.major < SSLv3_MAJOR) { WOLFSSL_MSG("Legacy version field contains unsupported value"); - #ifdef WOLFSSL_MYSQL_COMPATIBLE - SendAlert(ssl, alert_fatal, wc_protocol_version); - #else - SendAlert(ssl, alert_fatal, protocol_version); - #endif + SendAlert(ssl, alert_fatal, wolfssl_alert_protocol_version); ERROR_OUT(INVALID_PARAMETER, exit_dch); } diff --git a/wolfssl/ssl.h b/wolfssl/ssl.h index bb3a63390..4ec90eec5 100644 --- a/wolfssl/ssl.h +++ b/wolfssl/ssl.h @@ -768,6 +768,11 @@ enum AlertDescription { no_application_protocol = 120 }; +#ifdef WOLFSSL_MYSQL_COMPATIBLE +#define wolfssl_alert_protocol_version wc_protocol_version +#else +#define wolfssl_alert_protocol_version protocol_version +#endif enum AlertLevel { alert_none = 0, /* Used to indicate no alert level is set */