patch-lib_rsa_rsa-sign_c 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. --- u-boot-2017.07.orig/lib/rsa/rsa-sign.c 2017-07-10 19:07:38.000000000 +0200
  2. +++ u-boot-2017.07/lib/rsa/rsa-sign.c 2017-07-16 21:35:13.901375261 +0200
  3. @@ -21,7 +21,7 @@
  4. #define HAVE_ERR_REMOVE_THREAD_STATE
  5. #endif
  6. -#if OPENSSL_VERSION_NUMBER < 0x10100000L
  7. +#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
  8. static void RSA_get0_key(const RSA *r,
  9. const BIGNUM **n, const BIGNUM **e, const BIGNUM **d)
  10. {
  11. @@ -300,7 +300,7 @@ static int rsa_init(void)
  12. {
  13. int ret;
  14. -#if OPENSSL_VERSION_NUMBER < 0x10100000L
  15. +#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
  16. ret = SSL_library_init();
  17. #else
  18. ret = OPENSSL_init_ssl(0, NULL);
  19. @@ -309,7 +309,7 @@ static int rsa_init(void)
  20. fprintf(stderr, "Failure to init SSL library\n");
  21. return -1;
  22. }
  23. -#if OPENSSL_VERSION_NUMBER < 0x10100000L
  24. +#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
  25. SSL_load_error_strings();
  26. OpenSSL_add_all_algorithms();
  27. @@ -355,7 +355,7 @@ err_set_rsa:
  28. err_engine_init:
  29. ENGINE_free(e);
  30. err_engine_by_id:
  31. -#if OPENSSL_VERSION_NUMBER < 0x10100000L
  32. +#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
  33. ENGINE_cleanup();
  34. #endif
  35. return ret;
  36. @@ -363,7 +363,7 @@ err_engine_by_id:
  37. static void rsa_remove(void)
  38. {
  39. -#if OPENSSL_VERSION_NUMBER < 0x10100000L
  40. +#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
  41. CRYPTO_cleanup_all_ex_data();
  42. ERR_free_strings();
  43. #ifdef HAVE_ERR_REMOVE_THREAD_STATE
  44. @@ -433,7 +433,7 @@ static int rsa_sign_with_key(RSA *rsa, s
  45. ret = rsa_err("Could not obtain signature");
  46. goto err_sign;
  47. }
  48. - #if OPENSSL_VERSION_NUMBER < 0x10100000L
  49. + #if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
  50. EVP_MD_CTX_cleanup(context);
  51. #else
  52. EVP_MD_CTX_reset(context);