Commit bef6c0c1 authored by Georgi Kodinov's avatar Georgi Kodinov

merge 5.1->5.5

parents 0e666631 fcb03305
...@@ -758,6 +758,10 @@ void CertDecoder::GetName(NameType nt) ...@@ -758,6 +758,10 @@ void CertDecoder::GetName(NameType nt)
while (source_.get_index() < length) { while (source_.get_index() < length) {
GetSet(); GetSet();
if (source_.GetError().What() == SET_E) {
source_.SetError(NO_ERROR_E); // extensions may only have sequence
source_.prev();
}
GetSequence(); GetSequence();
byte b = source_.next(); byte b = source_.next();
......
...@@ -164,8 +164,8 @@ static void check_ssl_init() ...@@ -164,8 +164,8 @@ static void check_ssl_init()
static struct st_VioSSLFd * static struct st_VioSSLFd *
new_VioSSLFd(const char *key_file, const char *cert_file, new_VioSSLFd(const char *key_file, const char *cert_file,
const char *ca_file, const char *ca_path, const char *ca_file, const char *ca_path,
const char *cipher, SSL_METHOD *method, const char *cipher, my_bool is_client_method,
enum enum_ssl_init_error *error) enum enum_ssl_init_error* error)
{ {
DH *dh; DH *dh;
struct st_VioSSLFd *ssl_fd; struct st_VioSSLFd *ssl_fd;
...@@ -185,7 +185,9 @@ new_VioSSLFd(const char *key_file, const char *cert_file, ...@@ -185,7 +185,9 @@ new_VioSSLFd(const char *key_file, const char *cert_file,
my_malloc(sizeof(struct st_VioSSLFd),MYF(0))))) my_malloc(sizeof(struct st_VioSSLFd),MYF(0)))))
DBUG_RETURN(0); DBUG_RETURN(0);
if (!(ssl_fd->ssl_context= SSL_CTX_new(method))) if (!(ssl_fd->ssl_context= SSL_CTX_new(is_client_method ?
TLSv1_client_method() :
TLSv1_server_method())))
{ {
*error= SSL_INITERR_MEMFAIL; *error= SSL_INITERR_MEMFAIL;
DBUG_PRINT("error", ("%s", sslGetErrString(*error))); DBUG_PRINT("error", ("%s", sslGetErrString(*error)));
...@@ -262,7 +264,7 @@ new_VioSSLConnectorFd(const char *key_file, const char *cert_file, ...@@ -262,7 +264,7 @@ new_VioSSLConnectorFd(const char *key_file, const char *cert_file,
verify= SSL_VERIFY_NONE; verify= SSL_VERIFY_NONE;
if (!(ssl_fd= new_VioSSLFd(key_file, cert_file, ca_file, if (!(ssl_fd= new_VioSSLFd(key_file, cert_file, ca_file,
ca_path, cipher, TLSv1_client_method(), error))) ca_path, cipher, TRUE, error)))
{ {
return 0; return 0;
} }
...@@ -284,7 +286,7 @@ new_VioSSLAcceptorFd(const char *key_file, const char *cert_file, ...@@ -284,7 +286,7 @@ new_VioSSLAcceptorFd(const char *key_file, const char *cert_file,
struct st_VioSSLFd *ssl_fd; struct st_VioSSLFd *ssl_fd;
int verify= SSL_VERIFY_PEER | SSL_VERIFY_CLIENT_ONCE; int verify= SSL_VERIFY_PEER | SSL_VERIFY_CLIENT_ONCE;
if (!(ssl_fd= new_VioSSLFd(key_file, cert_file, ca_file, if (!(ssl_fd= new_VioSSLFd(key_file, cert_file, ca_file,
ca_path, cipher, TLSv1_server_method(), error))) ca_path, cipher, FALSE, error)))
{ {
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment