svn commit: r440870 - head/net/haproxy/files
Bernard Spil
brnrd at FreeBSD.org
Sun May 14 09:40:26 UTC 2017
Author: brnrd
Date: Sun May 14 09:40:25 2017
New Revision: 440870
URL: https://svnweb.freebsd.org/changeset/ports/440870
Log:
net/haproxy: Fix build with LibreSSL
- Add patch from OpenBSD
PR: 218637
Reported by: Mark Martinec <Mark.Martinec at ijs.si>
Approved by: maintainer timeout
Obtained from: OpenBSD
Added:
head/net/haproxy/files/patch-src_ssl__sock.c (contents, props changed)
Added: head/net/haproxy/files/patch-src_ssl__sock.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/net/haproxy/files/patch-src_ssl__sock.c Sun May 14 09:40:25 2017 (r440870)
@@ -0,0 +1,46 @@
+--- src/ssl_sock.c.orig 2017-04-03 08:28:32 UTC
++++ src/ssl_sock.c
+@@ -794,8 +795,11 @@ static int ssl_sock_load_ocsp(SSL_CTX *c
+ ocsp = NULL;
+
+ #ifndef SSL_CTX_get_tlsext_status_cb
+-# define SSL_CTX_get_tlsext_status_cb(ctx, cb) \
+- *cb = (void (*) (void))ctx->tlsext_status_cb;
++#ifndef SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB
++#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB 128
++#endif
++#define SSL_CTX_get_tlsext_status_cb(ctx, cb) \
++ *cb = SSL_CTX_ctrl(ctx,SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB,0, (void (**)(void))cb)
+ #endif
+ SSL_CTX_get_tlsext_status_cb(ctx, &callback);
+
+@@ -823,7 +827,10 @@ static int ssl_sock_load_ocsp(SSL_CTX *c
+ int key_type;
+ EVP_PKEY *pkey;
+
+-#ifdef SSL_CTX_get_tlsext_status_arg
++#if defined(SSL_CTX_get_tlsext_status_arg) || defined(LIBRESSL_VERSION_NUMBER)
++#ifndef SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG
++#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG 129
++#endif
+ SSL_CTX_ctrl(ctx, SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG, 0, &cb_arg);
+ #else
+ cb_arg = ctx->tlsext_status_arg;
+@@ -3539,7 +3546,7 @@ int ssl_sock_handshake(struct connection
+ OSSL_HANDSHAKE_STATE state = SSL_get_state((SSL *)conn->xprt_ctx);
+ empty_handshake = state == TLS_ST_BEFORE;
+ #else
+- empty_handshake = !((SSL *)conn->xprt_ctx)->packet_length;
++ empty_handshake = SSL_state((SSL *)conn->xprt_ctx) == SSL_ST_BEFORE;
+ #endif
+
+ if (empty_handshake) {
+@@ -3617,7 +3624,7 @@ int ssl_sock_handshake(struct connection
+ state = SSL_get_state((SSL *)conn->xprt_ctx);
+ empty_handshake = state == TLS_ST_BEFORE;
+ #else
+- empty_handshake = !((SSL *)conn->xprt_ctx)->packet_length;
++ empty_handshake = SSL_state((SSL *)conn->xprt_ctx) == SSL_ST_BEFORE;
+ #endif
+ if (empty_handshake) {
+ if (!errno) {
More information about the svn-ports-all
mailing list