Whamcloud - gitweb
- make HEAD from b_post_cmd3
[fs/lustre-release.git] / lustre / utils / gss / context_lucid.c
1 /*
2  * COPYRIGHT (c) 2006
3  * The Regents of the University of Michigan
4  * ALL RIGHTS RESERVED
5  *
6  * Permission is granted to use, copy, create derivative works
7  * and redistribute this software and such derivative works
8  * for any purpose, so long as the name of The University of
9  * Michigan is not used in any advertising or publicity
10  * pertaining to the use of distribution of this software
11  * without specific, written prior authorization.  If the
12  * above copyright notice or any other identification of the
13  * University of Michigan is included in any copy of any
14  * portion of this software, then the disclaimer below must
15  * also be included.
16  *
17  * THIS SOFTWARE IS PROVIDED AS IS, WITHOUT REPRESENTATION
18  * FROM THE UNIVERSITY OF MICHIGAN AS TO ITS FITNESS FOR ANY
19  * PURPOSE, AND WITHOUT WARRANTY BY THE UNIVERSITY OF
20  * MICHIGAN OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING
21  * WITHOUT LIMITATION THE IMPLIED WARRANTIES OF
22  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
23  * REGENTS OF THE UNIVERSITY OF MICHIGAN SHALL NOT BE LIABLE
24  * FOR ANY DAMAGES, INCLUDING SPECIAL, INDIRECT, INCIDENTAL, OR
25  * CONSEQUENTIAL DAMAGES, WITH RESPECT TO ANY CLAIM ARISING
26  * OUT OF OR IN CONNECTION WITH THE USE OF THE SOFTWARE, EVEN
27  * IF IT HAS BEEN OR IS HEREAFTER ADVISED OF THE POSSIBILITY OF
28  * SUCH DAMAGES.
29  */
30
31 #include "config.h"
32
33 #ifdef HAVE_LUCID_CONTEXT_SUPPORT
34
35 /*
36  * Newer versions of MIT and Heimdal have lucid context support.
37  * We can use common code if it is supported.
38  */
39
40 #include <stdio.h>
41 #include <syslog.h>
42 #include <string.h>
43 #include <errno.h>
44 #include <stdint.h>
45 #include <krb5.h>
46 #include <gssapi/gssapi.h>
47 #ifndef OM_uint64
48 typedef uint64_t OM_uint64;
49 #endif
50 #include <gssapi/gssapi_krb5.h>
51
52 #include "gss_util.h"
53 #include "gss_oids.h"
54 #include "err_util.h"
55 #include "context.h"
56
57 static int
58 write_lucid_keyblock(char **p, char *end, gss_krb5_lucid_key_t *key)
59 {
60         gss_buffer_desc tmp;
61
62         if (WRITE_BYTES(p, end, key->type)) return -1;
63         tmp.length = key->length;
64         tmp.value = key->data;
65         if (write_buffer(p, end, &tmp)) return -1;
66         return 0;
67 }
68
69 static int
70 prepare_krb5_rfc1964_buffer(gss_krb5_lucid_context_v1_t *lctx,
71         gss_buffer_desc *buf)
72 {
73         char *p, *end;
74         static int constant_zero = 0;
75         unsigned char fakeseed[16];
76         uint32_t word_send_seq;
77         gss_krb5_lucid_key_t enc_key;
78         int i;
79         char *skd, *dkd;
80         gss_buffer_desc fakeoid;
81
82         /*
83          * The new Kerberos interface to get the gss context
84          * does not include the seed or seed_init fields
85          * because we never really use them.  But for now,
86          * send down a fake buffer so we can use the same
87          * interface to the kernel.
88          */
89         memset(&enc_key, 0, sizeof(enc_key));
90         memset(&fakeoid, 0, sizeof(fakeoid));
91
92         if (!(buf->value = calloc(1, MAX_CTX_LEN)))
93                 goto out_err;
94         p = buf->value;
95         end = buf->value + MAX_CTX_LEN;
96
97         if (WRITE_BYTES(&p, end, lctx->initiate)) goto out_err;
98
99         /* seed_init and seed not used by kernel anyway */
100         if (WRITE_BYTES(&p, end, constant_zero)) goto out_err;
101         if (write_bytes(&p, end, &fakeseed, 16)) goto out_err;
102
103         if (WRITE_BYTES(&p, end, lctx->rfc1964_kd.sign_alg)) goto out_err;
104         if (WRITE_BYTES(&p, end, lctx->rfc1964_kd.seal_alg)) goto out_err;
105         if (WRITE_BYTES(&p, end, lctx->endtime)) goto out_err;
106         word_send_seq = lctx->send_seq; /* XXX send_seq is 64-bit */
107         if (WRITE_BYTES(&p, end, word_send_seq)) goto out_err;
108         if (write_oid(&p, end, &krb5oid)) goto out_err;
109
110 #ifdef HAVE_HEIMDAL
111         /*
112          * The kernel gss code expects des-cbc-raw for all flavors of des.
113          * The keytype from MIT has this type, but Heimdal does not.
114          * Force the Heimdal keytype to 4 (des-cbc-raw).
115          * Note that the rfc1964 version only supports DES enctypes.
116          */
117         if (lctx->rfc1964_kd.ctx_key.type != 4) {
118                 printerr(2, "%s: overriding heimdal keytype (%d => %d)\n",
119                          __FUNCTION__, lctx->rfc1964_kd.ctx_key.type, 4);
120                 lctx->rfc1964_kd.ctx_key.type = 4;
121         }
122 #endif
123         printerr(2, "%s: serializing keys with enctype %d and length %d\n",
124                  __FUNCTION__, lctx->rfc1964_kd.ctx_key.type,
125                  lctx->rfc1964_kd.ctx_key.length);
126
127         /* derive the encryption key and copy it into buffer */
128         enc_key.type = lctx->rfc1964_kd.ctx_key.type;
129         enc_key.length = lctx->rfc1964_kd.ctx_key.length;
130         if ((enc_key.data = calloc(1, enc_key.length)) == NULL)
131                 goto out_err;
132         skd = (char *) lctx->rfc1964_kd.ctx_key.data;
133         dkd = (char *) enc_key.data;
134         for (i = 0; i < enc_key.length; i++)
135                 dkd[i] = skd[i] ^ 0xf0;
136         if (write_lucid_keyblock(&p, end, &enc_key)) {
137                 free(enc_key.data);
138                 goto out_err;
139         }
140         free(enc_key.data);
141
142         if (write_lucid_keyblock(&p, end, &lctx->rfc1964_kd.ctx_key))
143                 goto out_err;
144
145         buf->length = p - (char *)buf->value;
146         return 0;
147 out_err:
148         printerr(0, "ERROR: failed serializing krb5 context for kernel\n");
149         if (buf->value) free(buf->value);
150         buf->length = 0;
151         if (enc_key.data) free(enc_key.data);
152         return -1;
153 }
154
155 /* XXX Hack alert! XXX  Do NOT submit upstream! XXX */
156 /* XXX Hack alert! XXX  Do NOT submit upstream! XXX */
157
158 /* for 3DES */
159 #define KG_USAGE_SEAL 22
160 #define KG_USAGE_SIGN 23
161 #define KG_USAGE_SEQ  24
162
163 /* for rfc???? */
164 #define KG_USAGE_ACCEPTOR_SEAL  22
165 #define KG_USAGE_ACCEPTOR_SIGN  23
166 #define KG_USAGE_INITIATOR_SEAL 24
167 #define KG_USAGE_INITIATOR_SIGN 25
168
169 /* Lifted from mit src/lib/gssapi/krb5/gssapiP_krb5.h */
170 enum seal_alg {
171   SEAL_ALG_NONE            = 0xffff,
172   SEAL_ALG_DES             = 0x0000,
173   SEAL_ALG_1               = 0x0001, /* not published */
174   SEAL_ALG_MICROSOFT_RC4   = 0x0010, /* microsoft w2k;  */
175   SEAL_ALG_DES3KD          = 0x0002
176 };
177
178 #define KEY_USAGE_SEED_ENCRYPTION       0xAA
179 #define KEY_USAGE_SEED_INTEGRITY        0x55
180 #define KEY_USAGE_SEED_CHECKSUM         0x99
181 #define K5CLENGTH 5
182
183 /* Flags for version 2 context flags */
184 #define KRB5_CTX_FLAG_INITIATOR         0x00000001
185 #define KRB5_CTX_FLAG_CFX               0x00000002
186 #define KRB5_CTX_FLAG_ACCEPTOR_SUBKEY   0x00000004
187
188 /* XXX Hack alert! XXX  Do NOT submit upstream! XXX */
189 /* XXX Hack alert! XXX  Do NOT submit upstream! XXX */
190 /*
191  * We don't have "legal" access to these MIT-only
192  * structures located in libk5crypto
193  */
194 extern void krb5int_enc_arcfour;
195 extern void krb5int_enc_des3;
196 extern void krb5int_enc_aes128;
197 extern void krb5int_enc_aes256;
198 extern int krb5_derive_key();
199
200 static void
201 key_lucid_to_krb5(const gss_krb5_lucid_key_t *lin, krb5_keyblock *kout)
202 {
203         memset(kout, '\0', sizeof(kout));
204 #ifdef HAVE_KRB5
205         kout->enctype = lin->type;
206         kout->length = lin->length;
207         kout->contents = lin->data;
208 #else
209         kout->keytype = lin->type;
210         kout->keyvalue.length = lin->length;
211         kout->keyvalue.data = lin->data;
212 #endif
213 }
214
215 static void
216 key_krb5_to_lucid(const krb5_keyblock *kin, gss_krb5_lucid_key_t *lout)
217 {
218         memset(lout, '\0', sizeof(lout));
219 #ifdef HAVE_KRB5
220         lout->type = kin->enctype;
221         lout->length = kin->length;
222         lout->data = kin->contents;
223 #else
224         lout->type = kin->keytype;
225         lout->length = kin->keyvalue.length;
226         memcpy(lout->data, kin->keyvalue.data, kin->keyvalue.length);
227 #endif
228 }
229
230 /* XXX Hack alert! XXX  Do NOT submit upstream! XXX */
231 /* XXX Hack alert! XXX  Do NOT submit upstream! XXX */
232 /* XXX Hack alert! XXX  Do NOT submit upstream! XXX */
233 /* XXX Hack alert! XXX  Do NOT submit upstream! XXX */
234 /*
235  * Function to derive a new key from a given key and given constant data.
236  */
237 static krb5_error_code
238 derive_key_lucid(const gss_krb5_lucid_key_t *in, gss_krb5_lucid_key_t *out,
239                  int usage, char extra)
240 {
241         krb5_error_code code;
242         unsigned char constant_data[K5CLENGTH];
243         krb5_data datain;
244         int keylength;
245         void *enc;
246         krb5_keyblock kin, kout;  /* must send krb5_keyblock, not lucid! */
247 #ifdef HAVE_HEIMDAL
248         krb5_context kcontext;
249         krb5_keyblock *outkey;
250 #endif
251
252         /*
253          * XXX Hack alert.  We don't have "legal" access to these
254          * values and structures located in libk5crypto
255          */
256         switch (in->type) {
257         case ENCTYPE_DES3_CBC_SHA1:
258 #ifdef HAVE_KRB5
259         case ENCTYPE_DES3_CBC_RAW:
260 #endif
261                 keylength = 24;
262 #ifdef HAVE_KRB5
263                 enc = &krb5int_enc_des3;
264 #endif
265                 break;
266         case ENCTYPE_AES128_CTS_HMAC_SHA1_96:
267                 keylength = 16;
268 #ifdef HAVE_KRB5
269                 enc = &krb5int_enc_aes128;
270 #endif
271                 break;
272         case ENCTYPE_AES256_CTS_HMAC_SHA1_96:
273                 keylength = 32;
274 #ifdef HAVE_KRB5
275                 enc = &krb5int_enc_aes256;
276 #endif
277                 break;
278         default:
279                 code = KRB5_BAD_ENCTYPE;
280                 goto out;
281         }
282
283         /* allocate memory for output key */
284         if ((out->data = malloc(keylength)) == NULL) {
285                 code = ENOMEM;
286                 goto out;
287         }
288         out->length = keylength;
289         out->type = in->type;
290
291         /* Convert to correct format for call to krb5_derive_key */
292         key_lucid_to_krb5(in, &kin);
293         key_lucid_to_krb5(out, &kout);
294
295         datain.data = (char *) constant_data;
296         datain.length = K5CLENGTH;
297
298         ((char *)(datain.data))[0] = (usage>>24)&0xff;
299         ((char *)(datain.data))[1] = (usage>>16)&0xff;
300         ((char *)(datain.data))[2] = (usage>>8)&0xff;
301         ((char *)(datain.data))[3] = usage&0xff;
302
303         ((char *)(datain.data))[4] = (char) extra;
304
305 #ifdef HAVE_KRB5
306         code = krb5_derive_key(enc, &kin, &kout, &datain);
307 #else
308         if ((code = krb5_init_context(&kcontext))) {
309         }
310         code = krb5_derive_key(kcontext, &kin, in->type, constant_data, K5CLENGTH, &outkey);
311 #endif
312         if (code) {
313                 free(out->data);
314                 out->data = NULL;
315                 goto out;
316         }
317 #ifdef HAVE_KRB5
318         key_krb5_to_lucid(&kout, out);
319 #else
320         key_krb5_to_lucid(outkey, out);
321         krb5_free_keyblock(kcontext, outkey);
322         krb5_free_context(kcontext);
323 #endif
324
325   out:
326         if (code)
327                 printerr(0, "ERROR: %s: returning error %d (%s)\n",
328                          __FUNCTION__, code, error_message(code));
329         return (code);
330 }
331
332
333 /*
334  * Prepare a new-style buffer, as defined in rfc4121 (a.k.a. cfx),
335  * to send to the kernel for newer encryption types -- or for DES3.
336  *
337  * The new format is:
338  *
339  *      u32 initiate;                   ( whether we are the initiator or not )
340  *      s32 endtime;
341  *      u32 flags;
342  *      #define KRB5_CTX_FLAG_INITIATOR         0x00000001
343  *      #define KRB5_CTX_FLAG_CFX               0x00000002
344  *      #define KRB5_CTX_FLAG_ACCEPTOR_SUBKEY   0x00000004
345  *      u64 seq_send;
346  *      u32  enctype;                   ( encrption type of keys )
347  *      u32  size_of_each_key;          ( size of each key in bytes )
348  *      u32  number_of_keys;            ( N -- should always be 3 for now )
349  *      keydata-1;                      ( Ke )
350  *      keydata-2;                      ( Ki )
351  *      keydata-3;                      ( Kc )
352  *
353  */
354 static int
355 prepare_krb5_rfc4121_buffer(gss_krb5_lucid_context_v1_t *lctx,
356                             gss_buffer_desc *buf)
357 {
358         static int constant_two = 2;
359         char *p, *end;
360         uint32_t v2_flags = 0;
361         gss_krb5_lucid_key_t enc_key;
362         gss_krb5_lucid_key_t derived_key;
363         gss_buffer_desc fakeoid;
364         uint32_t enctype;
365         uint32_t keysize;
366         uint32_t numkeys;
367
368         memset(&enc_key, 0, sizeof(enc_key));
369         memset(&fakeoid, 0, sizeof(fakeoid));
370
371         if (!(buf->value = calloc(1, MAX_CTX_LEN)))
372                 goto out_err;
373         p = buf->value;
374         end = buf->value + MAX_CTX_LEN;
375
376         /* Version 2 */
377         if (WRITE_BYTES(&p, end, constant_two)) goto out_err;
378         if (WRITE_BYTES(&p, end, lctx->endtime)) goto out_err;
379
380         if (lctx->initiate)
381                 v2_flags |= KRB5_CTX_FLAG_INITIATOR;
382         if (lctx->protocol != 0)
383                 v2_flags |= KRB5_CTX_FLAG_CFX;
384         if (lctx->protocol != 0 && lctx->cfx_kd.have_acceptor_subkey == 1)
385                 v2_flags |= KRB5_CTX_FLAG_ACCEPTOR_SUBKEY;
386
387         if (WRITE_BYTES(&p, end, v2_flags)) goto out_err;
388
389         if (WRITE_BYTES(&p, end, lctx->send_seq)) goto out_err;
390
391         /* Protocol 0 here implies DES3 or RC4 */
392         printerr(2, "%s: protocol %d\n", __FUNCTION__, lctx->protocol);
393         if (lctx->protocol == 0) {
394                 enctype = lctx->rfc1964_kd.ctx_key.type;
395 #ifdef HAVE_HEIMDAL
396                 /*
397                  * The kernel gss code expects ENCTYPE_DES3_CBC_RAW (6) for
398                  * 3des keys, but Heimdal key has ENCTYPE_DES3_CBC_SHA1 (16).
399                  * Force the Heimdal enctype to 6.
400                  */
401                 if (enctype == ENCTYPE_DES3_CBC_SHA1) {
402                         printerr(2, "%s: overriding heimdal keytype (%d => %d)\n",
403                                  __FUNCTION__, enctype, 6);
404
405                         enctype = 6;
406                 }
407 #endif
408                 keysize = lctx->rfc1964_kd.ctx_key.length;
409                 numkeys = 3;    /* XXX is always gonna be three? */
410         } else {
411                 if (lctx->cfx_kd.have_acceptor_subkey) {
412                         enctype = lctx->cfx_kd.acceptor_subkey.type;
413                         keysize = lctx->cfx_kd.acceptor_subkey.length;
414                 } else {
415                         enctype = lctx->cfx_kd.ctx_key.type;
416                         keysize = lctx->cfx_kd.ctx_key.length;
417                 }
418                 numkeys = 3;
419         }
420         printerr(2, "%s: serializing %d keys with enctype %d and size %d\n",
421                  __FUNCTION__, numkeys, enctype, keysize);
422         if (WRITE_BYTES(&p, end, enctype)) goto out_err;
423         if (WRITE_BYTES(&p, end, keysize)) goto out_err;
424         if (WRITE_BYTES(&p, end, numkeys)) goto out_err;
425
426         if (lctx->protocol == 0) {
427                 /* derive and send down: Ke, Ki, and Kc */
428                 /* Ke */
429                 if (write_bytes(&p, end, lctx->rfc1964_kd.ctx_key.data,
430                                 lctx->rfc1964_kd.ctx_key.length))
431                         goto out_err;
432
433                 /* Ki */
434                 if (write_bytes(&p, end, lctx->rfc1964_kd.ctx_key.data,
435                                 lctx->rfc1964_kd.ctx_key.length))
436                         goto out_err;
437
438                 /* Kc */
439                 /*
440                  * RC4 is special, it dosen't need key derivation. Actually
441                  * the Ke is based on plain text. Here we just let all three
442                  * key identical, kernel will handle everything. --ericm
443                  */
444                 if (lctx->rfc1964_kd.ctx_key.type == ENCTYPE_ARCFOUR_HMAC) {
445                         if (write_bytes(&p, end, lctx->rfc1964_kd.ctx_key.data,
446                                         lctx->rfc1964_kd.ctx_key.length))
447                                 goto out_err;
448                 } else {
449                         if (derive_key_lucid(&lctx->rfc1964_kd.ctx_key,
450                                         &derived_key,
451                                         KG_USAGE_SIGN, KEY_USAGE_SEED_CHECKSUM))
452                                 goto out_err;
453                         if (write_bytes(&p, end, derived_key.data,
454                                         derived_key.length))
455                                 goto out_err;
456                         free(derived_key.data);
457                 }
458         } else {
459                 gss_krb5_lucid_key_t *keyptr;
460                 uint32_t sign_usage, seal_usage;
461
462                 if (lctx->cfx_kd.have_acceptor_subkey)
463                         keyptr = &lctx->cfx_kd.acceptor_subkey;
464                 else
465                         keyptr = &lctx->cfx_kd.ctx_key;
466
467 #if 0
468                 if (lctx->initiate == 1) {
469                         sign_usage = KG_USAGE_INITIATOR_SIGN;
470                         seal_usage = KG_USAGE_INITIATOR_SEAL;
471                 } else {
472                         sign_usage = KG_USAGE_ACCEPTOR_SIGN;
473                         seal_usage = KG_USAGE_ACCEPTOR_SEAL;
474                 }
475 #else
476                 /* FIXME
477                  * These are from rfc4142, but I don't understand: if we supply
478                  * different 'usage' value for client & server, then the peers
479                  * will have different derived keys. How could this work?
480                  *
481                  * Here we simply use old SIGN/SEAL values until we find the
482                  * answer.  --ericm
483                  * FIXME
484                  */
485                 sign_usage = KG_USAGE_SIGN;
486                 seal_usage = KG_USAGE_SEAL;
487 #endif
488
489                 /* derive and send down: Ke, Ki, and Kc */
490
491                 /* Ke */
492                 if (derive_key_lucid(keyptr, &derived_key,
493                                seal_usage, KEY_USAGE_SEED_ENCRYPTION))
494                         goto out_err;
495                 if (write_bytes(&p, end, derived_key.data,
496                                 derived_key.length))
497                         goto out_err;
498                 free(derived_key.data);
499
500                 /* Ki */
501                 if (derive_key_lucid(keyptr, &derived_key,
502                                seal_usage, KEY_USAGE_SEED_INTEGRITY))
503                         goto out_err;
504                 if (write_bytes(&p, end, derived_key.data,
505                                 derived_key.length))
506                         goto out_err;
507                 free(derived_key.data);
508
509                 /* Kc */
510                 if (derive_key_lucid(keyptr, &derived_key,
511                                sign_usage, KEY_USAGE_SEED_CHECKSUM))
512                         goto out_err;
513                 if (write_bytes(&p, end, derived_key.data,
514                                 derived_key.length))
515                         goto out_err;
516                 free(derived_key.data);
517         }
518
519         buf->length = p - (char *)buf->value;
520         return 0;
521
522 out_err:
523         printerr(0, "ERROR: %s: failed serializing krb5 context for kernel\n",
524                  __FUNCTION__);
525         if (buf->value) {
526                 free(buf->value);
527                 buf->value = NULL;
528         }
529         buf->length = 0;
530         if (enc_key.data) {
531                 free(enc_key.data);
532                 enc_key.data = NULL;
533         }
534         return -1;
535 }
536 int
537 serialize_krb5_ctx(gss_ctx_id_t ctx, gss_buffer_desc *buf)
538 {
539         OM_uint32 maj_stat, min_stat;
540         void *return_ctx = 0;
541         OM_uint32 vers;
542         gss_krb5_lucid_context_v1_t *lctx = 0;
543         int retcode = 0;
544
545         printerr(2, "DEBUG: %s: lucid version!\n", __FUNCTION__);
546         maj_stat = gss_export_lucid_sec_context(&min_stat, &ctx,
547                                                 1, &return_ctx);
548         if (maj_stat != GSS_S_COMPLETE) {
549                 pgsserr("gss_export_lucid_sec_context",
550                         maj_stat, min_stat, &krb5oid);
551                 goto out_err;
552         }
553
554         /* Check the version returned, we only support v1 right now */
555         vers = ((gss_krb5_lucid_context_version_t *)return_ctx)->version;
556         switch (vers) {
557         case 1:
558                 lctx = (gss_krb5_lucid_context_v1_t *) return_ctx;
559                 break;
560         default:
561                 printerr(0, "ERROR: unsupported lucid sec context version %d\n",
562                         vers);
563                 goto out_err;
564                 break;
565         }
566
567         /*
568          * Now lctx points to a lucid context that we can send down to kernel
569          *
570          * Note: we send down different information to the kernel depending
571          * on the protocol version and the enctyption type.
572          * For protocol version 0 with all enctypes besides DES3, we use
573          * the original format.  For protocol version != 0 or DES3, we
574          * send down the new style information.
575          */
576
577         if (lctx->protocol == 0 && lctx->rfc1964_kd.ctx_key.type <= 4)
578                 retcode = prepare_krb5_rfc1964_buffer(lctx, buf);
579         else
580                 retcode = prepare_krb5_rfc4121_buffer(lctx, buf);
581
582         maj_stat = gss_free_lucid_sec_context(&min_stat, ctx, return_ctx);
583         if (maj_stat != GSS_S_COMPLETE) {
584                 pgsserr("gss_export_lucid_sec_context",
585                         maj_stat, min_stat, &krb5oid);
586                 printerr(0, "WARN: failed to free lucid sec context\n");
587         }
588
589         if (retcode) {
590                 printerr(1, "%s: prepare_krb5_*_buffer failed (retcode = %d)\n",
591                          __FUNCTION__, retcode);
592                 goto out_err;
593         }
594
595         return 0;
596
597 out_err:
598         printerr(0, "ERROR: failed serializing krb5 context for kernel\n");
599         return -1;
600 }
601
602
603
604 #endif /* HAVE_LUCID_CONTEXT_SUPPORT */