Skip to content

Commit fd68a7d

Browse files
author
Nirbhay Choubey
committed
Merge tag 'mariadb-5.5.46' into 5.5-galera
2 parents 13615c5 + 16c4b3c commit fd68a7d

File tree

112 files changed

+2263
-488
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+2263
-488
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
MYSQL_VERSION_MAJOR=5
22
MYSQL_VERSION_MINOR=5
3-
MYSQL_VERSION_PATCH=45
3+
MYSQL_VERSION_PATCH=46
44
MYSQL_VERSION_EXTRA=

client/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
22
#
33
# This program is free software; you can redistribute it and/or modify
44
# it under the terms of the GNU General Public License as published by
@@ -47,6 +47,7 @@ MYSQL_ADD_EXECUTABLE(mysqldump mysqldump.c ../sql-common/my_user.c)
4747
TARGET_LINK_LIBRARIES(mysqldump mysqlclient)
4848

4949
MYSQL_ADD_EXECUTABLE(mysqlimport mysqlimport.c)
50+
SET_SOURCE_FILES_PROPERTIES(mysqlimport.c PROPERTIES COMPILE_FLAGS "-DTHREADS")
5051
TARGET_LINK_LIBRARIES(mysqlimport mysqlclient)
5152

5253
MYSQL_ADD_EXECUTABLE(mysql_upgrade mysql_upgrade.c COMPONENT Server)

client/mysqlimport.c

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
2-
Copyright (c) 2000, 2012, Oracle and/or its affiliates.
2+
Copyright (c) 2000, 2015, Oracle and/or its affiliates.
3+
Copyright (c) 2011, 2015, MariaDB
34
45
This program is free software; you can redistribute it and/or modify
56
it under the terms of the GNU General Public License as published by
@@ -30,19 +31,14 @@
3031

3132
#include "client_priv.h"
3233
#include "mysql_version.h"
33-
#ifdef HAVE_LIBPTHREAD
34-
#include <my_pthread.h>
35-
#endif
3634

3735
#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
3836

3937

4038
/* Global Thread counter */
41-
uint counter;
42-
#ifdef HAVE_LIBPTHREAD
39+
uint counter= 0;
4340
pthread_mutex_t counter_mutex;
4441
pthread_cond_t count_threshhold;
45-
#endif
4642

4743
static void db_error_with_table(MYSQL *mysql, char *table);
4844
static void db_error(MYSQL *mysql);
@@ -486,6 +482,11 @@ static void safe_exit(int error, MYSQL *mysql)
486482
{
487483
if (error && ignore_errors)
488484
return;
485+
486+
/* in multi-threaded mode protect from concurrent safe_exit's */
487+
if (counter)
488+
pthread_mutex_lock(&counter_mutex);
489+
489490
if (mysql)
490491
mysql_close(mysql);
491492

@@ -568,7 +569,6 @@ static char *field_escape(char *to,const char *from,uint length)
568569

569570
int exitcode= 0;
570571

571-
#ifdef HAVE_LIBPTHREAD
572572
pthread_handler_t worker_thread(void *arg)
573573
{
574574
int error;
@@ -608,7 +608,6 @@ pthread_handler_t worker_thread(void *arg)
608608

609609
return 0;
610610
}
611-
#endif
612611

613612

614613
int main(int argc, char **argv)
@@ -628,7 +627,6 @@ int main(int argc, char **argv)
628627
}
629628
sf_leaking_memory=0; /* from now on we cleanup properly */
630629

631-
#ifdef HAVE_LIBPTHREAD
632630
if (opt_use_threads && !lock_tables)
633631
{
634632
pthread_t mainthread; /* Thread descriptor */
@@ -682,7 +680,6 @@ int main(int argc, char **argv)
682680
pthread_attr_destroy(&attr);
683681
}
684682
else
685-
#endif
686683
{
687684
MYSQL *mysql= 0;
688685
if (!(mysql= db_connect(current_host,current_db,current_user,opt_password)))

cmake/os/Windows.cmake

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
22
#
33
# This program is free software; you can redistribute it and/or modify
44
# it under the terms of the GNU General Public License as published by
@@ -50,10 +50,12 @@ IF(CMAKE_C_COMPILER MATCHES "icl")
5050
SET(MSVC TRUE)
5151
ENDIF()
5252

53-
ADD_DEFINITIONS("-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE")
54-
ADD_DEFINITIONS("-D_WIN32_WINNT=0x0501")
53+
ADD_DEFINITIONS(-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE)
54+
ADD_DEFINITIONS(-D_WIN32_WINNT=0x0501)
55+
# We do not want the windows.h macros min/max
56+
ADD_DEFINITIONS(-DNOMINMAX)
5557
# Speed up build process excluding unused header files
56-
ADD_DEFINITIONS("-DWIN32_LEAN_AND_MEAN")
58+
ADD_DEFINITIONS(-DWIN32_LEAN_AND_MEAN)
5759

5860
# Adjust compiler and linker flags
5961
IF(MINGW AND CMAKE_SIZEOF_VOID_P EQUAL 4)

extra/yassl/README

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,35 @@ before calling SSL_new();
1212

1313
*** end Note ***
1414

15+
yaSSL Release notes, version 2.3.8 (9/17/2015)
16+
This release of yaSSL fixes a high security vulnerability. All users
17+
SHOULD update. If using yaSSL for TLS on the server side with private
18+
RSA keys allowing ephemeral key exchange you MUST update and regenerate
19+
the RSA private keys. This report is detailed in:
20+
https://people.redhat.com/~fweimer/rsa-crt-leaks.pdf
21+
yaSSL now detects RSA signature faults and returns an error.
22+
23+
yaSSL Patch notes, version 2.3.7e (6/26/2015)
24+
This release of yaSSL includes a fix for Date less than comparison.
25+
Previously yaSSL would return true on less than comparisons if the Dates
26+
were equal. Reported by Oracle. No security problem, but if a cert was
27+
generated right now, a server started using it in the same second, and a
28+
client tried to verify it in the same second it would report not yet valid.
29+
30+
yaSSL Patch notes, version 2.3.7d (6/22/2015)
31+
This release of yaSSL includes a fix for input_buffer set_current with
32+
index 0. SSL_peek() at front of waiting data could trigger. Robert
33+
Golebiowski of Oracle identified and suggested a fix, thanks!
34+
35+
yaSSL Patch notes, version 2.3.7c (6/12/2015)
36+
This release of yaSSL does certificate DATE comparisons to the second
37+
instead of to the minute, helpful when using freshly generated certs.
38+
Though keep in mind that time sync differences could still show up.
39+
40+
yaSSL Patch notes, version 2.3.7b (3/18/2015)
41+
This release of yaSSL fixes a potential crash with corrupted private keys.
42+
Also detects bad keys earlier for user.
43+
1544
yaSSL Release notes, version 2.3.7 (12/10/2014)
1645
This release of yaSSL fixes the potential to process duplicate handshake
1746
messages by explicitly marking/checking received handshake messages.

extra/yassl/include/openssl/ssl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#include "rsa.h"
3636

3737

38-
#define YASSL_VERSION "2.3.7"
38+
#define YASSL_VERSION "2.3.8"
3939

4040

4141
#if defined(__cplusplus)

extra/yassl/include/yassl_error.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ enum YasslError {
5353
compress_error = 118,
5454
decompress_error = 119,
5555
pms_version_error = 120,
56-
sanityCipher_error = 121
56+
sanityCipher_error = 121,
57+
rsaSignFault_error = 122
5758

5859
// !!!! add error message to .cpp !!!!
5960

extra/yassl/src/buffer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ void input_buffer::set_error()
165165

166166
void input_buffer::set_current(uint i)
167167
{
168-
if (error_ == 0 && (i == 0 || check(i - 1, size_) == 0))
168+
if (error_ == 0 && check(i ? i - 1 : 0, size_) == 0)
169169
current_ = i;
170170
else
171171
error_ = -1;

extra/yassl/src/handshake.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,6 +1172,8 @@ void sendCertificateVerify(SSL& ssl, BufferOutput buffer)
11721172

11731173
CertificateVerify verify;
11741174
verify.Build(ssl);
1175+
if (ssl.GetError()) return;
1176+
11751177
RecordLayerHeader rlHeader;
11761178
HandShakeHeader hsHeader;
11771179
mySTL::auto_ptr<output_buffer> out(NEW_YS output_buffer);

extra/yassl/src/ssl.cpp

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
#include "file.hpp" // for TaoCrypt Source
3838
#include "coding.hpp" // HexDecoder
3939
#include "helpers.hpp" // for placement new hack
40+
#include "rsa.hpp" // for TaoCrypt RSA key decode
41+
#include "dsa.hpp" // for TaoCrypt DSA key decode
4042
#include <stdio.h>
4143

4244
#ifdef _WIN32
@@ -54,6 +56,8 @@ namespace yaSSL {
5456

5557
int read_file(SSL_CTX* ctx, const char* file, int format, CertType type)
5658
{
59+
int ret = SSL_SUCCESS;
60+
5761
if (format != SSL_FILETYPE_ASN1 && format != SSL_FILETYPE_PEM)
5862
return SSL_BAD_FILETYPE;
5963

@@ -141,8 +145,31 @@ int read_file(SSL_CTX* ctx, const char* file, int format, CertType type)
141145
}
142146
}
143147
}
148+
149+
if (type == PrivateKey && ctx->privateKey_) {
150+
// see if key is valid early
151+
TaoCrypt::Source rsaSource(ctx->privateKey_->get_buffer(),
152+
ctx->privateKey_->get_length());
153+
TaoCrypt::RSA_PrivateKey rsaKey;
154+
rsaKey.Initialize(rsaSource);
155+
156+
if (rsaSource.GetError().What()) {
157+
// rsa failed see if DSA works
158+
159+
TaoCrypt::Source dsaSource(ctx->privateKey_->get_buffer(),
160+
ctx->privateKey_->get_length());
161+
TaoCrypt::DSA_PrivateKey dsaKey;
162+
dsaKey.Initialize(dsaSource);
163+
164+
if (rsaSource.GetError().What()) {
165+
// neither worked
166+
ret = SSL_FAILURE;
167+
}
168+
}
169+
}
170+
144171
fclose(input);
145-
return SSL_SUCCESS;
172+
return ret;
146173
}
147174

148175

0 commit comments

Comments
 (0)