Package: gmime / 2.6.22+dfsg2-1

0002-Rename-g_mime_decryption_result_-to-g_mime_decrypt_r.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Date: Tue, 17 Jan 2017 07:51:49 -0500
Subject: Rename g_mime_decryption_result_* to g_mime_decrypt_result_*

Two functions appear to have been misnamed in gmime-crypto-context.c:
g_mime_decryption_result_get_mdc and
g_mime_decryption_result_get_session_key.  They should have been named
with a prefix of g_mime_decrypt_, not g_mime_decryption_ :(

Correcting this is technically an ABI change, but i don't think it
matters: the wrong function names never ended up in any .h files, so i
don't think anyone could have reliably used them.  A search of all of
debian shows no uses outside of the declaration in gmime itself:

   https://codesearch.debian.net/search?q=g_mime_decryption_result

At any rate, i've retained the old/misnamed functions as an alias to
the correctly-named functions to technically keep the ABI intact,
while actually supporting the declared functionality.
---
 gmime/gmime-crypto-context.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/gmime/gmime-crypto-context.c b/gmime/gmime-crypto-context.c
index 2ae77c61..decba176 100644
--- a/gmime/gmime-crypto-context.c
+++ b/gmime/gmime-crypto-context.c
@@ -893,7 +893,7 @@ g_mime_decrypt_result_set_mdc (GMimeDecryptResult *result, GMimeDigestAlgo mdc)
  * Returns: the mdc digest algorithm used.
  **/
 GMimeDigestAlgo
-g_mime_decryption_result_get_mdc (GMimeDecryptResult *result)
+g_mime_decrypt_result_get_mdc (GMimeDecryptResult *result)
 {
 	g_return_val_if_fail (GMIME_IS_DECRYPT_RESULT (result), GMIME_DIGEST_ALGO_DEFAULT);
 	
@@ -935,9 +935,21 @@ g_mime_decrypt_result_set_session_key (GMimeDecryptResult *result, const char *s
  * session key was requested or found.
  **/
 const char *
-g_mime_decryption_result_get_session_key (GMimeDecryptResult *result)
+g_mime_decrypt_result_get_session_key (GMimeDecryptResult *result)
 {
 	g_return_val_if_fail (GMIME_IS_DECRYPT_RESULT (result), NULL);
 	
 	return result->session_key;
 }
+
+/* DEPRECATED, for ABI-compatibility with pre-2.6.22 only */
+const char *
+g_mime_decryption_result_get_session_key (GMimeDecryptResult *result)
+{
+	return g_mime_decrypt_result_get_session_key (result);
+}
+GMimeDigestAlgo
+g_mime_decryption_result_get_mdc (GMimeDecryptResult *result)
+{
+	return g_mime_decrypt_result_get_mdc (result);
+}