Attribution for various contributors.
[tinc] / src / protocol_auth.c
1 /*
2     protocol_auth.c -- handle the meta-protocol, authentication
3     Copyright (C) 1999-2005 Ivo Timmermans,
4                   2000-2014 Guus Sliepen <guus@tinc-vpn.org>
5
6     This program is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     This program is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License along
17     with this program; if not, write to the Free Software Foundation, Inc.,
18     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21 #include "system.h"
22
23 #include <openssl/sha.h>
24 #include <openssl/rand.h>
25 #include <openssl/err.h>
26 #include <openssl/evp.h>
27
28 #include "avl_tree.h"
29 #include "conf.h"
30 #include "connection.h"
31 #include "edge.h"
32 #include "graph.h"
33 #include "logger.h"
34 #include "meta.h"
35 #include "net.h"
36 #include "netutl.h"
37 #include "node.h"
38 #include "protocol.h"
39 #include "utils.h"
40 #include "xalloc.h"
41
42 static bool send_proxyrequest(connection_t *c) {
43         switch(proxytype) {
44                 case PROXY_HTTP: {
45                         char *host;
46                         char *port;
47
48                         sockaddr2str(&c->address, &host, &port);
49                         send_request(c, "CONNECT %s:%s HTTP/1.1\r\n\r", host, port);
50                         free(host);
51                         free(port);
52                         return true;
53                 }
54                 case PROXY_SOCKS4: {
55                         if(c->address.sa.sa_family != AF_INET) {
56                                 logger(LOG_ERR, "Cannot connect to an IPv6 host through a SOCKS 4 proxy!");
57                                 return false;
58                         }
59                         char s4req[9 + (proxyuser ? strlen(proxyuser) : 0)];
60                         s4req[0] = 4;
61                         s4req[1] = 1;
62                         memcpy(s4req + 2, &c->address.in.sin_port, 2);
63                         memcpy(s4req + 4, &c->address.in.sin_addr, 4);
64                         if(proxyuser)
65                                 strcpy(s4req + 8, proxyuser);
66                         s4req[sizeof s4req - 1] = 0;
67                         c->tcplen = 8;
68                         return send_meta(c, s4req, sizeof s4req);
69                 }
70                 case PROXY_SOCKS5: {
71                         int len = 3 + 6 + (c->address.sa.sa_family == AF_INET ? 4 : 16);
72                         c->tcplen = 2;
73                         if(proxypass)
74                                 len += 3 + strlen(proxyuser) + strlen(proxypass);
75                         char s5req[len];
76                         int i = 0;
77                         s5req[i++] = 5;
78                         s5req[i++] = 1;
79                         if(proxypass) {
80                                 s5req[i++] = 2;
81                                 s5req[i++] = 1;
82                                 s5req[i++] = strlen(proxyuser);
83                                 strcpy(s5req + i, proxyuser);
84                                 i += strlen(proxyuser);
85                                 s5req[i++] = strlen(proxypass);
86                                 strcpy(s5req + i, proxypass);
87                                 i += strlen(proxypass);
88                                 c->tcplen += 2;
89                         } else {
90                                 s5req[i++] = 0;
91                         }
92                         s5req[i++] = 5;
93                         s5req[i++] = 1;
94                         s5req[i++] = 0;
95                         if(c->address.sa.sa_family == AF_INET) {
96                                 s5req[i++] = 1;
97                                 memcpy(s5req + i, &c->address.in.sin_addr, 4);
98                                 i += 4;
99                                 memcpy(s5req + i, &c->address.in.sin_port, 2);
100                                 i += 2;
101                                 c->tcplen += 10;
102                         } else if(c->address.sa.sa_family == AF_INET6) {
103                                 s5req[i++] = 3;
104                                 memcpy(s5req + i, &c->address.in6.sin6_addr, 16);
105                                 i += 16;
106                                 memcpy(s5req + i, &c->address.in6.sin6_port, 2);
107                                 i += 2;
108                                 c->tcplen += 22;
109                         } else {
110                                 logger(LOG_ERR, "Address family %x not supported for SOCKS 5 proxies!", c->address.sa.sa_family);
111                                 return false;
112                         }
113                         if(i > len)
114                                 abort();
115                         return send_meta(c, s5req, sizeof s5req);
116                 }
117                 case PROXY_SOCKS4A:
118                         logger(LOG_ERR, "Proxy type not implemented yet");
119                         return false;
120                 case PROXY_EXEC:
121                         return true;
122                 default:
123                         logger(LOG_ERR, "Unknown proxy type");
124                         return false;
125         }
126 }
127
128 bool send_id(connection_t *c) {
129         if(proxytype && c->outgoing)
130                 if(!send_proxyrequest(c))
131                         return false;
132
133         return send_request(c, "%d %s %d", ID, myself->connection->name,
134                                                 myself->connection->protocol_version);
135 }
136
137 bool id_h(connection_t *c) {
138         char name[MAX_STRING_SIZE];
139
140         if(sscanf(c->buffer, "%*d " MAX_STRING " %d", name, &c->protocol_version) != 2) {
141                 logger(LOG_ERR, "Got bad %s from %s (%s)", "ID", c->name,
142                            c->hostname);
143                 return false;
144         }
145
146         /* Check if identity is a valid name */
147
148         if(!check_id(name)) {
149                 logger(LOG_ERR, "Got bad %s from %s (%s): %s", "ID", c->name,
150                            c->hostname, "invalid name");
151                 return false;
152         }
153
154         /* If this is an outgoing connection, make sure we are connected to the right host */
155
156         if(c->outgoing) {
157                 if(strcmp(c->name, name)) {
158                         logger(LOG_ERR, "Peer %s is %s instead of %s", c->hostname, name,
159                                    c->name);
160                         return false;
161                 }
162         } else {
163                 if(c->name)
164                         free(c->name);
165                 c->name = xstrdup(name);
166         }
167
168         /* Check if version matches */
169
170         if(c->protocol_version != myself->connection->protocol_version) {
171                 logger(LOG_ERR, "Peer %s (%s) uses incompatible version %d",
172                            c->name, c->hostname, c->protocol_version);
173                 return false;
174         }
175
176         if(bypass_security) {
177                 if(!c->config_tree)
178                         init_configuration(&c->config_tree);
179                 c->allow_request = ACK;
180                 return send_ack(c);
181         }
182
183         if(!c->config_tree) {
184                 init_configuration(&c->config_tree);
185
186                 if(!read_connection_config(c)) {
187                         logger(LOG_ERR, "Peer %s had unknown identity (%s)", c->hostname,
188                                    c->name);
189                         return false;
190                 }
191         }
192
193         if(!read_rsa_public_key(c)) {
194                 return false;
195         }
196
197         c->allow_request = METAKEY;
198
199         return send_metakey(c);
200 }
201
202 bool send_metakey(connection_t *c) {
203         bool x;
204
205         int len = RSA_size(c->rsa_key);
206
207         /* Allocate buffers for the meta key */
208
209         char buffer[2 * len + 1];
210         
211         c->outkey = xrealloc(c->outkey, len);
212
213         if(!c->outctx)
214                 c->outctx = xmalloc_and_zero(sizeof(*c->outctx));
215
216         /* Copy random data to the buffer */
217
218         if (1 != RAND_bytes((unsigned char *)c->outkey, len)) {
219                 int err = ERR_get_error();
220                 logger(LOG_ERR, "Failed to generate meta key (%s)", ERR_error_string(err, NULL));
221                 return false;
222         }
223
224
225         /* The message we send must be smaller than the modulus of the RSA key.
226            By definition, for a key of k bits, the following formula holds:
227
228            2^(k-1) <= modulus < 2^(k)
229
230            Where ^ means "to the power of", not "xor".
231            This means that to be sure, we must choose our message < 2^(k-1).
232            This can be done by setting the most significant bit to zero.
233          */
234
235         c->outkey[0] &= 0x7F;
236
237         ifdebug(SCARY_THINGS) {
238                 bin2hex(c->outkey, buffer, len);
239                 buffer[len * 2] = '\0';
240                 logger(LOG_DEBUG, "Generated random meta key (unencrypted): %s",
241                            buffer);
242         }
243
244         /* Encrypt the random data
245
246            We do not use one of the PKCS padding schemes here.
247            This is allowed, because we encrypt a totally random string
248            with a length equal to that of the modulus of the RSA key.
249          */
250
251         if(RSA_public_encrypt(len, (unsigned char *)c->outkey, (unsigned char *)buffer, c->rsa_key, RSA_NO_PADDING) != len) {
252                 logger(LOG_ERR, "Error during encryption of meta key for %s (%s): %s",
253                            c->name, c->hostname, ERR_error_string(ERR_get_error(), NULL));
254                 return false;
255         }
256
257         /* Convert the encrypted random data to a hexadecimal formatted string */
258
259         bin2hex(buffer, buffer, len);
260         buffer[len * 2] = '\0';
261
262         /* Send the meta key */
263
264         x = send_request(c, "%d %d %d %d %d %s", METAKEY,
265                                          c->outcipher ? c->outcipher->nid : 0,
266                                          c->outdigest ? c->outdigest->type : 0, c->outmaclength,
267                                          c->outcompression, buffer);
268
269         /* Further outgoing requests are encrypted with the key we just generated */
270
271         if(c->outcipher) {
272                 if(!EVP_EncryptInit(c->outctx, c->outcipher,
273                                         (unsigned char *)c->outkey + len - c->outcipher->key_len,
274                                         (unsigned char *)c->outkey + len - c->outcipher->key_len -
275                                         c->outcipher->iv_len)) {
276                         logger(LOG_ERR, "Error during initialisation of cipher for %s (%s): %s",
277                                         c->name, c->hostname, ERR_error_string(ERR_get_error(), NULL));
278                         return false;
279                 }
280
281                 c->status.encryptout = true;
282         }
283
284         return x;
285 }
286
287 bool metakey_h(connection_t *c) {
288         char buffer[MAX_STRING_SIZE];
289         int cipher, digest, maclength, compression;
290         int len;
291
292         if(sscanf(c->buffer, "%*d %d %d %d %d " MAX_STRING, &cipher, &digest, &maclength, &compression, buffer) != 5) {
293                 logger(LOG_ERR, "Got bad %s from %s (%s)", "METAKEY", c->name,
294                            c->hostname);
295                 return false;
296         }
297
298         len = RSA_size(myself->connection->rsa_key);
299
300         /* Check if the length of the meta key is all right */
301
302         if(strlen(buffer) != len * 2) {
303                 logger(LOG_ERR, "Possible intruder %s (%s): %s", c->name, c->hostname, "wrong keylength");
304                 return false;
305         }
306
307         /* Allocate buffers for the meta key */
308
309         c->inkey = xrealloc(c->inkey, len);
310
311         if(!c->inctx)
312                 c->inctx = xmalloc_and_zero(sizeof(*c->inctx));
313
314         /* Convert the challenge from hexadecimal back to binary */
315
316         if(!hex2bin(buffer, buffer, len)) {
317                 logger(LOG_ERR, "Got bad %s from %s(%s): %s", "METAKEY", c->name, c->hostname, "invalid key");
318                 return false;
319         }
320
321         /* Decrypt the meta key */
322
323         if(RSA_private_decrypt(len, (unsigned char *)buffer, (unsigned char *)c->inkey, myself->connection->rsa_key, RSA_NO_PADDING) != len) {  /* See challenge() */
324                 logger(LOG_ERR, "Error during decryption of meta key for %s (%s): %s",
325                            c->name, c->hostname, ERR_error_string(ERR_get_error(), NULL));
326                 return false;
327         }
328
329         ifdebug(SCARY_THINGS) {
330                 bin2hex(c->inkey, buffer, len);
331                 buffer[len * 2] = '\0';
332                 logger(LOG_DEBUG, "Received random meta key (unencrypted): %s", buffer);
333         }
334
335         /* All incoming requests will now be encrypted. */
336
337         /* Check and lookup cipher and digest algorithms */
338
339         if(cipher) {
340                 c->incipher = EVP_get_cipherbynid(cipher);
341                 
342                 if(!c->incipher) {
343                         logger(LOG_ERR, "%s (%s) uses unknown cipher!", c->name, c->hostname);
344                         return false;
345                 }
346
347                 if(!EVP_DecryptInit(c->inctx, c->incipher,
348                                         (unsigned char *)c->inkey + len - c->incipher->key_len,
349                                         (unsigned char *)c->inkey + len - c->incipher->key_len -
350                                         c->incipher->iv_len)) {
351                         logger(LOG_ERR, "Error during initialisation of cipher from %s (%s): %s",
352                                         c->name, c->hostname, ERR_error_string(ERR_get_error(), NULL));
353                         return false;
354                 }
355
356                 c->status.decryptin = true;
357         } else {
358                 c->incipher = NULL;
359         }
360
361         c->inmaclength = maclength;
362
363         if(digest) {
364                 c->indigest = EVP_get_digestbynid(digest);
365
366                 if(!c->indigest) {
367                         logger(LOG_ERR, "Node %s (%s) uses unknown digest!", c->name, c->hostname);
368                         return false;
369                 }
370
371                 if(c->inmaclength > c->indigest->md_size || c->inmaclength < 0) {
372                         logger(LOG_ERR, "%s (%s) uses bogus MAC length!", c->name, c->hostname);
373                         return false;
374                 }
375         } else {
376                 c->indigest = NULL;
377         }
378
379         c->incompression = compression;
380
381         c->allow_request = CHALLENGE;
382
383         return send_challenge(c);
384 }
385
386 bool send_challenge(connection_t *c) {
387         /* CHECKME: what is most reasonable value for len? */
388
389         int len = RSA_size(c->rsa_key);
390
391         /* Allocate buffers for the challenge */
392
393         char buffer[2 * len + 1];
394
395         c->hischallenge = xrealloc(c->hischallenge, len);
396
397         /* Copy random data to the buffer */
398
399         if (1 != RAND_bytes((unsigned char *)c->hischallenge, len)) {
400                 int err = ERR_get_error();
401                 logger(LOG_ERR, "Failed to generate challenge (%s)", ERR_error_string(err, NULL));
402                 return false; // Do not send predictable challenges, let connection attempt fail.
403         }
404
405         /* Convert to hex */
406
407         bin2hex(c->hischallenge, buffer, len);
408         buffer[len * 2] = '\0';
409
410         /* Send the challenge */
411
412         return send_request(c, "%d %s", CHALLENGE, buffer);
413 }
414
415 bool challenge_h(connection_t *c) {
416         char buffer[MAX_STRING_SIZE];
417         int len;
418
419         if(sscanf(c->buffer, "%*d " MAX_STRING, buffer) != 1) {
420                 logger(LOG_ERR, "Got bad %s from %s (%s)", "CHALLENGE", c->name,
421                            c->hostname);
422                 return false;
423         }
424
425         len = RSA_size(myself->connection->rsa_key);
426
427         /* Check if the length of the challenge is all right */
428
429         if(strlen(buffer) != len * 2) {
430                 logger(LOG_ERR, "Possible intruder %s (%s): %s", c->name,
431                            c->hostname, "wrong challenge length");
432                 return false;
433         }
434
435         /* Allocate buffers for the challenge */
436
437         c->mychallenge = xrealloc(c->mychallenge, len);
438
439         /* Convert the challenge from hexadecimal back to binary */
440
441         if(!hex2bin(buffer, c->mychallenge, len)) {
442                 logger(LOG_ERR, "Got bad %s from %s(%s): %s", "CHALLENGE", c->name, c->hostname, "invalid challenge");
443                 return false;
444         }
445
446         c->allow_request = CHAL_REPLY;
447
448         /* Rest is done by send_chal_reply() */
449
450         return send_chal_reply(c);
451 }
452
453 bool send_chal_reply(connection_t *c) {
454         char hash[EVP_MAX_MD_SIZE * 2 + 1];
455         EVP_MD_CTX ctx;
456
457         /* Calculate the hash from the challenge we received */
458
459         if(!EVP_DigestInit(&ctx, c->indigest)
460                         || !EVP_DigestUpdate(&ctx, c->mychallenge, RSA_size(myself->connection->rsa_key))
461                         || !EVP_DigestFinal(&ctx, (unsigned char *)hash, NULL)) {
462                 logger(LOG_ERR, "Error during calculation of response for %s (%s): %s",
463                         c->name, c->hostname, ERR_error_string(ERR_get_error(), NULL));
464                 return false;
465         }
466
467         /* Convert the hash to a hexadecimal formatted string */
468
469         bin2hex(hash, hash, c->indigest->md_size);
470         hash[c->indigest->md_size * 2] = '\0';
471
472         /* Send the reply */
473
474         return send_request(c, "%d %s", CHAL_REPLY, hash);
475 }
476
477 bool chal_reply_h(connection_t *c) {
478         char hishash[MAX_STRING_SIZE];
479         char myhash[EVP_MAX_MD_SIZE];
480         EVP_MD_CTX ctx;
481
482         if(sscanf(c->buffer, "%*d " MAX_STRING, hishash) != 1) {
483                 logger(LOG_ERR, "Got bad %s from %s (%s)", "CHAL_REPLY", c->name,
484                            c->hostname);
485                 return false;
486         }
487
488         /* Check if the length of the hash is all right */
489
490         if(strlen(hishash) != c->outdigest->md_size * 2) {
491                 logger(LOG_ERR, "Possible intruder %s (%s): %s", c->name,
492                            c->hostname, "wrong challenge reply length");
493                 return false;
494         }
495
496         /* Convert the hash to binary format */
497
498         if(!hex2bin(hishash, hishash, c->outdigest->md_size)) {
499                 logger(LOG_ERR, "Got bad %s from %s(%s): %s", "CHAL_REPLY", c->name, c->hostname, "invalid hash");
500                 return false;
501         }
502
503         /* Calculate the hash from the challenge we sent */
504
505         if(!EVP_DigestInit(&ctx, c->outdigest)
506                         || !EVP_DigestUpdate(&ctx, c->hischallenge, RSA_size(c->rsa_key))
507                         || !EVP_DigestFinal(&ctx, (unsigned char *)myhash, NULL)) {
508                 logger(LOG_ERR, "Error during calculation of response from %s (%s): %s",
509                         c->name, c->hostname, ERR_error_string(ERR_get_error(), NULL));
510                 return false;
511         }
512
513         /* Verify the incoming hash with the calculated hash */
514
515         if(memcmp(hishash, myhash, c->outdigest->md_size)) {
516                 logger(LOG_ERR, "Possible intruder %s (%s): %s", c->name,
517                            c->hostname, "wrong challenge reply");
518
519                 ifdebug(SCARY_THINGS) {
520                         bin2hex(myhash, hishash, SHA_DIGEST_LENGTH);
521                         hishash[SHA_DIGEST_LENGTH * 2] = '\0';
522                         logger(LOG_DEBUG, "Expected challenge reply: %s", hishash);
523                 }
524
525                 return false;
526         }
527
528         /* Identity has now been positively verified.
529            Send an acknowledgement with the rest of the information needed.
530          */
531
532         c->allow_request = ACK;
533
534         return send_ack(c);
535 }
536
537 bool send_ack(connection_t *c) {
538         /* ACK message contains rest of the information the other end needs
539            to create node_t and edge_t structures. */
540
541         struct timeval now;
542         bool choice;
543
544         /* Estimate weight */
545
546         gettimeofday(&now, NULL);
547         c->estimated_weight = (now.tv_sec - c->start.tv_sec) * 1000 + (now.tv_usec - c->start.tv_usec) / 1000;
548
549         /* Check some options */
550
551         if((get_config_bool(lookup_config(c->config_tree, "IndirectData"), &choice) && choice) || myself->options & OPTION_INDIRECT)
552                 c->options |= OPTION_INDIRECT;
553
554         if((get_config_bool(lookup_config(c->config_tree, "TCPOnly"), &choice) && choice) || myself->options & OPTION_TCPONLY)
555                 c->options |= OPTION_TCPONLY | OPTION_INDIRECT;
556
557         if(myself->options & OPTION_PMTU_DISCOVERY)
558                 c->options |= OPTION_PMTU_DISCOVERY;
559
560         choice = myself->options & OPTION_CLAMP_MSS;
561         get_config_bool(lookup_config(c->config_tree, "ClampMSS"), &choice);
562         if(choice)
563                 c->options |= OPTION_CLAMP_MSS;
564
565         get_config_int(lookup_config(c->config_tree, "Weight"), &c->estimated_weight);
566
567         return send_request(c, "%d %s %d %x", ACK, myport, c->estimated_weight, c->options);
568 }
569
570 static void send_everything(connection_t *c) {
571         avl_node_t *node, *node2;
572         node_t *n;
573         subnet_t *s;
574         edge_t *e;
575
576         /* Send all known subnets and edges */
577
578         if(tunnelserver) {
579                 for(node = myself->subnet_tree->head; node; node = node->next) {
580                         s = node->data;
581                         send_add_subnet(c, s);
582                 }
583
584                 return;
585         }
586
587         for(node = node_tree->head; node; node = node->next) {
588                 n = node->data;
589
590                 for(node2 = n->subnet_tree->head; node2; node2 = node2->next) {
591                         s = node2->data;
592                         send_add_subnet(c, s);
593                 }
594
595                 for(node2 = n->edge_tree->head; node2; node2 = node2->next) {
596                         e = node2->data;
597                         send_add_edge(c, e);
598                 }
599         }
600 }
601
602 bool ack_h(connection_t *c) {
603         char hisport[MAX_STRING_SIZE];
604         char *hisaddress;
605         int weight, mtu;
606         uint32_t options;
607         node_t *n;
608         bool choice;
609
610         if(sscanf(c->buffer, "%*d " MAX_STRING " %d %x", hisport, &weight, &options) != 3) {
611                 logger(LOG_ERR, "Got bad %s from %s (%s)", "ACK", c->name,
612                            c->hostname);
613                 return false;
614         }
615
616         /* Check if we already have a node_t for him */
617
618         n = lookup_node(c->name);
619
620         if(!n) {
621                 n = new_node();
622                 n->name = xstrdup(c->name);
623                 node_add(n);
624         } else {
625                 if(n->connection) {
626                         /* Oh dear, we already have a connection to this node. */
627                         ifdebug(CONNECTIONS) logger(LOG_DEBUG, "Established a second connection with %s (%s), closing old connection",
628                                            n->name, n->hostname);
629                         terminate_connection(n->connection, false);
630                         /* Run graph algorithm to purge key and make sure up/down scripts are rerun with new IP addresses and stuff */
631                         graph();
632                 }
633         }
634
635         n->connection = c;
636         c->node = n;
637         if(!(c->options & options & OPTION_PMTU_DISCOVERY)) {
638                 c->options &= ~OPTION_PMTU_DISCOVERY;
639                 options &= ~OPTION_PMTU_DISCOVERY;
640         }
641         c->options |= options;
642
643         if(get_config_int(lookup_config(c->config_tree, "PMTU"), &mtu) && mtu < n->mtu)
644                 n->mtu = mtu;
645
646         if(get_config_int(lookup_config(config_tree, "PMTU"), &mtu) && mtu < n->mtu)
647                 n->mtu = mtu;
648
649         if(get_config_bool(lookup_config(c->config_tree, "ClampMSS"), &choice)) {
650                 if(choice)
651                         c->options |= OPTION_CLAMP_MSS;
652                 else
653                         c->options &= ~OPTION_CLAMP_MSS;
654         }
655
656         /* Activate this connection */
657
658         c->allow_request = ALL;
659         c->status.active = true;
660
661         ifdebug(CONNECTIONS) logger(LOG_NOTICE, "Connection with %s (%s) activated", c->name,
662                            c->hostname);
663
664         /* Send him everything we know */
665
666         send_everything(c);
667
668         /* Create an edge_t for this connection */
669
670         c->edge = new_edge();
671         c->edge->from = myself;
672         c->edge->to = n;
673         sockaddr2str(&c->address, &hisaddress, NULL);
674         c->edge->address = str2sockaddr(hisaddress, hisport);
675         free(hisaddress);
676         c->edge->weight = (weight + c->estimated_weight) / 2;
677         c->edge->connection = c;
678         c->edge->options = c->options;
679
680         edge_add(c->edge);
681
682         /* Notify everyone of the new edge */
683
684         if(tunnelserver)
685                 send_add_edge(c, c->edge);
686         else
687                 send_add_edge(everyone, c->edge);
688
689         /* Run MST and SSSP algorithms */
690
691         graph();
692
693         return true;
694 }