1
0

010-openssl-1.1.patch 759 B

12345678910111213141516171819202122232425262728
  1. --- a/adb/adb_auth_host.c
  2. +++ b/adb/adb_auth_host.c
  3. @@ -83,7 +83,13 @@ static int RSA_to_RSAPublicKey(RSA *rsa,
  4. }
  5. BN_set_bit(r32, 32);
  6. +#if OPENSSL_VERSION_NUMBER >= 0x10100000L
  7. + const BIGNUM *rsa_n, *rsa_e;
  8. + RSA_get0_key(rsa, &rsa_n, &rsa_e, NULL);
  9. + BN_copy(n, rsa_n);
  10. +#else
  11. BN_copy(n, rsa->n);
  12. +#endif
  13. BN_set_bit(r, RSANUMWORDS * 32);
  14. BN_mod_sqr(rr, r, n, ctx);
  15. BN_div(NULL, rem, n, r32, ctx);
  16. @@ -97,7 +103,11 @@ static int RSA_to_RSAPublicKey(RSA *rsa,
  17. BN_div(n, rem, n, r32, ctx);
  18. pkey->n[i] = BN_get_word(rem);
  19. }
  20. +#if OPENSSL_VERSION_NUMBER >= 0x10100000L
  21. + pkey->exponent = BN_get_word(rsa_e);
  22. +#else
  23. pkey->exponent = BN_get_word(rsa->e);
  24. +#endif
  25. out:
  26. BN_free(n0inv);