All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/android-tools: Fix build with OpenSSL 1.1.x
@ 2019-02-04 23:30 Vadim Kochan
  2019-02-05  9:05 ` Peter Korsgaard
  0 siblings, 1 reply; 2+ messages in thread
From: Vadim Kochan @ 2019-02-04 23:30 UTC (permalink / raw)
  To: buildroot

Use patch from:

	https://github.com/lede-project/source/commit/f63f20fb93c7e67775cb01d97fc88b5b29452b81

which fixes compilation of adb with OpenSSL 1.1.x, and took only part
for adb only.

Fixes:

	http://autobuild.buildroot.net/results/66f/66f05eb9a56aa8526a1420334d68c7eda094e90e/

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
---
 ...ded-patch-for-openssl-1.1.0-compatibility.patch | 47 ++++++++++++++++++++++
 1 file changed, 47 insertions(+)
 create mode 100644 package/android-tools/0010-adb-added-patch-for-openssl-1.1.0-compatibility.patch

diff --git a/package/android-tools/0010-adb-added-patch-for-openssl-1.1.0-compatibility.patch b/package/android-tools/0010-adb-added-patch-for-openssl-1.1.0-compatibility.patch
new file mode 100644
index 0000000000..2de338368f
--- /dev/null
+++ b/package/android-tools/0010-adb-added-patch-for-openssl-1.1.0-compatibility.patch
@@ -0,0 +1,47 @@
+From bb3da0e32be4f2260940edf3ee0f88103dfd0dcc Mon Sep 17 00:00:00 2001
+From: Eneas U de Queiroz <cote2004-github@yahoo.com>
+Date: Tue, 5 Feb 2019 01:12:19 +0200
+Subject: [PATCH] adb: added patch for openssl 1.1.0 compatibility
+
+Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
+
+[Vadim: took only adb related part from
+https://github.com/lede-project/source/commit/f63f20fb93c7e67775cb01d97fc88b5b29452b81]
+Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
+---
+ core/adb/adb_auth_host.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/core/adb/adb_auth_host.c b/core/adb/adb_auth_host.c
+index 9039d42..debd2ef 100644
+--- a/core/adb/adb_auth_host.c
++++ b/core/adb/adb_auth_host.c
+@@ -79,7 +79,13 @@ static int RSA_to_RSAPublicKey(RSA *rsa, RSAPublicKey *pkey)
+     }
+ 
+     BN_set_bit(r32, 32);
++#if OPENSSL_VERSION_NUMBER >= 0x10100000L
++    const BIGNUM *rsa_n, *rsa_e;
++    RSA_get0_key(rsa, &rsa_n, &rsa_e, NULL);
++    BN_copy(n, rsa_n);
++#else
+     BN_copy(n, rsa->n);
++#endif
+     BN_set_bit(r, RSANUMWORDS * 32);
+     BN_mod_sqr(rr, r, n, ctx);
+     BN_div(NULL, rem, n, r32, ctx);
+@@ -93,7 +99,11 @@ static int RSA_to_RSAPublicKey(RSA *rsa, RSAPublicKey *pkey)
+         BN_div(n, rem, n, r32, ctx);
+         pkey->n[i] = BN_get_word(rem);
+     }
++#if OPENSSL_VERSION_NUMBER >= 0x10100000L
++    pkey->exponent = BN_get_word(rsa_e);
++#else
+     pkey->exponent = BN_get_word(rsa->e);
++#endif
+ 
+ out:
+     BN_free(n0inv);
+-- 
+2.14.1
+
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Buildroot] [PATCH 1/1] package/android-tools: Fix build with OpenSSL 1.1.x
  2019-02-04 23:30 [Buildroot] [PATCH 1/1] package/android-tools: Fix build with OpenSSL 1.1.x Vadim Kochan
@ 2019-02-05  9:05 ` Peter Korsgaard
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Korsgaard @ 2019-02-05  9:05 UTC (permalink / raw)
  To: buildroot

>>>>> "Vadim" == Vadim Kochan <vadim4j@gmail.com> writes:

 > Use patch from:
 > 	https://github.com/lede-project/source/commit/f63f20fb93c7e67775cb01d97fc88b5b29452b81

 > which fixes compilation of adb with OpenSSL 1.1.x, and took only part
 > for adb only.

 > Fixes:

 > 	http://autobuild.buildroot.net/results/66f/66f05eb9a56aa8526a1420334d68c7eda094e90e/

 > Signed-off-by: Vadim Kochan <vadim4j@gmail.com>

Committed, thanks.

I did a quick build both with libressl and and openssl without
issues. Longer term we might want to bump the version. Debian have
patches for 1.1.1x support as well:

https://sources.debian.org/patches/android-tools/5.1.1.r38-1.1/

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-02-05  9:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-04 23:30 [Buildroot] [PATCH 1/1] package/android-tools: Fix build with OpenSSL 1.1.x Vadim Kochan
2019-02-05  9:05 ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.