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.

26 lines
1.2 KiB

  1. commit 49f82640bf3c9a9c808568344bfa94d279c95b7e
  2. Author: Frédéric Lécaille <flecaille@haproxy.com>
  3. Date: Thu Oct 25 20:22:46 2018 +0200
  4. BUG/MINOR: ssl: Wrong usage of shctx_init().
  5. With this patch we check that shctx_init() does not return 0.
  6. Must be backported to 1.8.
  7. (cherry picked from commit 4c8aa117f9bda3b5253f03ad5a7135a9165060f5)
  8. Signed-off-by: Willy Tarreau <w@1wt.eu>
  9. diff --git a/src/ssl_sock.c b/src/ssl_sock.c
  10. index cfbc38b7..19e41743 100644
  11. --- a/src/ssl_sock.c
  12. +++ b/src/ssl_sock.c
  13. @@ -4768,7 +4768,7 @@ int ssl_sock_prepare_bind_conf(struct bind_conf *bind_conf)
  14. sizeof(struct sh_ssl_sess_hdr) + SHSESS_BLOCK_MIN_SIZE,
  15. sizeof(*sh_ssl_sess_tree),
  16. ((global.nbthread > 1) || (!global_ssl.private_cache && (global.nbproc > 1))) ? 1 : 0);
  17. - if (alloc_ctx < 0) {
  18. + if (alloc_ctx <= 0) {
  19. if (alloc_ctx == SHCTX_E_INIT_LOCK)
  20. ha_alert("Unable to initialize the lock for the shared SSL session cache. You can retry using the global statement 'tune.ssl.force-private-cache' but it could increase CPU usage due to renegotiations if nbproc > 1.\n");
  21. else