summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-dbs
diff options
context:
space:
mode:
authorMingli Yu <mingli.yu@windriver.com>2022-03-30 14:17:54 +0800
committerKhem Raj <raj.khem@gmail.com>2022-03-30 07:51:38 -0700
commit7eace39caf91aeb18a5f69d577e792046f704772 (patch)
treeaedac9121684896fcfd675523c7ac28a35241e47 /meta-oe/recipes-dbs
parent9a52bfc4a646003088490de13e6500392ce01442 (diff)
downloadmeta-openembedded-7eace39caf91aeb18a5f69d577e792046f704772.tar.gz
mariadb: increase MY_AES_CTX_SIZE
Rework the patch to fix the build failure with bundled openssl and the missing part [1] already included in mariadb 10.8.x [2]. Add PACKAGECONFIG:remove:pn-mariadb = " openssl" to local.conf $ bitbake mariadb | /buildpath/mariadb/10.7.3-r0/mariadb-10.7.3/mysys_ssl/my_crypt.cc:18: | /buildpath/mariadb/10.7.3-r0/mariadb-10.7.3/mysys_ssl/my_crypt.cc: In member function 'virtual int MyCTX_nopad::init(const EVP_CIPHER*, int, const uchar*, uint, const uchar*, uint)': | /buildpath/mariadb/10.7.3-r0/mariadb-10.7.3/include/my_global.h:387:74: error: narrowing conversion of '-1' from 'int' to 'long unsigned int' [-Wnarrowing] 387 | typedef char compile_time_assert[(X) ? 1 : -1] _attribute_((unused)); \ [1] https://github.com/MariaDB/server/commit/7cd965af92db1e45d4568996808c6c942d3f0cc7 [2] https://github.com/MariaDB/server/commit/d42c2efbaa06a0307c2f0fd8fa87819ff50bbd7e Signed-off-by: Mingli Yu <mingli.yu@windriver.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-dbs')
-rw-r--r--meta-oe/recipes-dbs/mysql/mariadb/mariadb-openssl3.patch53
1 files changed, 42 insertions, 11 deletions
diff --git a/meta-oe/recipes-dbs/mysql/mariadb/mariadb-openssl3.patch b/meta-oe/recipes-dbs/mysql/mariadb/mariadb-openssl3.patch
index db123e4a1..878675f30 100644
--- a/meta-oe/recipes-dbs/mysql/mariadb/mariadb-openssl3.patch
+++ b/meta-oe/recipes-dbs/mysql/mariadb/mariadb-openssl3.patch
@@ -1,4 +1,4 @@
1From c80991c79f701dac42c630af4bd39593b0c7efb4 Mon Sep 17 00:00:00 2001 1From 1626955f3a2107ec4c7fd927ebfa3c6c1d2b09b8 Mon Sep 17 00:00:00 2001
2From: Vladislav Vaintroub <wlad@mariadb.com> 2From: Vladislav Vaintroub <wlad@mariadb.com>
3Date: Mon, 8 Nov 2021 18:48:19 +0100 3Date: Mon, 8 Nov 2021 18:48:19 +0100
4Subject: [PATCH] MDEV-25785 Add support for OpenSSL 3.0 4Subject: [PATCH] MDEV-25785 Add support for OpenSSL 3.0
@@ -29,19 +29,22 @@ Summary of changes
29 29
30Patch from Fedora https://src.fedoraproject.org/rpms/mariadb/raw/rawhide/f/mariadb-openssl3.patch 30Patch from Fedora https://src.fedoraproject.org/rpms/mariadb/raw/rawhide/f/mariadb-openssl3.patch
31 31
32Upstream-Status: Pending 32Upstream-Status: Backport [https://github.com/MariaDB/server/commit/d42c2efbaa06a0307c2f0fd8fa87819ff50bbd7e]
33Signed-off-by: Khem Raj <raj.khem@gmail.com> 33Signed-off-by: Khem Raj <raj.khem@gmail.com>
34Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
34--- 35---
35 cmake/ssl.cmake | 19 ++++- 36 cmake/ssl.cmake | 21 +++++-
37 include/mysql/service_my_crypt.h | 2 +-
36 include/ssl_compat.h | 3 +- 38 include/ssl_compat.h | 3 +-
37 mysql-test/lib/openssl.cnf | 2 +- 39 mysql-test/lib/openssl.cnf | 2 +-
38 mysql-test/main/ssl_cipher.result | 6 +- 40 mysql-test/main/ssl_cipher.result | 6 +-
39 mysql-test/main/ssl_cipher.test | 2 +- 41 mysql-test/main/ssl_cipher.test | 2 +-
40 mysys_ssl/my_crypt.cc | 46 +++++++----- 42 mysys_ssl/my_crypt.cc | 46 +++++++-----
41 unittest/mysys/aes-t.c | 121 ++++++++++++++++++++++-------- 43 unittest/mysys/aes-t.c | 121 ++++++++++++++++++++++--------
42 7 files changed, 141 insertions(+), 58 deletions(-) 44 8 files changed, 143 insertions(+), 60 deletions(-)
43
44 45
46diff --git a/cmake/ssl.cmake b/cmake/ssl.cmake
47index a6793cf3..64c93ff9 100644
45--- a/cmake/ssl.cmake 48--- a/cmake/ssl.cmake
46+++ b/cmake/ssl.cmake 49+++ b/cmake/ssl.cmake
47@@ -118,7 +118,7 @@ MACRO (MYSQL_CHECK_SSL) 50@@ -118,7 +118,7 @@ MACRO (MYSQL_CHECK_SSL)
@@ -88,6 +91,21 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
88 ELSE() 91 ELSE()
89 IF(WITH_SSL STREQUAL "system") 92 IF(WITH_SSL STREQUAL "system")
90 MESSAGE(FATAL_ERROR "Cannot find appropriate system libraries for SSL. Use WITH_SSL=bundled to enable SSL support") 93 MESSAGE(FATAL_ERROR "Cannot find appropriate system libraries for SSL. Use WITH_SSL=bundled to enable SSL support")
94diff --git a/include/mysql/service_my_crypt.h b/include/mysql/service_my_crypt.h
95index 2a232117..bb038aaa 100644
96--- a/include/mysql/service_my_crypt.h
97+++ b/include/mysql/service_my_crypt.h
98@@ -45,7 +45,7 @@ extern "C" {
99 /* The max key length of all supported algorithms */
100 #define MY_AES_MAX_KEY_LENGTH 32
101
102-#define MY_AES_CTX_SIZE 656
103+#define MY_AES_CTX_SIZE 672
104
105 enum my_aes_mode {
106 MY_AES_ECB, MY_AES_CBC
107diff --git a/include/ssl_compat.h b/include/ssl_compat.h
108index 8dc12254..6db1baab 100644
91--- a/include/ssl_compat.h 109--- a/include/ssl_compat.h
92+++ b/include/ssl_compat.h 110+++ b/include/ssl_compat.h
93@@ -24,7 +24,7 @@ 111@@ -24,7 +24,7 @@
@@ -107,6 +125,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
107 #define EVP_CIPHER_CTX_encrypting(ctx) ((ctx)->encrypt) 125 #define EVP_CIPHER_CTX_encrypting(ctx) ((ctx)->encrypt)
108 #define EVP_CIPHER_CTX_SIZE sizeof(EVP_CIPHER_CTX) 126 #define EVP_CIPHER_CTX_SIZE sizeof(EVP_CIPHER_CTX)
109 127
128diff --git a/mysql-test/lib/openssl.cnf b/mysql-test/lib/openssl.cnf
129index b9ab37ac..7cd6f748 100644
110--- a/mysql-test/lib/openssl.cnf 130--- a/mysql-test/lib/openssl.cnf
111+++ b/mysql-test/lib/openssl.cnf 131+++ b/mysql-test/lib/openssl.cnf
112@@ -9,4 +9,4 @@ ssl_conf = ssl_section 132@@ -9,4 +9,4 @@ ssl_conf = ssl_section
@@ -115,6 +135,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
115 [system_default_section] 135 [system_default_section]
116-CipherString = ALL:@SECLEVEL=1 136-CipherString = ALL:@SECLEVEL=1
117+CipherString = ALL:@SECLEVEL=0 137+CipherString = ALL:@SECLEVEL=0
138diff --git a/mysql-test/main/ssl_cipher.result b/mysql-test/main/ssl_cipher.result
139index 930d384e..66d817b7 100644
118--- a/mysql-test/main/ssl_cipher.result 140--- a/mysql-test/main/ssl_cipher.result
119+++ b/mysql-test/main/ssl_cipher.result 141+++ b/mysql-test/main/ssl_cipher.result
120@@ -61,8 +61,8 @@ connect ssl_con,localhost,root,,,,,SSL; 142@@ -61,8 +61,8 @@ connect ssl_con,localhost,root,,,,,SSL;
@@ -129,9 +151,11 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
129+1 151+1
130 disconnect ssl_con; 152 disconnect ssl_con;
131 connection default; 153 connection default;
154diff --git a/mysql-test/main/ssl_cipher.test b/mysql-test/main/ssl_cipher.test
155index 36549d76..d4cdcffb 100644
132--- a/mysql-test/main/ssl_cipher.test 156--- a/mysql-test/main/ssl_cipher.test
133+++ b/mysql-test/main/ssl_cipher.test 157+++ b/mysql-test/main/ssl_cipher.test
134@@ -98,6 +98,6 @@ let $restart_parameters=--ssl-cipher=AES 158@@ -98,6 +98,6 @@ let $restart_parameters=--ssl-cipher=AES128-SHA;
135 source include/restart_mysqld.inc; 159 source include/restart_mysqld.inc;
136 connect (ssl_con,localhost,root,,,,,SSL); 160 connect (ssl_con,localhost,root,,,,,SSL);
137 SHOW STATUS LIKE 'Ssl_cipher'; 161 SHOW STATUS LIKE 'Ssl_cipher';
@@ -139,6 +163,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
139+SELECT VARIABLE_VALUE like '%AES128-SHA%' FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='Ssl_cipher_list'; 163+SELECT VARIABLE_VALUE like '%AES128-SHA%' FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='Ssl_cipher_list';
140 disconnect ssl_con; 164 disconnect ssl_con;
141 connection default; 165 connection default;
166diff --git a/mysys_ssl/my_crypt.cc b/mysys_ssl/my_crypt.cc
167index e512eee9..4d7ebc7b 100644
142--- a/mysys_ssl/my_crypt.cc 168--- a/mysys_ssl/my_crypt.cc
143+++ b/mysys_ssl/my_crypt.cc 169+++ b/mysys_ssl/my_crypt.cc
144@@ -29,11 +29,7 @@ 170@@ -29,11 +29,7 @@
@@ -164,7 +190,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
164 190
165 MyCTX_nopad() : MyCTX() { } 191 MyCTX_nopad() : MyCTX() { }
166 ~MyCTX_nopad() { } 192 ~MyCTX_nopad() { }
167@@ -112,7 +109,7 @@ public: 193@@ -112,7 +109,7 @@ class MyCTX_nopad : public MyCTX
168 compile_time_assert(MY_AES_CTX_SIZE >= sizeof(MyCTX_nopad)); 194 compile_time_assert(MY_AES_CTX_SIZE >= sizeof(MyCTX_nopad));
169 this->key= key; 195 this->key= key;
170 this->klen= klen; 196 this->klen= klen;
@@ -173,7 +199,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
173 if (ivlen) 199 if (ivlen)
174 memcpy(oiv, iv, ivlen); 200 memcpy(oiv, iv, ivlen);
175 DBUG_ASSERT(ivlen == 0 || ivlen == sizeof(oiv)); 201 DBUG_ASSERT(ivlen == 0 || ivlen == sizeof(oiv));
176@@ -123,26 +120,41 @@ public: 202@@ -123,26 +120,41 @@ class MyCTX_nopad : public MyCTX
177 return res; 203 return res;
178 } 204 }
179 205
@@ -223,7 +249,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
223 */ 249 */
224 uchar mask[MY_AES_BLOCK_SIZE]; 250 uchar mask[MY_AES_BLOCK_SIZE];
225 uint mlen; 251 uint mlen;
226@@ -154,10 +166,10 @@ public: 252@@ -154,10 +166,10 @@ class MyCTX_nopad : public MyCTX
227 return rc; 253 return rc;
228 DBUG_ASSERT(mlen == sizeof(mask)); 254 DBUG_ASSERT(mlen == sizeof(mask));
229 255
@@ -237,6 +263,8 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
237 return MY_AES_OK; 263 return MY_AES_OK;
238 } 264 }
239 }; 265 };
266diff --git a/unittest/mysys/aes-t.c b/unittest/mysys/aes-t.c
267index 34704e06..cbec2760 100644
240--- a/unittest/mysys/aes-t.c 268--- a/unittest/mysys/aes-t.c
241+++ b/unittest/mysys/aes-t.c 269+++ b/unittest/mysys/aes-t.c
242@@ -21,27 +21,96 @@ 270@@ -21,27 +21,96 @@
@@ -331,12 +359,12 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
331+ /* Compare with non-bytewise encryption result*/ 359+ /* Compare with non-bytewise encryption result*/
332+ ok(dst_len == dst_len2 && memcmp(dst, dst2, dst_len) == 0, 360+ ok(dst_len == dst_len2 && memcmp(dst, dst2, dst_len) == 0,
333+ "memcmp bytewise %s %u", mode_str, src_len); 361+ "memcmp bytewise %s %u", mode_str, src_len);
334 } 362+ }
335+ else 363+ else
336+ { 364+ {
337+ int dst_len_real= my_aes_get_size(mode, src_len); 365+ int dst_len_real= my_aes_get_size(mode, src_len);
338+ ok(dst_len_real= dst_len, "my_aes_get_size"); 366+ ok(dst_len_real= dst_len, "my_aes_get_size");
339+ } 367 }
340+ my_md5(md5, (char *) dst, dst_len); 368+ my_md5(md5, (char *) dst, dst_len);
341+ ok(dst_len == dlen, "md5 len"); 369+ ok(dst_len == dlen, "md5 len");
342+ ok(memcmp(md5, hash, sizeof(md5)) == 0, "md5"); 370+ ok(memcmp(md5, hash, sizeof(md5)) == 0, "md5");
@@ -383,3 +411,6 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
383 DO_TEST_P(MY_AES_ECB, 200, '.', 208, "\xd8\x73\x8e\x3a\xbc\x66\x99\x13\x7f\x90\x23\x52\xee\x97\x6f\x9a"); 411 DO_TEST_P(MY_AES_ECB, 200, '.', 208, "\xd8\x73\x8e\x3a\xbc\x66\x99\x13\x7f\x90\x23\x52\xee\x97\x6f\x9a");
384 DO_TEST_P(MY_AES_ECB, 128, '?', 144, "\x19\x58\x33\x85\x4c\xaa\x7f\x06\xd1\xb2\xec\xd7\xb7\x6a\xa9\x5b"); 412 DO_TEST_P(MY_AES_ECB, 128, '?', 144, "\x19\x58\x33\x85\x4c\xaa\x7f\x06\xd1\xb2\xec\xd7\xb7\x6a\xa9\x5b");
385 DO_TEST_P(MY_AES_CBC, 159, '%', 160, "\x4b\x03\x18\x3d\xf1\xa7\xcd\xa1\x46\xb3\xc6\x8a\x92\xc0\x0f\xc9"); 413 DO_TEST_P(MY_AES_CBC, 159, '%', 160, "\x4b\x03\x18\x3d\xf1\xa7\xcd\xa1\x46\xb3\xc6\x8a\x92\xc0\x0f\xc9");
414--
4152.25.1
416