| 1 | This patch is taken from Debian
|
| 2 | URL: https://sources.debian.org/data/main/a/android-platform-system-core/1%3A7.0.0%2Br33-1/debian/patches/adb_libssl_11.diff
|
| 3 | Description: adb: Make compatible with openssl 1.1
|
| 4 | OpenSSL version 1.1 brought some API changes which broke the build here,
|
| 5 | fix that by accessing rsa->n (and e) directly, using RSA_get0_key instead.
|
| 6 | Author: Chirayu Desai <[email protected]
|
| 7 | Last-Update: 2016-11-10
|
| 8 | |
| 9 | |
| 10 | @@ -71,6 +71,7 @@
|
| 11 | BIGNUM* rem = BN_new();
|
| 12 | BIGNUM* n = BN_new();
|
| 13 | BIGNUM* n0inv = BN_new();
|
| 14 | + BIGNUM* e = BN_new();
|
| 15 |
|
| 16 | if (RSA_size(rsa) != RSANUMBYTES) {
|
| 17 | ret = 0;
|
| 18 | @@ -78,7 +79,7 @@
|
| 19 | }
|
| 20 |
|
| 21 | BN_set_bit(r32, 32);
|
| 22 | - BN_copy(n, rsa->n);
|
| 23 | + RSA_get0_key(rsa, &n, &e, NULL);
|
| 24 | BN_set_bit(r, RSANUMWORDS * 32);
|
| 25 | BN_mod_sqr(rr, r, n, ctx);
|
| 26 | BN_div(NULL, rem, n, r32, ctx);
|
| 27 | @@ -92,7 +93,7 @@
|
| 28 | BN_div(n, rem, n, r32, ctx);
|
| 29 | pkey->n[i] = BN_get_word(rem);
|
| 30 | }
|
| 31 | - pkey->exponent = BN_get_word(rsa->e);
|
| 32 | + pkey->exponent = BN_get_word(e);
|
| 33 |
|
| 34 | out:
|
| 35 | BN_free(n0inv);
|