You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.3 KiB

  1. From 13f95a28ce12216ba51cf0ca8d61c3d89689d02b Mon Sep 17 00:00:00 2001
  2. From: Eneas U de Queiroz <cote2004-github@yahoo.com>
  3. Date: Wed, 6 Jun 2018 18:11:47 -0300
  4. Subject: [PATCH] Remove API deprecated in openssl 1.1
  5. Openssl 1.1 has deprecated RAND_pseudo_bytes. It won't compile with
  6. openssl built witout deprecated API.
  7. Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
  8. ---
  9. common/seafile-crypt.c | 5 +++++
  10. 1 file changed, 5 insertions(+)
  11. diff --git a/common/seafile-crypt.c b/common/seafile-crypt.c
  12. index c7d1702..c3cebf5 100644
  13. --- a/common/seafile-crypt.c
  14. +++ b/common/seafile-crypt.c
  15. @@ -81,9 +81,14 @@ seafile_generate_random_key (const char *passwd, char *random_key)
  16. int rc = RAND_bytes (secret_key, sizeof(secret_key));
  17. if (rc != 1) {
  18. +#if OPENSSL_VERSION_NUMBER < 0x10100000L || OPENSSL_API_COMPAT < 0x10100000L
  19. seaf_warning ("Failed to generate secret key for repo encryption "
  20. "with RAND_bytes(), use RAND_pseudo_bytes().\n");
  21. RAND_pseudo_bytes (secret_key, sizeof(secret_key));
  22. +#else
  23. + seaf_warning ("Failed to generate secret key for repo encryption "
  24. + "with RAND_bytes().\n");
  25. +#endif
  26. }
  27. seafile_derive_key (passwd, strlen(passwd), 2, key, iv);
  28. --
  29. 2.16.4