[PATCH] Upgrade gnutls from 2.4.1 to 2.6.4.
[openwrt/svn-archive/archive.git] / libs / libgcrypt / patches / 001-handle-minimal-build.patch
1 diff -ur libgcrypt-1.4.1.orig/cipher/pubkey.c libgcrypt-1.4.1/cipher/pubkey.c
2 --- libgcrypt-1.4.1.orig/cipher/pubkey.c 2007-12-13 13:40:38.000000000 +0100
3 +++ libgcrypt-1.4.1/cipher/pubkey.c 2008-05-09 22:34:14.000000000 +0200
4 @@ -1,6 +1,6 @@
5 /* pubkey.c - pubkey dispatcher
6 * Copyright (C) 1998, 1999, 2000, 2002, 2003,
7 - * 2005, 2007 Free Software Foundation, Inc.
8 + * 2005, 2007, 2008 Free Software Foundation, Inc.
9 *
10 * This file is part of Libgcrypt.
11 *
12 @@ -805,6 +805,7 @@
13 return err;
14 }
15
16 +#if USE_ECC
17 /* Internal function used for ecc. Note, that this function makes use
18 of its intimate knowledge about the ECC parameters from ecc.c. */
19 static gcry_err_code_t
20 @@ -887,7 +888,7 @@
21 }
22 return err;
23 }
24 -
25 +#endif
26
27
28 /****************
29 @@ -978,9 +979,11 @@
30 err = gpg_err_code_from_errno (errno);
31 if (!err)
32 {
33 +#if USE_ECC
34 if (is_ecc)
35 err = sexp_elements_extract_ecc (list, elems, array);
36 else
37 +#endif
38 err = sexp_elements_extract (list, elems, array, pubkey->name);
39 }
40
41 diff -ur libgcrypt-1.4.1.orig/tests/basic.c libgcrypt-1.4.1/tests/basic.c
42 --- libgcrypt-1.4.1.orig/tests/basic.c 2008-04-22 11:03:33.000000000 +0200
43 +++ libgcrypt-1.4.1/tests/basic.c 2008-05-09 22:41:41.000000000 +0200
44 @@ -1,5 +1,5 @@
45 /* basic.c - basic regression tests
46 - * Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
47 + * Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc.
48 *
49 * This file is part of Libgcrypt.
50 *
51 @@ -1137,12 +1137,15 @@
52 const char *expect;
53 } algos[] =
54 {
55 +#if USE_MD4
56 { GCRY_MD_MD4, "",
57 "\x31\xD6\xCF\xE0\xD1\x6A\xE9\x31\xB7\x3C\x59\xD7\xE0\xC0\x89\xC0" },
58 { GCRY_MD_MD4, "a",
59 "\xbd\xe5\x2c\xb3\x1d\xe3\x3e\x46\x24\x5e\x05\xfb\xdb\xd6\xfb\x24" },
60 { GCRY_MD_MD4, "message digest",
61 "\xd9\x13\x0a\x81\x64\x54\x9f\xe8\x18\x87\x48\x06\xe1\xc7\x01\x4b" },
62 +#endif
63 +#if USE_MD4
64 { GCRY_MD_MD5, "",
65 "\xD4\x1D\x8C\xD9\x8F\x00\xB2\x04\xE9\x80\x09\x98\xEC\xF8\x42\x7E" },
66 { GCRY_MD_MD5, "a",
67 @@ -1151,6 +1154,8 @@
68 "\x90\x01\x50\x98\x3C\xD2\x4F\xB0\xD6\x96\x3F\x7D\x28\xE1\x7F\x72" },
69 { GCRY_MD_MD5, "message digest",
70 "\xF9\x6B\x69\x7D\x7C\xB7\x93\x8D\x52\x5A\x2F\x31\xAA\xF1\x61\xD0" },
71 +#endif
72 +#if USE_SHA1
73 { GCRY_MD_SHA1, "abc",
74 "\xA9\x99\x3E\x36\x47\x06\x81\x6A\xBA\x3E"
75 "\x25\x71\x78\x50\xC2\x6C\x9C\xD0\xD8\x9D" },
76 @@ -1161,6 +1166,8 @@
77 { GCRY_MD_SHA1, "!" /* kludge for "a"*1000000 */ ,
78 "\x34\xAA\x97\x3C\xD4\xC4\xDA\xA4\xF6\x1E"
79 "\xEB\x2B\xDB\xAD\x27\x31\x65\x34\x01\x6F" },
80 +#endif
81 +#if USE_SHA224
82 /* From RFC3874 */
83 { GCRY_MD_SHA224, "abc",
84 "\x23\x09\x7d\x22\x34\x05\xd8\x22\x86\x42\xa4\x77\xbd\xa2\x55\xb3"
85 @@ -1172,6 +1179,8 @@
86 { GCRY_MD_SHA224, "!",
87 "\x20\x79\x46\x55\x98\x0c\x91\xd8\xbb\xb4\xc1\xea\x97\x61\x8a\x4b"
88 "\xf0\x3f\x42\x58\x19\x48\xb2\xee\x4e\xe7\xad\x67" },
89 +#endif
90 +#if USE_SHA256
91 { GCRY_MD_SHA256, "abc",
92 "\xba\x78\x16\xbf\x8f\x01\xcf\xea\x41\x41\x40\xde\x5d\xae\x22\x23"
93 "\xb0\x03\x61\xa3\x96\x17\x7a\x9c\xb4\x10\xff\x61\xf2\x00\x15\xad" },
94 @@ -1182,15 +1191,20 @@
95 { GCRY_MD_SHA256, "!",
96 "\xcd\xc7\x6e\x5c\x99\x14\xfb\x92\x81\xa1\xc7\xe2\x84\xd7\x3e\x67"
97 "\xf1\x80\x9a\x48\xa4\x97\x20\x0e\x04\x6d\x39\xcc\xc7\x11\x2c\xd0" },
98 +#endif
99 +#if USE_SHA384
100 { GCRY_MD_SHA384, "abc",
101 "\xcb\x00\x75\x3f\x45\xa3\x5e\x8b\xb5\xa0\x3d\x69\x9a\xc6\x50\x07"
102 "\x27\x2c\x32\xab\x0e\xde\xd1\x63\x1a\x8b\x60\x5a\x43\xff\x5b\xed"
103 "\x80\x86\x07\x2b\xa1\xe7\xcc\x23\x58\xba\xec\xa1\x34\xc8\x25\xa7" },
104 +#endif
105 +#if USE_SHA512
106 { GCRY_MD_SHA512, "abc",
107 "\xDD\xAF\x35\xA1\x93\x61\x7A\xBA\xCC\x41\x73\x49\xAE\x20\x41\x31"
108 "\x12\xE6\xFA\x4E\x89\xA9\x7E\xA2\x0A\x9E\xEE\xE6\x4B\x55\xD3\x9A"
109 "\x21\x92\x99\x2A\x27\x4F\xC1\xA8\x36\xBA\x3C\x23\xA3\xFE\xEB\xBD"
110 "\x45\x4D\x44\x23\x64\x3C\xE8\x0E\x2A\x9A\xC9\x4F\xA5\x4C\xA4\x9F" },
111 +#endif
112 { GCRY_MD_RMD160, "",
113 "\x9c\x11\x85\xa5\xc5\xe9\xfc\x54\x61\x28"
114 "\x08\x97\x7e\xe8\xf5\x48\xb2\x25\x8d\x31" },
115 @@ -1203,6 +1217,7 @@
116 { GCRY_MD_RMD160, "message digest",
117 "\x5d\x06\x89\xef\x49\xd2\xfa\xe5\x72\xb8"
118 "\x81\xb1\x23\xa8\x5f\xfa\x21\x59\x5f\x36" },
119 +#if USE_CRC
120 { GCRY_MD_CRC32, "", "\x00\x00\x00\x00" },
121 { GCRY_MD_CRC32, "foo", "\x8c\x73\x65\x21" },
122 { GCRY_MD_CRC32_RFC1510, "", "\x00\x00\x00\x00" },
123 @@ -1222,6 +1237,8 @@
124 #endif
125 { GCRY_MD_CRC24_RFC2440, "", "\xb7\x04\xce" },
126 { GCRY_MD_CRC24_RFC2440, "foo", "\x4f\xc2\x55" },
127 +#endif
128 +#if USE_TIGER
129 { GCRY_MD_TIGER, "",
130 "\x24\xF0\x13\x0C\x63\xAC\x93\x32\x16\x16\x6E\x76"
131 "\xB1\xBB\x92\x5F\xF3\x73\xDE\x2D\x49\x58\x4E\x7A" },
132 @@ -1258,6 +1275,8 @@
133 "TUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-",
134 "\x00\xB8\x3E\xB4\xE5\x34\x40\xC5\x76\xAC\x6A\xAE"
135 "\xE0\xA7\x48\x58\x25\xFD\x15\xE7\x0A\x59\xFF\xE4" },
136 +#endif
137 +#if USE_WHIRLPOOL
138 { GCRY_MD_WHIRLPOOL, "",
139 "\x19\xFA\x61\xD7\x55\x22\xA4\x66\x9B\x44\xE3\x9C\x1D\x2E\x17\x26"
140 "\xC5\x30\x23\x21\x30\xD4\x07\xF8\x9A\xFE\xE0\x96\x49\x97\xF7\xA7"
141 @@ -1285,6 +1304,7 @@
142 "\x29\x05\x7F\xD8\x6B\x20\xBF\xD6\x2D\xEC\xA0\xF1\xCC\xEA\x4A\xF5"
143 "\x1F\xC1\x54\x90\xED\xDC\x47\xAF\x32\xBB\x2B\x66\xC3\x4F\xF9\xAD"
144 "\x8C\x60\x08\xAD\x67\x7F\x77\x12\x69\x53\xB2\x26\xE4\xED\x8B\x01" },
145 +#endif
146 { 0 },
147 };
148 int i;
149 @@ -1523,6 +1543,7 @@
150 "\xaa\xaa\xaa",
151 "\x3a\x85\x41\x66\xac\x5d\x9f\x02\x3f\x54\xd5\x17\xd0\xb3\x9d\xbd"
152 "\x94\x67\x70\xdb\x9c\x2b\x95\xc9\xf6\xf5\x65\xd1" },
153 +#if USE_SHA384
154 { GCRY_MD_SHA384, "what do ya want for nothing?", "Jefe",
155 "\xaf\x45\xd2\xe3\x76\x48\x40\x31\x61\x7f\x78\xd2\xb5\x8a\x6b\x1b"
156 "\x9c\x7e\xf4\x64\xf5\xa0\x1b\x47\xe4\x2e\xc3\x73\x63\x22\x44\x5e"
157 @@ -1582,6 +1603,8 @@
158 "\x66\x17\x17\x8e\x94\x1f\x02\x0d\x35\x1e\x2f\x25\x4e\x8f\xd3\x2c"
159 "\x60\x24\x20\xfe\xb0\xb8\xfb\x9a\xdc\xce\xbb\x82\x46\x1e\x99\xc5"
160 "\xa6\x78\xcc\x31\xe7\x99\x17\x6d\x38\x60\xe6\x11\x0c\x46\x52\x3e" },
161 +#endif
162 +#if USE_SHA512
163 { GCRY_MD_SHA512, "what do ya want for nothing?", "Jefe",
164 "\x16\x4b\x7a\x7b\xfc\xf8\x19\xe2\xe3\x95\xfb\xe7\x3b\x56\xe0\xa3"
165 "\x87\xbd\x64\x22\x2e\x83\x1f\xd6\x10\x27\x0c\xd7\xea\x25\x05\x54"
166 @@ -1647,6 +1670,7 @@
167 "\xde\xbd\x71\xf8\x86\x72\x89\x86\x5d\xf5\xa3\x2d\x20\xcd\xc9\x44"
168 "\xb6\x02\x2c\xac\x3c\x49\x82\xb1\x0d\x5e\xeb\x55\xc3\xe4\xde\x15"
169 "\x13\x46\x76\xfb\x6d\xe0\x44\x60\x65\xc9\x74\x40\xfa\x8c\x6a\x58" },
170 +#endif
171 { 0 },
172 };
173 int i;
174 @@ -1931,6 +1955,7 @@
175 "\xc6\x39\x83\x1a\x43\xe5\x05\x5d\xc6\xd8"
176 "\x4a\xa6\xf9\xeb\x23\xbf\xa9\x12\x2d\x5b" }
177 },
178 +#if USE_ELGAMAL
179 {
180 GCRY_PK_ELG, FLAG_SIGN | FLAG_CRYPT,
181
182 @@ -1962,6 +1987,7 @@
183 "\xa7\x99\x61\xeb\x88\x83\xd2\xf4\x05\xc8"
184 "\x4f\xba\x06\xf8\x78\x09\xbc\x1e\x20\xe5" }
185 },
186 +#endif
187 };
188 int i;
189 if (verbose)
190 diff -ur libgcrypt-1.4.1.orig/tests/pubkey.c libgcrypt-1.4.1/tests/pubkey.c
191 --- libgcrypt-1.4.1.orig/tests/pubkey.c 2008-03-18 14:25:36.000000000 +0100
192 +++ libgcrypt-1.4.1/tests/pubkey.c 2008-05-09 22:36:57.000000000 +0200
193 @@ -1,5 +1,5 @@
194 /* pubkey.c - Public key encryption/decryption tests
195 - * Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
196 + * Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc.
197 *
198 * This file is part of Libgcrypt.
199 *
200 @@ -326,6 +326,7 @@
201 gcry_sexp_release (pkey);
202 gcry_sexp_release (skey);
203
204 +#if USE_ELGAMAL
205 if (verbose)
206 fprintf (stderr, "Checking generated Elgamal key.\n");
207 get_elg_key_new (&pkey, &skey, 0);
208 @@ -339,6 +340,7 @@
209 check_keys (pkey, skey, 800, 0);
210 gcry_sexp_release (pkey);
211 gcry_sexp_release (skey);
212 +#endif
213 }
214
215