summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>2024-05-28 14:18:26 +0300
committerKhem Raj <raj.khem@gmail.com>2024-05-29 20:57:55 -0700
commit86b7862ae45aeaa09f9020274bbb57676acba7ca (patch)
tree87ffa80cb6771858333e2da01e177735fed3ec56
parent7ecfdeb3cf4e13801b63f0c05afd572d9df54403 (diff)
downloadmeta-openembedded-86b7862ae45aeaa09f9020274bbb57676acba7ca.tar.gz
android-tools: fix adb/libssl-1.1 patch
GCC 14.0 being stricter regarding const pointers pointed out the issue in the adb_libssl_11.diff. RSA_get0_key returns pointers to internal data of an RSA key structure. As such, this data should use const pointers, should not be allocated and, more importantly, should not be freed. Update the patch to use const pointers, drop allocation and freeing of the 'n' big number. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-oe/recipes-devtools/android-tools/android-tools/core/adb_libssl_11.diff11
1 files changed, 8 insertions, 3 deletions
diff --git a/meta-oe/recipes-devtools/android-tools/android-tools/core/adb_libssl_11.diff b/meta-oe/recipes-devtools/android-tools/android-tools/core/adb_libssl_11.diff
index 177d69a97a..ddb41ea4b0 100644
--- a/meta-oe/recipes-devtools/android-tools/android-tools/core/adb_libssl_11.diff
+++ b/meta-oe/recipes-devtools/android-tools/android-tools/core/adb_libssl_11.diff
@@ -17,9 +17,10 @@ Upstream-Status: Pending
17+++ b/adb/adb_auth_host.c 17+++ b/adb/adb_auth_host.c
18@@ -75,6 +75,7 @@ static int RSA_to_RSAPublicKey(RSA *rsa, 18@@ -75,6 +75,7 @@ static int RSA_to_RSAPublicKey(RSA *rsa,
19 BIGNUM* rem = BN_new(); 19 BIGNUM* rem = BN_new();
20 BIGNUM* n = BN_new(); 20- BIGNUM* n = BN_new();
21+ const BIGNUM* n;
21 BIGNUM* n0inv = BN_new(); 22 BIGNUM* n0inv = BN_new();
22+ BIGNUM* e = BN_new(); 23+ const BIGNUM* e;
23 24
24 if (RSA_size(rsa) != RSANUMBYTES) { 25 if (RSA_size(rsa) != RSANUMBYTES) {
25 ret = 0; 26 ret = 0;
@@ -32,7 +33,7 @@ Upstream-Status: Pending
32 BN_set_bit(r, RSANUMWORDS * 32); 33 BN_set_bit(r, RSANUMWORDS * 32);
33 BN_mod_sqr(rr, r, n, ctx); 34 BN_mod_sqr(rr, r, n, ctx);
34 BN_div(NULL, rem, n, r32, ctx); 35 BN_div(NULL, rem, n, r32, ctx);
35@@ -96,7 +97,7 @@ static int RSA_to_RSAPublicKey(RSA *rsa, 36@@ -96,11 +97,10 @@ static int RSA_to_RSAPublicKey(RSA *rsa,
36 BN_div(n, rem, n, r32, ctx); 37 BN_div(n, rem, n, r32, ctx);
37 pkey->n[i] = BN_get_word(rem); 38 pkey->n[i] = BN_get_word(rem);
38 } 39 }
@@ -41,3 +42,7 @@ Upstream-Status: Pending
41 42
42 out: 43 out:
43 BN_free(n0inv); 44 BN_free(n0inv);
45- BN_free(n);
46 BN_free(rem);
47 BN_free(r);
48 BN_free(rr);