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.

70 lines
2.3 KiB

  1. From 91b777c7064d9d91a1433a42b0bb31592388d1b4 Mon Sep 17 00:00:00 2001
  2. From: Eneas U de Queiroz <cote2004-github@yahoo.com>
  3. Date: Tue, 9 Oct 2018 16:17:42 -0300
  4. Subject: [PATCH] fix compilation with openssl built without ECC
  5. ECDSA code in openssh-compat.h and libressl-api-compat.c needs to be
  6. guarded by OPENSSL_HAS_ECC
  7. Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
  8. diff --git a/openbsd-compat/libressl-api-compat.c b/openbsd-compat/libressl-api-compat.c
  9. index de3e64a6..ae00ff59 100644
  10. --- a/openbsd-compat/libressl-api-compat.c
  11. +++ b/openbsd-compat/libressl-api-compat.c
  12. @@ -152,7 +152,9 @@
  13. #include <openssl/dsa.h>
  14. #include <openssl/rsa.h>
  15. #include <openssl/evp.h>
  16. +#ifdef OPENSSL_HAS_ECC
  17. #include <openssl/ecdsa.h>
  18. +#endif
  19. #include <openssl/dh.h>
  20. #ifndef HAVE_DSA_GET0_PQG
  21. @@ -417,6 +419,7 @@ DSA_SIG_set0(DSA_SIG *sig, BIGNUM *r, BIGNUM *s)
  22. }
  23. #endif /* HAVE_DSA_SIG_SET0 */
  24. +#ifdef OPENSSL_HAS_ECC
  25. #ifndef HAVE_ECDSA_SIG_GET0
  26. void
  27. ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps)
  28. @@ -442,6 +445,7 @@ ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s)
  29. return 1;
  30. }
  31. #endif /* HAVE_ECDSA_SIG_SET0 */
  32. +#endif /* OPENSSL_HAS_ECC */
  33. #ifndef HAVE_DH_GET0_PQG
  34. void
  35. diff --git a/openbsd-compat/openssl-compat.h b/openbsd-compat/openssl-compat.h
  36. index 9e0264c0..6a525f28 100644
  37. --- a/openbsd-compat/openssl-compat.h
  38. +++ b/openbsd-compat/openssl-compat.h
  39. @@ -24,7 +24,9 @@
  40. #include <openssl/evp.h>
  41. #include <openssl/rsa.h>
  42. #include <openssl/dsa.h>
  43. +#ifdef OPENSSL_HAS_ECC
  44. #include <openssl/ecdsa.h>
  45. +#endif
  46. #include <openssl/dh.h>
  47. int ssh_compatible_openssl(long, long);
  48. @@ -161,6 +163,7 @@ void DSA_SIG_get0(const DSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps);
  49. int DSA_SIG_set0(DSA_SIG *sig, BIGNUM *r, BIGNUM *s);
  50. #endif /* DSA_SIG_SET0 */
  51. +#ifdef OPENSSL_HAS_ECC
  52. #ifndef HAVE_ECDSA_SIG_GET0
  53. void ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps);
  54. #endif /* HAVE_ECDSA_SIG_GET0 */
  55. @@ -168,6 +171,7 @@ void ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps);
  56. #ifndef HAVE_ECDSA_SIG_SET0
  57. int ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s);
  58. #endif /* HAVE_ECDSA_SIG_SET0 */
  59. +#endif /* OPENSSL_HAS_ECC */
  60. #ifndef HAVE_DH_GET0_PQG
  61. void DH_get0_pqg(const DH *dh, const BIGNUM **p, const BIGNUM **q,