summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Rostovtsev <tetromino@gentoo.org>2012-09-10 06:15:03 +0000
committerAlexandre Rostovtsev <tetromino@gentoo.org>2012-09-10 06:15:03 +0000
commit4e769372192ee521321891b0d9048992b3e7729c (patch)
tree7893fea8d7feaf80c512fb2814442502968d1abe /app-crypt/gcr/files/gcr-3.4.1-invalid-whitespace.patch
parentfixed incorrect license thanks to chithanh for noticing (diff)
downloadgentoo-2-4e769372192ee521321891b0d9048992b3e7729c.tar.gz
gentoo-2-4e769372192ee521321891b0d9048992b3e7729c.tar.bz2
gentoo-2-4e769372192ee521321891b0d9048992b3e7729c.zip
Fix whitespace removal in secret exchange, bug #434422, thanks to Hans de Graaff.
(Portage version: 2.2.0_alpha124/cvs/Linux x86_64)
Diffstat (limited to 'app-crypt/gcr/files/gcr-3.4.1-invalid-whitespace.patch')
-rw-r--r--app-crypt/gcr/files/gcr-3.4.1-invalid-whitespace.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/app-crypt/gcr/files/gcr-3.4.1-invalid-whitespace.patch b/app-crypt/gcr/files/gcr-3.4.1-invalid-whitespace.patch
new file mode 100644
index 000000000000..4f3287ca7dfb
--- /dev/null
+++ b/app-crypt/gcr/files/gcr-3.4.1-invalid-whitespace.patch
@@ -0,0 +1,46 @@
+From b7e899d45a49085e2cedbff1cf76e6d8450b0bea Mon Sep 17 00:00:00 2001
+From: Stef Walter <stefw@gnome.org>
+Date: Sat, 30 Jun 2012 13:10:31 +0200
+Subject: [PATCH] gcr: Fix invalid warning when sending a secret exchange
+
+ * We checked the prefix of the sent data, but didn't correctly
+ remove whitespace. In addition the check was inverted
+ * Exposed by recent changes to glib, which changed the whitespace
+ in the format a GKeyFile slightly
+---
+ gcr/gcr-secret-exchange.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/gcr/gcr-secret-exchange.c b/gcr/gcr-secret-exchange.c
+index cb3941f..f6eb32e 100644
+--- a/gcr/gcr-secret-exchange.c
++++ b/gcr/gcr-secret-exchange.c
+@@ -292,9 +292,9 @@ gcr_secret_exchange_begin (GcrSecretExchange *self)
+ result = g_key_file_to_data (output, NULL, NULL);
+ g_return_val_if_fail (result != NULL, NULL);
+
+- g_strchomp (result);
++ g_strchug (result);
+
+- if (g_str_has_prefix (result, SECRET_EXCHANGE_PROTOCOL_1_PREFIX))
++ if (!g_str_has_prefix (result, SECRET_EXCHANGE_PROTOCOL_1_PREFIX))
+ g_warning ("the prepared data does not have the correct protocol prefix");
+
+ g_key_file_free (output);
+@@ -540,10 +540,10 @@ gcr_secret_exchange_send (GcrSecretExchange *self,
+ result = g_key_file_to_data (output, NULL, NULL);
+ g_return_val_if_fail (result != NULL, NULL);
+
+- g_strchomp (result);
++ g_strchug (result);
+
+- if (g_str_has_prefix (result, SECRET_EXCHANGE_PROTOCOL_1_PREFIX))
+- g_warning ("the prepared data does not have the correct protocol prefix");
++ if (!g_str_has_prefix (result, SECRET_EXCHANGE_PROTOCOL_1_PREFIX))
++ g_warning ("the prepared data does not have the correct protocol prefix: %s", result);
+
+ g_key_file_free (output);
+ return result;
+--
+1.7.12
+