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.

42 lines
2.0 KiB

  1. From e4bd17c86e01aaf6f809d9ea355419c86c4defdc Mon Sep 17 00:00:00 2001
  2. From: Max Fillinger <maximilian.fillinger@foxcrypto.com>
  3. Date: Mon, 12 Apr 2021 19:46:17 +0200
  4. Subject: [PATCH] Fix build with mbedtls w/o SSL renegotiation support
  5. In mbedtls, support for SSL renegotiation can be disabled at
  6. compile-time. However, OpenVPN cannot be built with such a library
  7. because it calls mbedtls_ssl_conf_renegotiation() to disable this
  8. feature at runtime. This function doesn't exist when mbedtls was built
  9. without support for SSL renegotiation.
  10. This commit fixes the build by ifdef'ing out the function call when
  11. mbedtls was built without support for SSL renegotiation.
  12. Signed-off-by: Max Fillinger <maximilian.fillinger@foxcrypto.com>
  13. Acked-by: Antonio Quartulli <antonio@openvpn.net>
  14. Message-Id: <E1lW0eX-00012w-9n@sfs-ml-1.v29.lw.sourceforge.com>
  15. URL: https://www.mail-archive.com/search?l=mid&q=E1lW0eX-00012w-9n@sfs-ml-1.v29.lw.sourceforge.com
  16. Signed-off-by: Gert Doering <gert@greenie.muc.de>
  17. ---
  18. src/openvpn/ssl_mbedtls.c | 9 ++++++---
  19. 1 file changed, 6 insertions(+), 3 deletions(-)
  20. --- a/src/openvpn/ssl_mbedtls.c
  21. +++ b/src/openvpn/ssl_mbedtls.c
  22. @@ -1098,10 +1098,13 @@ key_state_ssl_init(struct key_state_ssl
  23. {
  24. mbedtls_ssl_conf_curves(ks_ssl->ssl_config, ssl_ctx->groups);
  25. }
  26. - /* Disable TLS renegotiations. OpenVPN's renegotiation creates new SSL
  27. - * session and does not depend on this feature. And TLS renegotiations have
  28. - * been problematic in the past */
  29. +
  30. + /* Disable TLS renegotiations if the mbedtls library supports that feature.
  31. + * OpenVPN's renegotiation creates new SSL sessions and does not depend on
  32. + * this feature and TLS renegotiations have been problematic in the past. */
  33. +#if defined(MBEDTLS_SSL_RENEGOTIATION)
  34. mbedtls_ssl_conf_renegotiation(ks_ssl->ssl_config, MBEDTLS_SSL_RENEGOTIATION_DISABLED);
  35. +#endif /* MBEDTLS_SSL_RENEGOTIATION */
  36. /* Disable record splitting (for now). OpenVPN assumes records are sent
  37. * unfragmented, and changing that will require thorough review and