/[gentoo-x86]/net-misc/curl/files/curl-7.27.0-fix-metalink-gnutls.patch
Gentoo

Contents of /net-misc/curl/files/curl-7.27.0-fix-metalink-gnutls.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Tue Aug 7 12:38:58 2012 UTC (2 years, 4 months ago) by blueness
Branch: MAIN
Fix build with metalink + gnutls, bug 428592.  Cleaned out unused patch files.

(Portage version: 2.1.10.65/cvs/Linux x86_64)

1 From 9f304291bd72aae66944cd7523707e1b88c6ad7b Mon Sep 17 00:00:00 2001
2 From: Daniel Stenberg <daniel@haxx.se>
3 Date: Mon, 6 Aug 2012 19:20:35 +0200
4 Subject: [PATCH] metalink: change code order to build with gnutls-nettle
5
6 Bug: http://curl.haxx.se/bug/view.cgi?id=3554668
7 Reported by: Anthony G. Basile
8 ---
9 src/tool_metalink.c | 116 +++++++++++++++++++++++++--------------------------
10 1 file changed, 58 insertions(+), 58 deletions(-)
11
12 diff --git a/src/tool_metalink.c b/src/tool_metalink.c
13 index 5491815..3a24a15 100644
14 --- a/src/tool_metalink.c
15 +++ b/src/tool_metalink.c
16 @@ -82,64 +82,6 @@
17 return PARAM_NO_MEM; \
18 } WHILE_FALSE
19
20 -const digest_params MD5_DIGEST_PARAMS[] = {
21 - {
22 - (Curl_digest_init_func) MD5_Init,
23 - (Curl_digest_update_func) MD5_Update,
24 - (Curl_digest_final_func) MD5_Final,
25 - sizeof(MD5_CTX),
26 - 16
27 - }
28 -};
29 -
30 -const digest_params SHA1_DIGEST_PARAMS[] = {
31 - {
32 - (Curl_digest_init_func) SHA1_Init,
33 - (Curl_digest_update_func) SHA1_Update,
34 - (Curl_digest_final_func) SHA1_Final,
35 - sizeof(SHA_CTX),
36 - 20
37 - }
38 -};
39 -
40 -const digest_params SHA256_DIGEST_PARAMS[] = {
41 - {
42 - (Curl_digest_init_func) SHA256_Init,
43 - (Curl_digest_update_func) SHA256_Update,
44 - (Curl_digest_final_func) SHA256_Final,
45 - sizeof(SHA256_CTX),
46 - 32
47 - }
48 -};
49 -
50 -static const metalink_digest_def SHA256_DIGEST_DEF[] = {
51 - {"sha-256", SHA256_DIGEST_PARAMS}
52 -};
53 -
54 -static const metalink_digest_def SHA1_DIGEST_DEF[] = {
55 - {"sha-1", SHA1_DIGEST_PARAMS}
56 -};
57 -
58 -static const metalink_digest_def MD5_DIGEST_DEF[] = {
59 - {"md5", MD5_DIGEST_PARAMS}
60 -};
61 -
62 -/*
63 - * The alias of supported hash functions in the order by preference
64 - * (basically stronger hash comes first). We included "sha-256" and
65 - * "sha256". The former is the name defined in the IANA registry named
66 - * "Hash Function Textual Names". The latter is widely (and
67 - * historically) used in Metalink version 3.
68 - */
69 -static const metalink_digest_alias digest_aliases[] = {
70 - {"sha-256", SHA256_DIGEST_DEF},
71 - {"sha256", SHA256_DIGEST_DEF},
72 - {"sha-1", SHA1_DIGEST_DEF},
73 - {"sha1", SHA1_DIGEST_DEF},
74 - {"md5", MD5_DIGEST_DEF},
75 - {NULL, NULL}
76 -};
77 -
78 #ifdef USE_GNUTLS_NETTLE
79
80 static void MD5_Init(MD5_CTX *ctx)
81 @@ -251,6 +193,64 @@ static void SHA256_Final(unsigned char digest[32], SHA256_CTX *ctx)
82
83 #endif /* CRYPTO LIBS */
84
85 +const digest_params MD5_DIGEST_PARAMS[] = {
86 + {
87 + (Curl_digest_init_func) MD5_Init,
88 + (Curl_digest_update_func) MD5_Update,
89 + (Curl_digest_final_func) MD5_Final,
90 + sizeof(MD5_CTX),
91 + 16
92 + }
93 +};
94 +
95 +const digest_params SHA1_DIGEST_PARAMS[] = {
96 + {
97 + (Curl_digest_init_func) SHA1_Init,
98 + (Curl_digest_update_func) SHA1_Update,
99 + (Curl_digest_final_func) SHA1_Final,
100 + sizeof(SHA_CTX),
101 + 20
102 + }
103 +};
104 +
105 +const digest_params SHA256_DIGEST_PARAMS[] = {
106 + {
107 + (Curl_digest_init_func) SHA256_Init,
108 + (Curl_digest_update_func) SHA256_Update,
109 + (Curl_digest_final_func) SHA256_Final,
110 + sizeof(SHA256_CTX),
111 + 32
112 + }
113 +};
114 +
115 +static const metalink_digest_def SHA256_DIGEST_DEF[] = {
116 + {"sha-256", SHA256_DIGEST_PARAMS}
117 +};
118 +
119 +static const metalink_digest_def SHA1_DIGEST_DEF[] = {
120 + {"sha-1", SHA1_DIGEST_PARAMS}
121 +};
122 +
123 +static const metalink_digest_def MD5_DIGEST_DEF[] = {
124 + {"md5", MD5_DIGEST_PARAMS}
125 +};
126 +
127 +/*
128 + * The alias of supported hash functions in the order by preference
129 + * (basically stronger hash comes first). We included "sha-256" and
130 + * "sha256". The former is the name defined in the IANA registry named
131 + * "Hash Function Textual Names". The latter is widely (and
132 + * historically) used in Metalink version 3.
133 + */
134 +static const metalink_digest_alias digest_aliases[] = {
135 + {"sha-256", SHA256_DIGEST_DEF},
136 + {"sha256", SHA256_DIGEST_DEF},
137 + {"sha-1", SHA1_DIGEST_DEF},
138 + {"sha1", SHA1_DIGEST_DEF},
139 + {"md5", MD5_DIGEST_DEF},
140 + {NULL, NULL}
141 +};
142 +
143 digest_context *Curl_digest_init(const digest_params *dparams)
144 {
145 digest_context *ctxt;
146 --
147 1.7.10.4

  ViewVC Help
Powered by ViewVC 1.1.20