|
@@ -0,0 +1,34 @@
|
|
1
|
+From 04b80cd29b23d02f373c095569e871275d128b43 Mon Sep 17 00:00:00 2001
|
|
2
|
+From: Willy Tarreau <w@1wt.eu>
|
|
3
|
+Date: Sat, 19 Jul 2014 06:37:33 +0200
|
|
4
|
+Subject: [PATCH 6/6] BUG/MEDIUM: connection: fix proxy v2 header again!
|
|
5
|
+
|
|
6
|
+Last commit 77d1f01 ("BUG/MEDIUM: connection: fix memory corruption
|
|
7
|
+when building a proxy v2 header") was wrong, using &cn_trash instead
|
|
8
|
+of cn_trash resulting in a warning and the client's SSL cert CN not
|
|
9
|
+being stored at the proper location.
|
|
10
|
+
|
|
11
|
+Thanks to Lukas Tribus for spotting this quickly.
|
|
12
|
+
|
|
13
|
+This should be backported to 1.5 after the patch above is backported.
|
|
14
|
+(cherry picked from commit 3b9a0c9d4d083d749846d66f9bd4caabafe4ee78)
|
|
15
|
+---
|
|
16
|
+ src/connection.c | 2 +-
|
|
17
|
+ 1 file changed, 1 insertion(+), 1 deletion(-)
|
|
18
|
+
|
|
19
|
+diff --git a/src/connection.c b/src/connection.c
|
|
20
|
+index 3435b1a..2dd2c02 100644
|
|
21
|
+--- a/src/connection.c
|
|
22
|
++++ b/src/connection.c
|
|
23
|
+@@ -684,7 +684,7 @@ int make_proxy_line_v2(char *buf, int buf_len, struct server *srv, struct connec
|
|
24
|
+ }
|
|
25
|
+ if (srv->pp_opts & SRV_PP_V2_SSL_CN) {
|
|
26
|
+ cn_trash = get_trash_chunk();
|
|
27
|
+- if (ssl_sock_get_remote_common_name(remote, &cn_trash) > 0) {
|
|
28
|
++ if (ssl_sock_get_remote_common_name(remote, cn_trash) > 0) {
|
|
29
|
+ tlv_len = make_tlv(&buf[ret+ssl_tlv_len], (buf_len - ret - ssl_tlv_len), PP2_TYPE_SSL_CN, cn_trash->len, cn_trash->str);
|
|
30
|
+ ssl_tlv_len += tlv_len;
|
|
31
|
+ }
|
|
32
|
+--
|
|
33
|
+1.8.5.5
|
|
34
|
+
|