libidn
1.26
Main Page
Data Structures
Files
File List
Globals
src
libidn-1.26
lib
profiles.c
Go to the documentation of this file.
1
/* profiles.c --- Definitions of stringprep profiles.
2
Copyright (C) 2002-2012 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
33
const
Stringprep_profiles
stringprep_profiles
[] = {
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
46
const
Stringprep_profile
stringprep_nameprep
[] = {
47
{
STRINGPREP_MAP_TABLE
, 0,
stringprep_rfc3454_B_1
},
48
{
STRINGPREP_MAP_TABLE
, 0,
stringprep_rfc3454_B_2
},
49
{
STRINGPREP_NFKC
, 0, 0},
50
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_1_2
},
51
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_2_2
},
52
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_3
},
53
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_4
},
54
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_5
},
55
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_6
},
56
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_7
},
57
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_8
},
58
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_9
},
59
{
STRINGPREP_BIDI
, 0, 0},
60
{
STRINGPREP_BIDI_PROHIBIT_TABLE
, ~
STRINGPREP_NO_BIDI
,
61
stringprep_rfc3454_C_8
},
62
{
STRINGPREP_BIDI_RAL_TABLE
, 0,
stringprep_rfc3454_D_1
},
63
{
STRINGPREP_BIDI_L_TABLE
, 0,
stringprep_rfc3454_D_2
},
64
{
STRINGPREP_UNASSIGNED_TABLE
, ~
STRINGPREP_NO_UNASSIGNED
,
65
stringprep_rfc3454_A_1
},
66
{0}
67
};
68
69
const
Stringprep_profile
stringprep_kerberos5
[] = {
70
/* XXX this is likely to be wrong as the specification is
71
a rough draft. */
72
{
STRINGPREP_MAP_TABLE
, 0,
stringprep_rfc3454_B_1
},
73
{
STRINGPREP_MAP_TABLE
, 0,
stringprep_rfc3454_B_3
},
74
{
STRINGPREP_NFKC
, 0, 0},
75
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_1_2
},
76
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_2_2
},
77
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_3
},
78
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_4
},
79
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_5
},
80
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_6
},
81
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_7
},
82
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_8
},
83
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_9
},
84
{
STRINGPREP_BIDI
, 0, 0},
85
{
STRINGPREP_BIDI_PROHIBIT_TABLE
, ~
STRINGPREP_NO_BIDI
,
86
stringprep_rfc3454_C_8
},
87
{
STRINGPREP_BIDI_RAL_TABLE
, 0,
stringprep_rfc3454_D_1
},
88
{
STRINGPREP_BIDI_L_TABLE
, 0,
stringprep_rfc3454_D_2
},
89
{
STRINGPREP_UNASSIGNED_TABLE
, ~
STRINGPREP_NO_UNASSIGNED
,
90
stringprep_rfc3454_A_1
},
91
{0}
92
};
93
94
const
Stringprep_table_element
stringprep_xmpp_nodeprep_prohibit
[] = {
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
106
const
Stringprep_profile
stringprep_xmpp_nodeprep
[] = {
107
{
STRINGPREP_MAP_TABLE
, 0,
stringprep_rfc3454_B_1
},
108
{
STRINGPREP_MAP_TABLE
, 0,
stringprep_rfc3454_B_2
},
109
{
STRINGPREP_NFKC
, 0, 0},
110
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_1_1
},
111
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_1_2
},
112
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_2_1
},
113
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_2_2
},
114
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_3
},
115
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_4
},
116
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_5
},
117
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_6
},
118
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_7
},
119
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_8
},
120
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_9
},
121
{
STRINGPREP_PROHIBIT_TABLE
, 0, stringprep_xmpp_nodeprep_prohibit},
122
{
STRINGPREP_BIDI
, 0, 0},
123
{
STRINGPREP_BIDI_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_8
},
124
{
STRINGPREP_BIDI_RAL_TABLE
, 0,
stringprep_rfc3454_D_1
},
125
{
STRINGPREP_BIDI_L_TABLE
, 0,
stringprep_rfc3454_D_2
},
126
{
STRINGPREP_UNASSIGNED_TABLE
, ~
STRINGPREP_NO_UNASSIGNED
,
127
stringprep_rfc3454_A_1
},
128
{0}
129
};
130
131
const
Stringprep_profile
stringprep_xmpp_resourceprep
[] = {
132
{
STRINGPREP_MAP_TABLE
, 0,
stringprep_rfc3454_B_1
},
133
{
STRINGPREP_NFKC
, 0, 0},
134
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_1_2
},
135
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_2_1
},
136
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_2_2
},
137
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_3
},
138
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_4
},
139
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_5
},
140
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_6
},
141
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_7
},
142
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_8
},
143
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_9
},
144
{
STRINGPREP_BIDI
, 0, 0},
145
{
STRINGPREP_BIDI_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_8
},
146
{
STRINGPREP_BIDI_RAL_TABLE
, ~
STRINGPREP_NO_BIDI
,
stringprep_rfc3454_D_1
},
147
{
STRINGPREP_BIDI_L_TABLE
, ~
STRINGPREP_NO_BIDI
,
stringprep_rfc3454_D_2
},
148
{
STRINGPREP_UNASSIGNED_TABLE
, ~
STRINGPREP_NO_UNASSIGNED
,
149
stringprep_rfc3454_A_1
},
150
{0}
151
};
152
153
const
Stringprep_profile
stringprep_plain
[] = {
154
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_2_1
},
155
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_2_2
},
156
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_3
},
157
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_4
},
158
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_5
},
159
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_6
},
160
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_8
},
161
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_9
},
162
{
STRINGPREP_BIDI
, 0, 0},
163
{
STRINGPREP_BIDI_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_8
},
164
{
STRINGPREP_BIDI_RAL_TABLE
, ~
STRINGPREP_NO_BIDI
,
stringprep_rfc3454_D_1
},
165
{
STRINGPREP_BIDI_L_TABLE
, ~
STRINGPREP_NO_BIDI
,
stringprep_rfc3454_D_2
},
166
{0}
167
};
168
169
const
Stringprep_profile
stringprep_trace
[] = {
170
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_2_1
},
171
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_2_2
},
172
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_3
},
173
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_4
},
174
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_5
},
175
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_6
},
176
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_8
},
177
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_9
},
178
{
STRINGPREP_BIDI
, 0, 0},
179
{
STRINGPREP_BIDI_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_8
},
180
{
STRINGPREP_BIDI_RAL_TABLE
, ~
STRINGPREP_NO_BIDI
,
stringprep_rfc3454_D_1
},
181
{
STRINGPREP_BIDI_L_TABLE
, ~
STRINGPREP_NO_BIDI
,
stringprep_rfc3454_D_2
},
182
{0}
183
};
184
185
const
Stringprep_table_element
stringprep_iscsi_prohibit
[] = {
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
255
const
Stringprep_profile
stringprep_iscsi
[] = {
256
{
STRINGPREP_MAP_TABLE
, 0,
stringprep_rfc3454_B_1
},
257
{
STRINGPREP_MAP_TABLE
, 0,
stringprep_rfc3454_B_2
},
258
{
STRINGPREP_NFKC
, 0, 0},
259
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_1_1
},
260
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_1_2
},
261
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_2_1
},
262
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_2_2
},
263
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_3
},
264
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_4
},
265
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_5
},
266
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_6
},
267
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_7
},
268
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_8
},
269
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_9
},
270
{
STRINGPREP_PROHIBIT_TABLE
, 0, stringprep_iscsi_prohibit},
271
{
STRINGPREP_BIDI
, 0, 0},
272
{
STRINGPREP_BIDI_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_8
},
273
{
STRINGPREP_BIDI_RAL_TABLE
, ~
STRINGPREP_NO_BIDI
,
stringprep_rfc3454_D_1
},
274
{
STRINGPREP_BIDI_L_TABLE
, ~
STRINGPREP_NO_BIDI
,
stringprep_rfc3454_D_2
},
275
{
STRINGPREP_UNASSIGNED_TABLE
, ~
STRINGPREP_NO_UNASSIGNED
,
276
stringprep_rfc3454_A_1
},
277
{0}
278
};
279
280
const
Stringprep_table_element
stringprep_saslprep_space_map
[] = {
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
301
const
Stringprep_profile
stringprep_saslprep
[] = {
302
{
STRINGPREP_MAP_TABLE
, 0, stringprep_saslprep_space_map},
303
{
STRINGPREP_MAP_TABLE
, 0,
stringprep_rfc3454_B_1
},
304
{
STRINGPREP_NFKC
, 0, 0},
305
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_1_2
},
306
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_2_1
},
307
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_2_2
},
308
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_3
},
309
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_4
},
310
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_5
},
311
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_6
},
312
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_7
},
313
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_8
},
314
{
STRINGPREP_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_9
},
315
{
STRINGPREP_BIDI
, 0, 0},
316
{
STRINGPREP_BIDI_PROHIBIT_TABLE
, 0,
stringprep_rfc3454_C_8
},
317
{
STRINGPREP_BIDI_RAL_TABLE
, ~
STRINGPREP_NO_BIDI
,
stringprep_rfc3454_D_1
},
318
{
STRINGPREP_BIDI_L_TABLE
, ~
STRINGPREP_NO_BIDI
,
stringprep_rfc3454_D_2
},
319
{
STRINGPREP_UNASSIGNED_TABLE
, ~
STRINGPREP_NO_UNASSIGNED
,
320
stringprep_rfc3454_A_1
},
321
{0}
322
};
Generated on Fri Apr 5 2013 10:35:24 for libidn by
1.8.3.1