blob: 3ead649b1dbdd2f017aa06d4934781202bf555df [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001Description: adb: Make compatible with openssl 1.1
2 OpenSSL version 1.1 brought some API changes which broke the build here,
3 fix that by accessing rsa->n (and e) directly, using RSA_get0_key instead.
4Author: Chirayu Desai <chirayudesai1@gmail.com
5Last-Update: 2016-11-10
6---
7This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
8---
9 system/core/adb/adb_auth_host.c | 5 +++--
10 1 file changed, 3 insertions(+), 2 deletions(-)
11
12--- a/adb/adb_auth_host.c
13+++ b/adb/adb_auth_host.c
14@@ -75,6 +75,7 @@ static int RSA_to_RSAPublicKey(RSA *rsa,
15 BIGNUM* rem = BN_new();
16 BIGNUM* n = BN_new();
17 BIGNUM* n0inv = BN_new();
18+ BIGNUM* e = BN_new();
19
20 if (RSA_size(rsa) != RSANUMBYTES) {
21 ret = 0;
22@@ -82,7 +83,7 @@ static int RSA_to_RSAPublicKey(RSA *rsa,
23 }
24
25 BN_set_bit(r32, 32);
26- BN_copy(n, rsa->n);
27+ RSA_get0_key(rsa, &n, &e, NULL);
28 BN_set_bit(r, RSANUMWORDS * 32);
29 BN_mod_sqr(rr, r, n, ctx);
30 BN_div(NULL, rem, n, r32, ctx);
31@@ -96,7 +97,7 @@ static int RSA_to_RSAPublicKey(RSA *rsa,
32 BN_div(n, rem, n, r32, ctx);
33 pkey->n[i] = BN_get_word(rem);
34 }
35- pkey->exponent = BN_get_word(rsa->e);
36+ pkey->exponent = BN_get_word(e);
37
38 out:
39 BN_free(n0inv);