summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/pidgin
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2021-04-05 11:40:11 -0700
committerKhem Raj <raj.khem@gmail.com>2021-04-06 09:02:12 -0700
commitad8c6ba3110ac345bb89ce4f6a1a98aa16502c81 (patch)
treecd96db45fb52d590e2c063f1906dda6274c7ffc2 /meta-oe/recipes-support/pidgin
parent285e612ac9c1ab1fc9f50728cb27b0bd0c40e89c (diff)
downloadmeta-openembedded-ad8c6ba3110ac345bb89ce4f6a1a98aa16502c81.tar.gz
pidgin-sipe: Fix build with glib-2.0 >= 2.68
Signed-off-by: Khem Raj <raj.khem@gmail.com> Cc: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe/recipes-support/pidgin')
-rw-r--r--meta-oe/recipes-support/pidgin/pidgin-sipe/0001-Migrate-to-use-g_memdup2.patch192
-rw-r--r--meta-oe/recipes-support/pidgin/pidgin-sipe_1.25.0.bb1
2 files changed, 193 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/pidgin/pidgin-sipe/0001-Migrate-to-use-g_memdup2.patch b/meta-oe/recipes-support/pidgin/pidgin-sipe/0001-Migrate-to-use-g_memdup2.patch
new file mode 100644
index 000000000..4f5c0bd1f
--- /dev/null
+++ b/meta-oe/recipes-support/pidgin/pidgin-sipe/0001-Migrate-to-use-g_memdup2.patch
@@ -0,0 +1,192 @@
1From 40799bb28a9e299055eec00092694ea2e408c431 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 5 Apr 2021 11:36:50 -0700
4Subject: [PATCH] Migrate to use g_memdup2
5
6g_memdup has been deprecated for long and latest glib-2.0 2.68+ has
7turned it int an error to use old function. Add a fall back to
8older versions of GLib, fall back to g_memdup with a #define
9
10Upstream-Status: Pending
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 configure.ac | 3 +++
14 src/api/sipe-common.h | 5 +++++
15 src/core/sip-sec-gssapi.c | 4 ++--
16 src/core/sip-sec-ntlm.c | 12 ++++++------
17 src/core/sip-sec-tls-dsk.c | 4 ++--
18 src/core/sipe-media.c | 2 +-
19 src/core/sipe-tls-tester.c | 2 +-
20 src/core/sipe-tls.c | 4 ++--
21 src/telepathy/telepathy-protocol.c | 2 +-
22 9 files changed, 23 insertions(+), 15 deletions(-)
23
24diff --git a/configure.ac b/configure.ac
25index 2481153..efe01b4 100644
26--- a/configure.ac
27+++ b/configure.ac
28@@ -327,6 +327,9 @@ AM_CONDITIONAL(SIPE_OPENSSL, [test "x$enable_openssl" != xno])
29 dnl check for libxml2
30 PKG_CHECK_MODULES(LIBXML2, [libxml-2.0])
31
32+# dnl check for g_memdup2 in glib-2.0
33+AC_CHECK_LIB(glib-2.0, g_memdup2, [GLIB_CFLAGS="$GLIB_CFLAGS -DHAVE_G_MEMDUP2=1"])
34+
35 dnl assumption check: sizof(uuid_t) must be 16 (see uuid.c)
36 AC_MSG_CHECKING([that sizeof(uuid_t) is 16])
37 ac_save_CFLAGS="$CFLAGS"
38diff --git a/src/api/sipe-common.h b/src/api/sipe-common.h
39index c964f15..e114fdc 100644
40--- a/src/api/sipe-common.h
41+++ b/src/api/sipe-common.h
42@@ -51,3 +51,8 @@
43 #ifdef _MSC_VER
44 typedef long ssize_t;
45 #endif
46+
47+#ifndef HAVE_G_MEMDUP2
48+#define g_memdup2 g_memdup
49+#endif
50+
51diff --git a/src/core/sip-sec-gssapi.c b/src/core/sip-sec-gssapi.c
52index 873080f..4c63868 100644
53--- a/src/core/sip-sec-gssapi.c
54+++ b/src/core/sip-sec-gssapi.c
55@@ -602,7 +602,7 @@ sip_sec_init_sec_context__gssapi(SipSecContext context,
56
57 out_buff->length = output_token.length;
58 if (out_buff->length)
59- out_buff->value = g_memdup(output_token.value, output_token.length);
60+ out_buff->value = g_memdup2(output_token.value, output_token.length);
61 else
62 /* Special case: empty token */
63 out_buff->value = (guint8 *) g_strdup("");
64@@ -653,7 +653,7 @@ sip_sec_make_signature__gssapi(SipSecContext context,
65 return FALSE;
66 } else {
67 signature->length = output_token.length;
68- signature->value = g_memdup(output_token.value,
69+ signature->value = g_memdup2(output_token.value,
70 output_token.length);
71 gss_release_buffer(&minor, &output_token);
72 return TRUE;
73diff --git a/src/core/sip-sec-ntlm.c b/src/core/sip-sec-ntlm.c
74index 2e2354f..1fa4daa 100644
75--- a/src/core/sip-sec-ntlm.c
76+++ b/src/core/sip-sec-ntlm.c
77@@ -951,7 +951,7 @@ sip_sec_ntlm_parse_challenge(SipSecBuffer in_buff,
78
79 /* server challenge (nonce) */
80 if (server_challenge) {
81- *server_challenge = g_memdup(cmsg->nonce, 8);
82+ *server_challenge = g_memdup2(cmsg->nonce, 8);
83 }
84
85 /* flags */
86@@ -984,7 +984,7 @@ sip_sec_ntlm_parse_challenge(SipSecBuffer in_buff,
87 *target_info_len = len;
88 }
89 if (target_info) {
90- *target_info = g_memdup(content, len);
91+ *target_info = g_memdup2(content, len);
92 }
93 }
94 }
95@@ -1117,13 +1117,13 @@ sip_sec_ntlm_gen_authenticate(guchar **client_sign_key,
96 Set ServerSigningKey to SIGNKEY(ExportedSessionKey, "Server")
97 */
98 SIGNKEY(exported_session_key, TRUE, key);
99- *client_sign_key = g_memdup(key, 16);
100+ *client_sign_key = g_memdup2(key, 16);
101 SIGNKEY(exported_session_key, FALSE, key);
102- *server_sign_key = g_memdup(key, 16);
103+ *server_sign_key = g_memdup2(key, 16);
104 SEALKEY(neg_flags, exported_session_key, TRUE, key);
105- *client_seal_key = g_memdup(key, 16);
106+ *client_seal_key = g_memdup2(key, 16);
107 SEALKEY(neg_flags, exported_session_key, FALSE, key);
108- *server_seal_key = g_memdup(key, 16);
109+ *server_seal_key = g_memdup2(key, 16);
110 }
111
112 /* @TODO: */
113diff --git a/src/core/sip-sec-tls-dsk.c b/src/core/sip-sec-tls-dsk.c
114index 70433ea..2d3f2db 100644
115--- a/src/core/sip-sec-tls-dsk.c
116+++ b/src/core/sip-sec-tls-dsk.c
117@@ -88,9 +88,9 @@ sip_sec_init_sec_context__tls_dsk(SipSecContext context,
118 /* copy key pair */
119 ctx->algorithm = state->algorithm;
120 ctx->key_length = state->key_length;
121- ctx->client_key = g_memdup(state->client_key,
122+ ctx->client_key = g_memdup2(state->client_key,
123 state->key_length);
124- ctx->server_key = g_memdup(state->server_key,
125+ ctx->server_key = g_memdup2(state->server_key,
126 state->key_length);
127
128 /* extract certicate expiration time */
129diff --git a/src/core/sipe-media.c b/src/core/sipe-media.c
130index e9c4b8a..936e31c 100644
131--- a/src/core/sipe-media.c
132+++ b/src/core/sipe-media.c
133@@ -578,7 +578,7 @@ media_stream_to_sdpmedia(struct sipe_media_call_private *call_private,
134 // Set our key if encryption is enabled.
135 if (stream_private->encryption_key &&
136 encryption_policy != SIPE_ENCRYPTION_POLICY_REJECTED) {
137- sdpmedia->encryption_key = g_memdup(stream_private->encryption_key,
138+ sdpmedia->encryption_key = g_memdup2(stream_private->encryption_key,
139 SIPE_SRTP_KEY_LEN);
140 sdpmedia->encryption_key_id = stream_private->encryption_key_id;
141 }
142diff --git a/src/core/sipe-tls-tester.c b/src/core/sipe-tls-tester.c
143index e80d715..5fbb5f8 100644
144--- a/src/core/sipe-tls-tester.c
145+++ b/src/core/sipe-tls-tester.c
146@@ -155,7 +155,7 @@ static guchar *read_tls_record(int fd,
147 printf("received %d bytes from server\n", result);
148 record = g_new0(struct record, 1);
149 record->length = result;
150- record->msg = g_memdup(buffer, result);
151+ record->msg = g_memdup2(buffer, result);
152 length += result;
153 fragments = g_slist_append(fragments, record);
154 }
155diff --git a/src/core/sipe-tls.c b/src/core/sipe-tls.c
156index b0235d5..020aedb 100644
157--- a/src/core/sipe-tls.c
158+++ b/src/core/sipe-tls.c
159@@ -427,7 +427,7 @@ static guchar *sipe_tls_prf(SIPE_UNUSED_PARAMETER struct tls_internal_state *sta
160 gsize half = (secret_length + 1) / 2;
161 gsize newseed_length = label_length + seed_length;
162 /* secret: used as S1; secret2: last half of original secret (S2) */
163- guchar *secret2 = g_memdup(secret + secret_length - half, half);
164+ guchar *secret2 = g_memdup2(secret + secret_length - half, half);
165 guchar *newseed = g_malloc(newseed_length);
166 guchar *md5, *dest;
167 guchar *sha1, *src;
168@@ -1525,7 +1525,7 @@ static struct tls_compiled_message *tls_client_key_exchange(struct tls_internal_
169
170 /* found all the required fields */
171 state->server_random.length = server_random->length;
172- state->server_random.buffer = g_memdup(server_random->data,
173+ state->server_random.buffer = g_memdup2(server_random->data,
174 server_random->length);
175 tls_calculate_secrets(state);
176
177diff --git a/src/telepathy/telepathy-protocol.c b/src/telepathy/telepathy-protocol.c
178index f6e5337..1dde579 100644
179--- a/src/telepathy/telepathy-protocol.c
180+++ b/src/telepathy/telepathy-protocol.c
181@@ -237,7 +237,7 @@ static void get_connection_details(SIPE_UNUSED_PARAMETER TpBaseProtocol *self,
182 SIPE_TYPE_SEARCH_MANAGER,
183 G_TYPE_INVALID
184 };
185- *channel_managers = g_memdup(types, sizeof(types));
186+ *channel_managers = g_memdup2(types, sizeof(types));
187 }
188 if (icon_name)
189 *icon_name = g_strdup("im-" SIPE_TELEPATHY_DOMAIN);
190--
1912.31.1
192
diff --git a/meta-oe/recipes-support/pidgin/pidgin-sipe_1.25.0.bb b/meta-oe/recipes-support/pidgin/pidgin-sipe_1.25.0.bb
index f6b4c7cee..5a96bec90 100644
--- a/meta-oe/recipes-support/pidgin/pidgin-sipe_1.25.0.bb
+++ b/meta-oe/recipes-support/pidgin/pidgin-sipe_1.25.0.bb
@@ -11,6 +11,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/sipe/pidgin-sipe-${PV}.tar.xz \
11 file://0001-sipe-consider-64bit-time_t-when-printing.patch \ 11 file://0001-sipe-consider-64bit-time_t-when-printing.patch \
12 file://0001-Align-structs-casts-with-time_t-elements-to-8byte-bo.patch \ 12 file://0001-Align-structs-casts-with-time_t-elements-to-8byte-bo.patch \
13 file://0001-configure-Do-not-add-native-paths-to-pkgconfig-searc.patch \ 13 file://0001-configure-Do-not-add-native-paths-to-pkgconfig-searc.patch \
14 file://0001-Migrate-to-use-g_memdup2.patch \
14" 15"
15 16
16SRC_URI[md5sum] = "0e742f021dc8c3f17435aea05c3e0314" 17SRC_URI[md5sum] = "0e742f021dc8c3f17435aea05c3e0314"