Lines 1-45
Link Here
|
1 |
--- src/ssl_sock.c.orig 2017-07-07 09:49:34 UTC |
|
|
2 |
+++ src/ssl_sock.c |
3 |
@@ -794,8 +794,11 @@ static int ssl_sock_load_ocsp(SSL_CTX *c |
4 |
ocsp = NULL; |
5 |
|
6 |
#ifndef SSL_CTX_get_tlsext_status_cb |
7 |
+#ifndef SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB |
8 |
+#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB 128 |
9 |
+#endif |
10 |
# define SSL_CTX_get_tlsext_status_cb(ctx, cb) \ |
11 |
- *cb = (void (*) (void))ctx->tlsext_status_cb; |
12 |
+ *cb = SSL_CTX_ctrl(ctx,SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB,0, (void (**)(void))cb) |
13 |
#endif |
14 |
SSL_CTX_get_tlsext_status_cb(ctx, &callback); |
15 |
|
16 |
@@ -823,7 +826,10 @@ static int ssl_sock_load_ocsp(SSL_CTX *c |
17 |
int key_type; |
18 |
EVP_PKEY *pkey; |
19 |
|
20 |
-#ifdef SSL_CTX_get_tlsext_status_arg |
21 |
+#if defined(SSL_CTX_get_tlsext_status_arg) || defined(LIBRESSL_VERSION_NUMBER) |
22 |
+#ifndef SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG |
23 |
+#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG 129 |
24 |
+#endif |
25 |
SSL_CTX_ctrl(ctx, SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG, 0, &cb_arg); |
26 |
#else |
27 |
cb_arg = ctx->tlsext_status_arg; |
28 |
@@ -3539,7 +3545,7 @@ int ssl_sock_handshake(struct connection |
29 |
OSSL_HANDSHAKE_STATE state = SSL_get_state((SSL *)conn->xprt_ctx); |
30 |
empty_handshake = state == TLS_ST_BEFORE; |
31 |
#else |
32 |
- empty_handshake = !((SSL *)conn->xprt_ctx)->packet_length; |
33 |
+ empty_handshake = SSL_state((SSL *)conn->xprt_ctx) == SSL_ST_BEFORE; |
34 |
#endif |
35 |
|
36 |
if (empty_handshake) { |
37 |
@@ -3617,7 +3623,7 @@ int ssl_sock_handshake(struct connection |
38 |
state = SSL_get_state((SSL *)conn->xprt_ctx); |
39 |
empty_handshake = state == TLS_ST_BEFORE; |
40 |
#else |
41 |
- empty_handshake = !((SSL *)conn->xprt_ctx)->packet_length; |
42 |
+ empty_handshake = SSL_state((SSL *)conn->xprt_ctx) == SSL_ST_BEFORE; |
43 |
#endif |
44 |
if (empty_handshake) { |
45 |
if (!errno) { |