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.

39 lines
900 B

  1. --- a/src/dh.c
  2. +++ b/src/dh.c
  3. @@ -131,11 +131,15 @@ int ssh_get_random(void *where, int len, int strong){
  4. return 1;
  5. #elif defined HAVE_LIBCRYPTO
  6. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  7. if (strong) {
  8. return RAND_bytes(where,len);
  9. } else {
  10. return RAND_pseudo_bytes(where,len);
  11. }
  12. +#else
  13. + return RAND_bytes(where,len);
  14. +#endif
  15. #endif
  16. /* never reached */
  17. @@ -198,7 +202,9 @@ int ssh_crypto_init(void) {
  18. }
  19. bignum_bin2bn(p_group14_value, P_GROUP14_LEN, p_group14);
  20. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  21. OpenSSL_add_all_algorithms();
  22. +#endif
  23. #endif
  24. @@ -219,8 +225,10 @@ void ssh_crypto_finalize(void) {
  25. #ifdef HAVE_LIBGCRYPT
  26. gcry_control(GCRYCTL_TERM_SECMEM);
  27. #elif defined HAVE_LIBCRYPTO
  28. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  29. EVP_cleanup();
  30. CRYPTO_cleanup_all_ex_data();
  31. +#endif
  32. #endif
  33. ssh_crypto_initialized=0;
  34. }