openconnect-7.07-libressl.patch 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. From d4a8afc2e8693628f2de554e717458e08bcc2fcf Mon Sep 17 00:00:00 2001
  2. From: Aric Belsito <lluixhi@gmail.com>
  3. Date: Thu, 3 Nov 2016 11:37:23 -0700
  4. Subject: [PATCH] Fix LibreSSL Build.
  5. From Voidlinux:
  6. From d51ab5615e11af4a2c160b2b8240e5d9f3c15422 Mon Sep 17 00:00:00 2001
  7. From: Duncaen <duncaen@voidlinux.eu>
  8. Date: Wed, 13 Jul 2016 15:21:16 +0200
  9. Subject: [PATCH] openconnect: update to 7.07.
  10. ---
  11. openssl-esp.c | 4 ++--
  12. openssl.c | 8 ++++----
  13. 2 files changed, 6 insertions(+), 6 deletions(-)
  14. diff --git a/openssl-esp.c b/openssl-esp.c
  15. index 2c1aa49..bd4dce3 100644
  16. --- a/openssl-esp.c
  17. +++ b/openssl-esp.c
  18. @@ -27,7 +27,7 @@
  19. #include <openssl/evp.h>
  20. #include <openssl/rand.h>
  21. -#if OPENSSL_VERSION_NUMBER < 0x10100000L
  22. +#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
  23. #define EVP_CIPHER_CTX_free(c) do { \
  24. EVP_CIPHER_CTX_cleanup(c); \
  25. @@ -85,7 +85,7 @@ static int init_esp_ciphers(struct openconnect_info *vpninfo, struct esp *esp,
  26. }
  27. EVP_CIPHER_CTX_set_padding(esp->cipher, 0);
  28. -#if OPENSSL_VERSION_NUMBER < 0x10100000L
  29. +#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
  30. esp->hmac = malloc(sizeof(*esp->hmac));
  31. esp->pkt_hmac = malloc(sizeof(*esp->pkt_hmac));
  32. if (!esp->hmac || &esp->pkt_hmac) {
  33. diff --git a/openssl.c b/openssl.c
  34. index 785fd2a..6007cef 100644
  35. --- a/openssl.c
  36. +++ b/openssl.c
  37. @@ -36,11 +36,11 @@
  38. #include <openssl/ui.h>
  39. #include <openssl/rsa.h>
  40. -#if OPENSSL_VERSION_NUMBER < 0x10100000L
  41. +#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
  42. #define X509_up_ref(x) CRYPTO_add(&(x)->references, 1, CRYPTO_LOCK_X509)
  43. #endif
  44. -#if OPENSSL_VERSION_NUMBER < 0x10100000L
  45. +#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
  46. #define EVP_MD_CTX_new EVP_MD_CTX_create
  47. #define EVP_MD_CTX_free EVP_MD_CTX_destroy
  48. #define X509_STORE_CTX_get0_chain(ctx) ((ctx)->chain)
  49. @@ -991,7 +991,7 @@ static int set_peer_cert_hash(struct openconnect_info *vpninfo)
  50. return 0;
  51. }
  52. -#if OPENSSL_VERSION_NUMBER < 0x10002000L
  53. +#if OPENSSL_VERSION_NUMBER < 0x10002000L || defined(LIBRESSL_VERSION_NUMBER)
  54. static int match_hostname_elem(const char *hostname, int helem_len,
  55. const char *match, int melem_len)
  56. {
  57. @@ -1653,7 +1653,7 @@ int openconnect_open_https(struct openconnect_info *vpninfo)
  58. * 4fcdd66fff5fea0cfa1055c6680a76a4303f28a2
  59. * cd6bd5ffda616822b52104fee0c4c7d623fd4f53
  60. */
  61. -#if OPENSSL_VERSION_NUMBER >= 0x10001070
  62. +#if OPENSSL_VERSION_NUMBER >= 0x10001070 || defined(LIBRESSL_VERSION_NUMBER)
  63. if (string_is_hostname(vpninfo->hostname))
  64. SSL_set_tlsext_host_name(https_ssl, vpninfo->hostname);
  65. #endif
  66. --
  67. 2.10.2