View | Details | Raw Unified | Return to bug 216763 | Differences between
and this patch

Collapse All | Expand All

(-)files/patch-src_ssl__sock.c (+41 lines)
Line 0 Link Here
1
--- src/ssl_sock.c.orig	2017-01-13 09:03:00 UTC
2
+++ src/ssl_sock.c
3
@@ -793,7 +793,7 @@ static int ssl_sock_load_ocsp(SSL_CTX *c
4
 
5
 #ifndef SSL_CTX_get_tlsext_status_cb
6
 # define SSL_CTX_get_tlsext_status_cb(ctx, cb) \
7
-	*cb = (void (*) (void))ctx->tlsext_status_cb;
8
+	*cb = SSL_CTX_ctrl(ctx,128,0, (void (**)(void))cb)
9
 #endif
10
 	SSL_CTX_get_tlsext_status_cb(ctx, &callback);
11
 
12
@@ -821,7 +821,10 @@ static int ssl_sock_load_ocsp(SSL_CTX *c
13
 		int key_type;
14
 		EVP_PKEY *pkey;
15
 
16
-#ifdef SSL_CTX_get_tlsext_status_arg
17
+#if defined(SSL_CTX_get_tlsext_status_arg) || defined(LIBRESSL_VERSION_NUMBER)
18
+#ifndef SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG
19
+#define SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG 129
20
+#endif
21
 		SSL_CTX_ctrl(ctx, SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG, 0, &cb_arg);
22
 #else
23
 		cb_arg = ctx->tlsext_status_arg;
24
@@ -3537,7 +3540,7 @@ int ssl_sock_handshake(struct connection
25
 					OSSL_HANDSHAKE_STATE state = SSL_get_state((SSL *)conn->xprt_ctx);
26
 					empty_handshake = state == TLS_ST_BEFORE;
27
 #else
28
-					empty_handshake = !((SSL *)conn->xprt_ctx)->packet_length;
29
+					empty_handshake = SSL_state((SSL *)conn->xprt_ctx) == SSL_ST_BEFORE;
30
 #endif
31
 
32
 					if (empty_handshake) {
33
@@ -3615,7 +3618,7 @@ int ssl_sock_handshake(struct connection
34
 			state = SSL_get_state((SSL *)conn->xprt_ctx);
35
 			empty_handshake = state == TLS_ST_BEFORE;
36
 #else
37
-			empty_handshake = !((SSL *)conn->xprt_ctx)->packet_length;
38
+			empty_handshake = SSL_state((SSL *)conn->xprt_ctx) == SSL_ST_BEFORE;
39
 #endif
40
 			if (empty_handshake) {
41
 				if (!errno) {

Return to bug 216763