git » android-tools.git » commit 11b3abb

OpenSSL 1.1

author Jan de Groot
2017-03-23 13:28:58 UTC
committer Jan de Groot
2017-03-23 13:28:58 UTC
parent eda7236ea710d35d07e568616fc31d8ff29eb58c

OpenSSL 1.1

PKGBUILD +7 -3
openssl-1.1.0.patch +32 -0

diff --git a/PKGBUILD b/PKGBUILD
index 4dab7ec..98dc374 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@
 
 pkgname=android-tools
 pkgver=7.1.1_r13
-pkgrel=1
+pkgrel=2
 pkgdesc='Android platform tools'
 arch=(i686 x86_64)
 url='http://tools.android.com/'
@@ -19,7 +19,8 @@ source=(git+https://android.googlesource.com/platform/system/core#tag=android-$p
         build.sh # regenerate this file with generate_build.rb tool
         fix_build.patch
         bash_completion.fastboot
-        bash_completion.adb) # Bash completion file was taken from https://github.com/mbrubeck/android-completion
+        bash_completion.adb
+        openssl-1.1.0.patch) # Bash completion file was taken from https://github.com/mbrubeck/android-completion
 sha1sums=('SKIP'
           'SKIP'
           'SKIP'
@@ -27,10 +28,13 @@ sha1sums=('SKIP'
           '84dd43a0102e35fcdf0a855c617e1d151f49fb2a'
           '33538c9161c199f1e608d3b8f519adb1cd9d46d5'
           '7004dbd0c193668827174880de6f8434de8ceaee'
-          '2e69152091bb9642be058e49ec6cb720a2fd91dc')
+          '2e69152091bb9642be058e49ec6cb720a2fd91dc'
+          'e5cad0915d4b4398783ff2b72ad079eb26747fdb')
 
 prepare() {
   patch -p1 < fix_build.patch
+  cd core
+  patch -Np1 -i ../openssl-1.1.0.patch
 }
 
 build() {
diff --git a/openssl-1.1.0.patch b/openssl-1.1.0.patch
new file mode 100644
index 0000000..ef27b8d
--- /dev/null
+++ b/openssl-1.1.0.patch
@@ -0,0 +1,32 @@
+diff --git a/adb/adb_auth_host.cpp b/adb/adb_auth_host.cpp
+index 7b6671d73..d9fc00f86 100644
+--- a/adb/adb_auth_host.cpp
++++ b/adb/adb_auth_host.cpp
+@@ -71,6 +71,8 @@ static int RSA_to_RSAPublicKey(RSA *rsa, RSAPublicKey *pkey)
+     BIGNUM* rem = BN_new();
+     BIGNUM* n = BN_new();
+     BIGNUM* n0inv = BN_new();
++    const BIGNUM* rsa_n;
++    const BIGNUM* rsa_e;
+ 
+     if (RSA_size(rsa) != RSANUMBYTES) {
+         ret = 0;
+@@ -78,7 +80,8 @@ static int RSA_to_RSAPublicKey(RSA *rsa, RSAPublicKey *pkey)
+     }
+ 
+     BN_set_bit(r32, 32);
+-    BN_copy(n, rsa->n);
++    RSA_get0_key (rsa, &rsa_n, &rsa_e, NULL);
++    BN_copy(n, rsa_n);
+     BN_set_bit(r, RSANUMWORDS * 32);
+     BN_mod_sqr(rr, r, n, ctx);
+     BN_div(NULL, rem, n, r32, ctx);
+@@ -92,7 +95,7 @@ static int RSA_to_RSAPublicKey(RSA *rsa, RSAPublicKey *pkey)
+         BN_div(n, rem, n, r32, ctx);
+         pkey->n[i] = BN_get_word(rem);
+     }
+-    pkey->exponent = BN_get_word(rsa->e);
++    pkey->exponent = BN_get_word(rsa_e);
+ 
+ out:
+     BN_free(n0inv);