Skip to content

Commit f61a980

Browse files
vaintroubsanja-byelkin
authored andcommitted
Update WolfSSL, remove older workarounds.
1 parent 2792c6e commit f61a980

File tree

6 files changed

+8
-52
lines changed

6 files changed

+8
-52
lines changed

extra/wolfssl/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/wolfssl)
4040
IF(MSVC)
4141
# size_t to long truncation warning
4242
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -wd4267 -wd4334")
43-
IF(CMAKE_C_COMPILER_ID MATCHES Clang)
44-
# Workaround a bug with clang-cl, see https://github.com/wolfSSL/wolfssl/pull/2090
45-
ADD_DEFINITIONS(-DMP_16BIT)
46-
ENDIF()
4743
ENDIF()
4844

4945
ADD_CONVENIENCE_LIBRARY(wolfssl ${WOLFSSL_SOURCES})

extra/wolfssl/wolfssl

Submodule wolfssl updated 185 files

mysys_ssl/my_crypt.cc

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -88,24 +88,8 @@ class MyCTX
8888
}
8989
virtual int finish(uchar *dst, uint *dlen)
9090
{
91-
#ifdef HAVE_WOLFSSL
92-
/*
93-
Bug in WolfSSL - sometimes EVP_CipherFinal_ex
94-
returns success without setting destination length
95-
when it should return error.
96-
We catch it by presetting invalid value for length,
97-
and checking if it has changed after the call.
98-
99-
See https://github.com/wolfSSL/wolfssl/issues/2224
100-
*/
101-
*dlen= UINT_MAX;
102-
#endif
10391
if (EVP_CipherFinal_ex(ctx, dst, (int*)dlen) != 1)
10492
return MY_AES_BAD_DATA;
105-
#ifdef HAVE_WOLFSSL
106-
if (*dlen == UINT_MAX)
107-
return MY_AES_BAD_DATA;
108-
#endif
10993
return MY_AES_OK;
11094
}
11195
};

storage/innobase/log/log0crypt.cc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,6 @@ my_bool srv_encrypt_log;
4141

4242
struct aes_block_t {
4343
byte bytes[MY_AES_BLOCK_SIZE];
44-
#ifdef HAVE_WOLFSSL
45-
// Workaround for MDEV-19582.
46-
// WolfSSL reads memory out of bounds with decrypt/NOPAD
47-
// Pad the structure to workaround
48-
byte pad[MY_AES_BLOCK_SIZE];
49-
#endif
5044
};
5145

5246
struct crypt_info_t {

storage/innobase/row/row0log.cc

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,6 @@ Created 2011-05-26 Marko Makela
4242
#include <algorithm>
4343
#include <map>
4444

45-
#ifdef HAVE_WOLFSSL
46-
// Workaround for MDEV-19582
47-
// (WolfSSL reads memory out of bounds with decryption/NOPAD)
48-
#define WOLFSSL_PAD_SIZE MY_AES_BLOCK_SIZE
49-
#else
50-
#define WOLFSSL_PAD_SIZE 0
51-
#endif
52-
5345
Atomic_counter<ulint> onlineddl_rowlog_rows;
5446
ulint onlineddl_rowlog_pct_used;
5547
ulint onlineddl_pct_progress;
@@ -301,7 +293,7 @@ row_log_block_allocate(
301293
);
302294

303295
log_buf.block = ut_allocator<byte>(mem_key_row_log_buf)
304-
.allocate_large(srv_sort_buf_size + WOLFSSL_PAD_SIZE,
296+
.allocate_large(srv_sort_buf_size,
305297
&log_buf.block_pfx);
306298

307299
if (log_buf.block == NULL) {
@@ -323,7 +315,7 @@ row_log_block_free(
323315
if (log_buf.block != NULL) {
324316
ut_allocator<byte>(mem_key_row_log_buf).deallocate_large(
325317
log_buf.block, &log_buf.block_pfx,
326-
log_buf.size + WOLFSSL_PAD_SIZE);
318+
log_buf.size);
327319
log_buf.block = NULL;
328320
}
329321
DBUG_VOID_RETURN;
@@ -3239,7 +3231,7 @@ row_log_allocate(
32393231
index->online_log = log;
32403232

32413233
if (log_tmp_is_encrypted()) {
3242-
ulint size = srv_sort_buf_size + WOLFSSL_PAD_SIZE;
3234+
ulint size = srv_sort_buf_size;
32433235
log->crypt_head = static_cast<byte *>(os_mem_alloc_large(&size));
32443236
log->crypt_tail = static_cast<byte *>(os_mem_alloc_large(&size));
32453237

@@ -3273,13 +3265,11 @@ row_log_free(
32733265
row_merge_file_destroy_low(log->fd);
32743266

32753267
if (log->crypt_head) {
3276-
os_mem_free_large(log->crypt_head, srv_sort_buf_size
3277-
+ WOLFSSL_PAD_SIZE);
3268+
os_mem_free_large(log->crypt_head, srv_sort_buf_size);
32783269
}
32793270

32803271
if (log->crypt_tail) {
3281-
os_mem_free_large(log->crypt_tail, srv_sort_buf_size
3282-
+ WOLFSSL_PAD_SIZE);
3272+
os_mem_free_large(log->crypt_tail, srv_sort_buf_size);
32833273
}
32843274

32853275
mutex_free(&log->mutex);

storage/innobase/row/row0merge.cc

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,6 @@ Completed by Sunny Bains and Marko Makela
5454
# define posix_fadvise(fd, offset, len, advice) /* nothing */
5555
#endif /* _WIN32 */
5656

57-
#ifdef HAVE_WOLFSSL
58-
// Workaround for MDEV-19582
59-
// (WolfSSL accesses memory out of bounds)
60-
# define WOLFSSL_PAD_SIZE MY_AES_BLOCK_SIZE
61-
#else
62-
# define WOLFSSL_PAD_SIZE 0
63-
#endif
64-
6557
/* Whether to disable file system cache */
6658
char srv_disable_sort_file_cache;
6759

@@ -4627,7 +4619,7 @@ row_merge_build_indexes(
46274619

46284620
if (log_tmp_is_encrypted()) {
46294621
crypt_block = static_cast<row_merge_block_t*>(
4630-
alloc.allocate_large(block_size + WOLFSSL_PAD_SIZE,
4622+
alloc.allocate_large(block_size,
46314623
&crypt_pfx));
46324624

46334625
if (crypt_block == NULL) {
@@ -4999,7 +4991,7 @@ row_merge_build_indexes(
49994991

50004992
if (crypt_block) {
50014993
alloc.deallocate_large(crypt_block, &crypt_pfx,
5002-
block_size + WOLFSSL_PAD_SIZE);
4994+
block_size);
50034995
}
50044996

50054997
DICT_TF2_FLAG_UNSET(new_table, DICT_TF2_FTS_ADD_DOC_ID);

0 commit comments

Comments
 (0)