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.5 KiB

  1. commit 8c2e3b35a951c41b80efe4c3368d1244bab2bea4
  2. Author: Emeric Brun <ebrun@haproxy.com>
  3. Date: Thu Aug 16 11:36:40 2018 +0200
  4. BUG/MINOR: ssl: empty connections reported as errors.
  5. Empty connection is reported as handshake error
  6. even if dont-log-null is specified.
  7. This bug affect is a regression du to:
  8. BUILD: ssl: fix to build (again) with boringssl
  9. New openssl 1.1.1 defines OPENSSL_NO_HEARTBEATS as boring ssl
  10. so the test was replaced by OPENSSL_IS_BORINGSSL
  11. This fix should be backported on 1.8
  12. (cherry picked from commit 77e8919fc6f382f3a7facdc814b8618b8987200f)
  13. Signed-off-by: Willy Tarreau <w@1wt.eu>
  14. diff --git a/src/ssl_sock.c b/src/ssl_sock.c
  15. index 7edfb799..49389f01 100644
  16. --- a/src/ssl_sock.c
  17. +++ b/src/ssl_sock.c
  18. @@ -5121,7 +5121,7 @@ int ssl_sock_handshake(struct connection *conn, unsigned int flag)
  19. if (!errno && conn->flags & CO_FL_WAIT_L4_CONN)
  20. conn->flags &= ~CO_FL_WAIT_L4_CONN;
  21. if (!conn->err_code) {
  22. -#ifdef OPENSSL_NO_HEARTBEATS /* BoringSSL */
  23. +#ifdef OPENSSL_IS_BORINGSSL /* BoringSSL */
  24. conn->err_code = CO_ER_SSL_HANDSHAKE;
  25. #else
  26. int empty_handshake;
  27. @@ -5205,7 +5205,7 @@ check_error:
  28. if (!errno && conn->flags & CO_FL_WAIT_L4_CONN)
  29. conn->flags &= ~CO_FL_WAIT_L4_CONN;
  30. if (!conn->err_code) {
  31. -#ifdef OPENSSL_NO_HEARTBEATS /* BoringSSL */
  32. +#ifdef OPENSSL_IS_BORINGSSL /* BoringSSL */
  33. conn->err_code = CO_ER_SSL_HANDSHAKE;
  34. #else
  35. int empty_handshake;