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.

43 lines
1.4 KiB

  1. From 8d5cf617d53d0545a0d141abf94396c28ca7e736 Mon Sep 17 00:00:00 2001
  2. From: Andreas Schneider <asn@cryptomilk.org>
  3. Date: Sun, 29 Oct 2017 16:06:14 +0100
  4. Subject: [PATCH] pki_crypto: Don't use deprecated function with newer
  5. OpenSSL
  6. Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
  7. ---
  8. src/pki_crypto.c | 13 +++++++++++++
  9. 1 file changed, 13 insertions(+)
  10. diff --git a/src/pki_crypto.c b/src/pki_crypto.c
  11. index 9e27436c..34d6e81c 100644
  12. --- a/src/pki_crypto.c
  13. +++ b/src/pki_crypto.c
  14. @@ -451,11 +451,24 @@ int pki_key_generate_rsa(ssh_key key, int parameter){
  15. int pki_key_generate_dss(ssh_key key, int parameter){
  16. int rc;
  17. +#if OPENSSL_VERSION_NUMBER > 0x10100000L
  18. + rc = DSA_generate_parameters_ex(key->dsa,
  19. + parameter,
  20. + NULL, /* seed */
  21. + 0, /* seed_len */
  22. + NULL, /* counter_ret */
  23. + NULL, /* h_ret */
  24. + NULL); /* cb */
  25. + if (rc != 1) {
  26. + return SSH_ERROR;
  27. + }
  28. +#else
  29. key->dsa = DSA_generate_parameters(parameter, NULL, 0, NULL, NULL,
  30. NULL, NULL);
  31. if(key->dsa == NULL){
  32. return SSH_ERROR;
  33. }
  34. +#endif
  35. rc = DSA_generate_key(key->dsa);
  36. if (rc != 1){
  37. DSA_free(key->dsa);
  38. --
  39. 2.19.1