libidn  1.31
profiles.c
Go to the documentation of this file.
1 /* profiles.c --- Definitions of stringprep profiles.
2  Copyright (C) 2002-2015 Simon Josefsson
3 
4  This file is part of GNU Libidn.
5 
6  GNU Libidn is free software: you can redistribute it and/or
7  modify it under the terms of either:
8 
9  * the GNU Lesser General Public License as published by the Free
10  Software Foundation; either version 3 of the License, or (at
11  your option) any later version.
12 
13  or
14 
15  * the GNU General Public License as published by the Free
16  Software Foundation; either version 2 of the License, or (at
17  your option) any later version.
18 
19  or both in parallel, as here.
20 
21  GNU Libidn is distributed in the hope that it will be useful,
22  but WITHOUT ANY WARRANTY; without even the implied warranty of
23  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24  General Public License for more details.
25 
26  You should have received copies of the GNU General Public License and
27  the GNU Lesser General Public License along with this program. If
28  not, see <http://www.gnu.org/licenses/>. */
29 
30 #include <config.h>
31 #include "stringprep.h"
32 
34  {"Nameprep", stringprep_nameprep},
35  {"KRBprep", stringprep_kerberos5}, /* Deprecate? */
36  {"Nodeprep", stringprep_xmpp_nodeprep},
37  {"Resourceprep", stringprep_xmpp_resourceprep},
38  {"plain", stringprep_plain}, /* sasl-anon-00. */
39  {"trace", stringprep_trace}, /* sasl-anon-01,02,03. */
40  {"SASLprep", stringprep_saslprep},
41  {"ISCSIprep", stringprep_iscsi}, /* Obsolete. */
42  {"iSCSI", stringprep_iscsi}, /* IANA. */
43  {NULL, NULL}
44 };
45 
49  {STRINGPREP_NFKC, 0, 0},
59  {STRINGPREP_BIDI, 0, 0},
66  {0}
67 };
68 
70  /* XXX this is likely to be wrong as the specification is
71  a rough draft. */
74  {STRINGPREP_NFKC, 0, 0},
84  {STRINGPREP_BIDI, 0, 0},
91  {0}
92 };
93 
95  {0x000022}, /* #x22 (") */
96  {0x000026}, /* #x26 (&) */
97  {0x000027}, /* #x27 (') */
98  {0x00002F}, /* #x2F (/) */
99  {0x00003A}, /* #x3A (:) */
100  {0x00003C}, /* #x3C (<) */
101  {0x00003E}, /* #x3E (>) */
102  {0x000040}, /* #x40 (@) */
103  {0}
104 };
105 
109  {STRINGPREP_NFKC, 0, 0},
121  {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_xmpp_nodeprep_prohibit},
122  {STRINGPREP_BIDI, 0, 0},
128  {0}
129 };
130 
133  {STRINGPREP_NFKC, 0, 0},
144  {STRINGPREP_BIDI, 0, 0},
150  {0}
151 };
152 
162  {STRINGPREP_BIDI, 0, 0},
166  {0}
167 };
168 
178  {STRINGPREP_BIDI, 0, 0},
182  {0}
183 };
184 
186  /* NB, since start == 0, we must have that end != 0 for the
187  end-of-table logic to work. */
188  {0x0000, 1}, /* [ASCII CONTROL CHARACTERS and SPACE through ,] */
189  {0x0001},
190  {0x0002},
191  {0x0003},
192  {0x0004},
193  {0x0005},
194  {0x0006},
195  {0x0007},
196  {0x0008},
197  {0x0009},
198  {0x000A},
199  {0x000B},
200  {0x000C},
201  {0x000D},
202  {0x000E},
203  {0x000F},
204  {0x0010},
205  {0x0011},
206  {0x0012},
207  {0x0013},
208  {0x0014},
209  {0x0015},
210  {0x0016},
211  {0x0017},
212  {0x0018},
213  {0x0019},
214  {0x001A},
215  {0x001B},
216  {0x001C},
217  {0x001D},
218  {0x001E},
219  {0x001F},
220  {0x0020},
221  {0x0021},
222  {0x0022},
223  {0x0023},
224  {0x0024},
225  {0x0025},
226  {0x0026},
227  {0x0027},
228  {0x0028},
229  {0x0029},
230  {0x002A},
231  {0x002B},
232  {0x002C},
233  {0x002F}, /* [ASCII /] */
234  {0x003B}, /* [ASCII ; through @] */
235  {0x003C},
236  {0x003D},
237  {0x003E},
238  {0x003F},
239  {0x0040},
240  {0x005B}, /* [ASCII [ through `] */
241  {0x005C},
242  {0x005D},
243  {0x005E},
244  {0x005F},
245  {0x0060},
246  {0x007B}, /* [ASCII { through DEL] */
247  {0x007C},
248  {0x007D},
249  {0x007E},
250  {0x007F},
251  {0x3002}, /* ideographic full stop */
252  {0}
253 };
254 
258  {STRINGPREP_NFKC, 0, 0},
270  {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_iscsi_prohibit},
271  {STRINGPREP_BIDI, 0, 0},
277  {0}
278 };
279 
281  {0x0000A0, 0, {0x0020}}, /* 00A0; NO-BREAK SPACE */
282  {0x001680, 0, {0x0020}}, /* 1680; OGHAM SPACE MARK */
283  {0x002000, 0, {0x0020}}, /* 2000; EN QUAD */
284  {0x002001, 0, {0x0020}}, /* 2001; EM QUAD */
285  {0x002002, 0, {0x0020}}, /* 2002; EN SPACE */
286  {0x002003, 0, {0x0020}}, /* 2003; EM SPACE */
287  {0x002004, 0, {0x0020}}, /* 2004; THREE-PER-EM SPACE */
288  {0x002005, 0, {0x0020}}, /* 2005; FOUR-PER-EM SPACE */
289  {0x002006, 0, {0x0020}}, /* 2006; SIX-PER-EM SPACE */
290  {0x002007, 0, {0x0020}}, /* 2007; FIGURE SPACE */
291  {0x002008, 0, {0x0020}}, /* 2008; PUNCTUATION SPACE */
292  {0x002009, 0, {0x0020}}, /* 2009; THIN SPACE */
293  {0x00200A, 0, {0x0020}}, /* 200A; HAIR SPACE */
294  {0x00200B, 0, {0x0020}}, /* 200B; ZERO WIDTH SPACE */
295  {0x00202F, 0, {0x0020}}, /* 202F; NARROW NO-BREAK SPACE */
296  {0x00205F, 0, {0x0020}}, /* 205F; MEDIUM MATHEMATICAL SPACE */
297  {0x003000, 0, {0x0020}}, /* 3000; IDEOGRAPHIC SPACE */
298  {0}
299 };
300 
302  {STRINGPREP_MAP_TABLE, 0, stringprep_saslprep_space_map},
304  {STRINGPREP_NFKC, 0, 0},
315  {STRINGPREP_BIDI, 0, 0},
321  {0}
322 };
const Stringprep_table_element stringprep_rfc3454_D_1[]
Definition: rfc3454.c:3846
const Stringprep_table_element stringprep_xmpp_nodeprep_prohibit[]
Definition: profiles.c:94
const Stringprep_table_element stringprep_rfc3454_C_2_1[]
Definition: rfc3454.c:3609
const Stringprep_table_element stringprep_rfc3454_C_9[]
Definition: rfc3454.c:3834
const Stringprep_profile stringprep_iscsi[]
Definition: profiles.c:255
const Stringprep_table_element stringprep_rfc3454_D_2[]
Definition: rfc3454.c:3890
const Stringprep_profile stringprep_plain[]
Definition: profiles.c:153
const Stringprep_profile stringprep_nameprep[]
Definition: profiles.c:46
const Stringprep_profiles stringprep_profiles[]
Definition: profiles.c:33
const Stringprep_table_element stringprep_rfc3454_A_1[]
Definition: rfc3454.c:13
const Stringprep_table_element stringprep_rfc3454_C_5[]
Definition: rfc3454.c:3752
const Stringprep_profile stringprep_saslprep[]
Definition: profiles.c:301
const Stringprep_profile stringprep_kerberos5[]
Definition: profiles.c:69
const Stringprep_table_element stringprep_rfc3454_C_3[]
Definition: rfc3454.c:3709
const Stringprep_table_element stringprep_rfc3454_C_4[]
Definition: rfc3454.c:3723
const Stringprep_profile stringprep_xmpp_resourceprep[]
Definition: profiles.c:131
const Stringprep_table_element stringprep_rfc3454_B_1[]
Definition: rfc3454.c:419
const Stringprep_table_element stringprep_saslprep_space_map[]
Definition: profiles.c:280
const Stringprep_table_element stringprep_rfc3454_C_7[]
Definition: rfc3454.c:3778
const Stringprep_table_element stringprep_rfc3454_C_6[]
Definition: rfc3454.c:3763
const Stringprep_table_element stringprep_rfc3454_C_1_1[]
Definition: rfc3454.c:3473
const Stringprep_table_element stringprep_iscsi_prohibit[]
Definition: profiles.c:185
const Stringprep_profile stringprep_trace[]
Definition: profiles.c:169
const Stringprep_profile stringprep_xmpp_nodeprep[]
Definition: profiles.c:106
const Stringprep_table_element stringprep_rfc3454_C_2_2[]
Definition: rfc3454.c:3682
const Stringprep_table_element stringprep_rfc3454_B_2[]
Definition: rfc3454.c:456
const Stringprep_table_element stringprep_rfc3454_C_1_2[]
Definition: rfc3454.c:3524
const Stringprep_table_element stringprep_rfc3454_B_3[]
Definition: rfc3454.c:2484
const Stringprep_table_element stringprep_rfc3454_C_8[]
Definition: rfc3454.c:3791