- Code documented
[strongswan.git] / Source / charon / config / configuration_manager.c
1 /**
2 * @file configuration.c
3 *
4 * @brief Configuration class used to store IKE_SA-configurations.
5 *
6 * Object of this type represents the configuration for all IKE_SA's and their child_sa's.
7 *
8 */
9
10 /*
11 * Copyright (C) 2005 Jan Hutter, Martin Willi
12 * Hochschule fuer Technik Rapperswil
13 *
14 * This program is free software; you can redistribute it and/or modify it
15 * under the terms of the GNU General Public License as published by the
16 * Free Software Foundation; either version 2 of the License, or (at your
17 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
18 *
19 * This program is distributed in the hope that it will be useful, but
20 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 * for more details.
23 */
24
25 #include <stdlib.h>
26
27 #include "configuration_manager.h"
28
29 #include <types.h>
30 #include <daemon.h>
31 #include <utils/allocator.h>
32
33
34 typedef struct preshared_secret_entry_t preshared_secret_entry_t;
35
36 /**
37 * An preshared secret entry combines an identifier with a
38 * preshared secret.
39 */
40 struct preshared_secret_entry_t {
41
42 /**
43 * Identification.
44 */
45 identification_t *identification;
46
47 /**
48 * Preshared secret as chunk
49 */
50 chunk_t preshared_secret;
51 };
52
53
54 typedef struct rsa_private_key_entry_t rsa_private_key_entry_t;
55
56 /**
57 * Entry for a rsa private key.
58 */
59 struct rsa_private_key_entry_t {
60
61 /**
62 * Identification.
63 */
64 identification_t *identification;
65
66 /**
67 * private key
68 */
69 rsa_private_key_t* private_key;
70 };
71
72 typedef struct rsa_public_key_entry_t rsa_public_key_entry_t;
73
74 /**
75 * Entry for a rsa private key.
76 */
77 struct rsa_public_key_entry_t {
78
79 /**
80 * Identification.
81 */
82 identification_t *identification;
83
84 /**
85 * private key
86 */
87 rsa_public_key_t* public_key;
88 };
89
90 typedef struct configuration_entry_t configuration_entry_t;
91
92 /* A configuration entry combines a configuration name with a init and sa
93 * configuration represented as init_config_t and sa_config_t objects.
94 */
95 struct configuration_entry_t {
96
97 /**
98 * Configuration name.
99 *
100 */
101 char *name;
102
103 /**
104 * Configuration for IKE_SA_INIT exchange.
105 */
106 init_config_t *init_config;
107
108 /**
109 * Configuration for all phases after IKE_SA_INIT exchange.
110 */
111 sa_config_t *sa_config;
112
113 /**
114 * Destroys a configuration_entry_t
115 *
116 *
117 * @param this calling object
118 */
119 void (*destroy) (configuration_entry_t *this);
120 };
121
122 static void configuration_entry_destroy (configuration_entry_t *this)
123 {
124 allocator_free(this->name);
125 allocator_free(this);
126 }
127
128 /**
129 * Creates a configuration_entry_t object
130 *
131 * @param name name of the configuration entry (gets copied)
132 * @param init_config object of type init_config_t
133 * @param sa_config object of type sa_config_t
134 */
135 configuration_entry_t * configuration_entry_create(char * name, init_config_t * init_config, sa_config_t * sa_config)
136 {
137 configuration_entry_t *entry = allocator_alloc_thing(configuration_entry_t);
138
139 /* functions */
140 entry->destroy = configuration_entry_destroy;
141
142 /* private data */
143 entry->init_config = init_config;
144 entry->sa_config = sa_config;
145 entry->name = allocator_alloc(strlen(name) + 1);
146 strcpy(entry->name,name);
147 return entry;
148 }
149
150
151 typedef struct private_configuration_manager_t private_configuration_manager_t;
152
153 /**
154 * Private data of an configuration_t object
155 */
156 struct private_configuration_manager_t {
157
158 /**
159 * Public part of configuration manager.
160 */
161 configuration_manager_t public;
162
163 /**
164 * Holding all configurations.
165 */
166 linked_list_t *configurations;
167
168 /**
169 * Holding all init_configs.
170 */
171 linked_list_t *init_configs;
172
173 /**
174 * Holding all init_configs.
175 */
176 linked_list_t *sa_configs;
177
178 /**
179 * Holding all preshared secrets.
180 */
181 linked_list_t *preshared_secrets;
182
183 /**
184 * Holding all private secrets.
185 */
186 linked_list_t *rsa_private_keys;
187
188 /**
189 * Holding all public secrets.
190 */
191 linked_list_t *rsa_public_keys;
192
193 /**
194 * Assigned logger object.
195 */
196 logger_t *logger;
197
198
199 /**
200 * Max number of retransmitted requests.
201 */
202 u_int32_t max_retransmit_count;
203
204 /**
205 * First retransmit timeout in ms.
206 */
207 u_int32_t first_retransmit_timeout;
208
209 /**
210 * Adds a new IKE_SA configuration
211 *
212 *
213 * @param this calling object
214 * @param name name for the configuration
215 * @param init_config init_config_t object
216 * @param sa_config sa_config_t object
217 */
218 void (*add_new_configuration) (private_configuration_manager_t *this, char *name, init_config_t *init_config, sa_config_t *sa_config);
219
220 /**
221 * Adds a new IKE_SA configuration
222 *
223 *
224 * @param this calling object
225 * @param type type of identification
226 * @param id_string identification as string
227 * @param preshared_secret preshared secret as string
228 */
229 void (*add_new_preshared_secret) (private_configuration_manager_t *this,id_type_t type, char *id_string, char *preshared_secret);
230
231 /**
232 * Adds a new IKE_SA configuration
233 *
234 *
235 * @param this calling object
236 * @param type type of identification
237 * @param id_string identification as string
238 * @param preshared_secret preshared secret as string
239 */
240 void (*add_new_rsa_private_key) (private_configuration_manager_t *this,id_type_t type, char *id_string, u_int8_t *key_pos, size_t key_len);
241
242 /**
243 * Adds a new IKE_SA configuration
244 *
245 *
246 * @param this calling object
247 * @param type type of identification
248 * @param id_string identification as string
249 * @param preshared_secret preshared secret as string
250 */
251 void (*add_new_rsa_public_key) (private_configuration_manager_t *this,id_type_t type, char *id_string, u_int8_t *key_pos, size_t key_len);
252
253 /**
254 * Load default configuration
255 *
256 *
257 * @param this calling object
258 */
259 void (*load_default_config) (private_configuration_manager_t *this);
260 };
261
262 u_int8_t public_key_1[];
263 u_int8_t private_key_1[];
264 u_int8_t public_key_2[];
265 u_int8_t private_key_2[];
266
267 /**
268 * Implementation of private_configuration_manager_t.load_default_config.
269 */
270 static void load_default_config (private_configuration_manager_t *this)
271 {
272 init_config_t *init_config1, *init_config2, *init_config3;
273 ike_proposal_t proposals[2];
274 child_proposal_t child_proposals[1];
275 sa_config_t *sa_config1, *sa_config2, *sa_config3;
276 traffic_selector_t *ts;
277
278 init_config1 = init_config_create("0.0.0.0","152.96.193.131",IKEV2_UDP_PORT,IKEV2_UDP_PORT);
279 init_config2 = init_config_create("0.0.0.0","152.96.193.130",IKEV2_UDP_PORT,IKEV2_UDP_PORT);
280 init_config3 = init_config_create("0.0.0.0","127.0.0.1",IKEV2_UDP_PORT,IKEV2_UDP_PORT);
281 ts = traffic_selector_create_from_string(1, TS_IPV4_ADDR_RANGE, "0.0.0.0", 0, "255.255.255.255", 65535);
282
283
284 proposals[0].encryption_algorithm = ENCR_AES_CBC;
285 proposals[0].encryption_algorithm_key_length = 16;
286 proposals[0].integrity_algorithm = AUTH_HMAC_MD5_96;
287 proposals[0].integrity_algorithm_key_length = 16;
288 proposals[0].pseudo_random_function = PRF_HMAC_MD5;
289 proposals[0].pseudo_random_function_key_length = 16;
290 proposals[0].diffie_hellman_group = MODP_1024_BIT;
291
292 proposals[1] = proposals[0];
293 proposals[1].integrity_algorithm = AUTH_HMAC_SHA1_96;
294 proposals[1].integrity_algorithm_key_length = 20;
295 proposals[1].pseudo_random_function = PRF_HMAC_SHA1;
296 proposals[1].pseudo_random_function_key_length = 20;
297
298 init_config1->add_proposal(init_config1,1,proposals[0]);
299 init_config1->add_proposal(init_config1,1,proposals[1]);
300 init_config2->add_proposal(init_config2,1,proposals[0]);
301 init_config2->add_proposal(init_config2,1,proposals[1]);
302 init_config3->add_proposal(init_config3,1,proposals[0]);
303 init_config3->add_proposal(init_config3,1,proposals[1]);
304
305 sa_config1 = sa_config_create(ID_IPV4_ADDR, "152.96.193.130",
306 ID_IPV4_ADDR, "152.96.193.131",
307 SHARED_KEY_MESSAGE_INTEGRITY_CODE);
308
309 sa_config1->add_traffic_selector_initiator(sa_config1,ts);
310 sa_config1->add_traffic_selector_responder(sa_config1,ts);
311
312 sa_config2 = sa_config_create(ID_IPV4_ADDR, "152.96.193.131",
313 ID_IPV4_ADDR, "152.96.193.130",
314 SHARED_KEY_MESSAGE_INTEGRITY_CODE);
315
316 sa_config2->add_traffic_selector_initiator(sa_config2,ts);
317 sa_config2->add_traffic_selector_responder(sa_config2,ts);
318
319 sa_config3 = sa_config_create(ID_IPV4_ADDR, "127.0.0.1",
320 ID_IPV4_ADDR, "127.0.0.1",
321 RSA_DIGITAL_SIGNATURE);
322
323 sa_config3->add_traffic_selector_initiator(sa_config3,ts);
324 sa_config3->add_traffic_selector_responder(sa_config3,ts);
325
326 ts->destroy(ts);
327
328 /* ah and esp prop */
329 child_proposals[0].ah.is_set = TRUE;
330 child_proposals[0].ah.integrity_algorithm = AUTH_HMAC_MD5_96;
331 child_proposals[0].ah.integrity_algorithm_key_size = 16;
332 child_proposals[0].ah.diffie_hellman_group = MODP_1024_BIT;
333 child_proposals[0].ah.extended_sequence_numbers = NO_EXT_SEQ_NUMBERS;
334
335 child_proposals[0].esp.is_set = TRUE;
336 child_proposals[0].esp.diffie_hellman_group = MODP_1024_BIT;
337 child_proposals[0].esp.encryption_algorithm = ENCR_AES_CBC;
338 child_proposals[0].esp.encryption_algorithm_key_size = 16;
339 child_proposals[0].esp.integrity_algorithm = AUTH_UNDEFINED;
340 child_proposals[0].esp.extended_sequence_numbers = NO_EXT_SEQ_NUMBERS;
341 child_proposals[0].esp.spi[0] = 2;
342 child_proposals[0].esp.spi[1] = 2;
343 child_proposals[0].esp.spi[2] = 2;
344 child_proposals[0].esp.spi[3] = 2;
345
346 sa_config1->add_proposal(sa_config1, &child_proposals[0]);
347 sa_config2->add_proposal(sa_config2, &child_proposals[0]);
348 sa_config3->add_proposal(sa_config3, &child_proposals[0]);
349
350 this->add_new_configuration(this,"pinflb31",init_config1,sa_config1);
351 this->add_new_configuration(this,"pinflb30",init_config2,sa_config2);
352 this->add_new_configuration(this,"localhost",init_config3,sa_config3);
353
354 this->add_new_preshared_secret(this,ID_IPV4_ADDR, "152.96.193.130","das ist ein sicheres wort");
355 this->add_new_preshared_secret(this,ID_IPV4_ADDR, "152.96.193.131","das ist ein sicheres wort");
356 this->add_new_preshared_secret(this,ID_IPV4_ADDR, "127.0.0.1","das ist ein sicheres wort");
357
358 this->add_new_rsa_public_key(this,ID_IPV4_ADDR, "127.0.0.1", public_key_1, 256);
359 this->add_new_rsa_public_key(this,ID_IPV4_ADDR, "152.96.193.131", public_key_2, 256);
360 this->add_new_rsa_private_key(this,ID_IPV4_ADDR, "127.0.0.1", private_key_1, 1024);
361 this->add_new_rsa_private_key(this,ID_IPV4_ADDR, "152.96.193.131", private_key_2, 1024);
362 }
363
364 /**
365 * Implementation of configuration_manager_t.get_init_config_for_host.
366 */
367 static status_t get_init_config_for_host (private_configuration_manager_t *this, host_t *my_host, host_t *other_host,init_config_t **init_config)
368 {
369 iterator_t *iterator;
370 status_t status = NOT_FOUND;
371
372 iterator = this->configurations->create_iterator(this->configurations,TRUE);
373
374 this->logger->log(this->logger, CONTROL|MORE, "getting config for hosts %s - %s",
375 my_host->get_address(my_host), other_host->get_address(other_host));
376
377 while (iterator->has_next(iterator))
378 {
379 configuration_entry_t *entry;
380 host_t *config_my_host;
381 host_t *config_other_host;
382
383 iterator->current(iterator,(void **) &entry);
384
385 config_my_host = entry->init_config->get_my_host(entry->init_config);
386 config_other_host = entry->init_config->get_other_host(entry->init_config);
387
388 /* first check if ip is equal */
389 if(config_other_host->ip_is_equal(config_other_host,other_host))
390 {
391 this->logger->log(this->logger, CONTROL|MOST, "config entry with remote host %s",
392 config_other_host->get_address(config_other_host));
393 /* could be right one, check my_host for default route*/
394 if (config_my_host->is_default_route(config_my_host))
395 {
396 *init_config = entry->init_config;
397 status = SUCCESS;
398 break;
399 }
400 /* check now if host informations are the same */
401 else if (config_my_host->ip_is_equal(config_my_host,my_host))
402 {
403 *init_config = entry->init_config;
404 status = SUCCESS;
405 break;
406 }
407
408 }
409 /* Then check for wildcard hosts!
410 * TODO
411 * actually its only checked if other host with default route can be found! */
412 else if (config_other_host->is_default_route(config_other_host))
413 {
414 /* could be right one, check my_host for default route*/
415 if (config_my_host->is_default_route(config_my_host))
416 {
417 *init_config = entry->init_config;
418 status = SUCCESS;
419 break;
420 }
421 /* check now if host informations are the same */
422 else if (config_my_host->ip_is_equal(config_my_host,my_host))
423 {
424 *init_config = entry->init_config;
425 status = SUCCESS;
426 break;
427 }
428 }
429 }
430
431 iterator->destroy(iterator);
432
433 return status;
434 }
435
436 /**
437 * Implementation of configuration_manager_t.get_init_config_for_name.
438 */
439 static status_t get_init_config_for_name (private_configuration_manager_t *this, char *name, init_config_t **init_config)
440 {
441 iterator_t *iterator;
442 status_t status = NOT_FOUND;
443
444 iterator = this->configurations->create_iterator(this->configurations,TRUE);
445
446 while (iterator->has_next(iterator))
447 {
448 configuration_entry_t *entry;
449 iterator->current(iterator,(void **) &entry);
450
451 if (strcmp(entry->name,name) == 0)
452 {
453
454 /* found configuration */
455 *init_config = entry->init_config;
456 status = SUCCESS;
457 break;
458 }
459 }
460
461 iterator->destroy(iterator);
462
463 return status;
464 }
465
466 /**
467 * Implementation of configuration_manager_t.get_sa_config_for_name.
468 */
469 static status_t get_sa_config_for_name (private_configuration_manager_t *this, char *name, sa_config_t **sa_config)
470 {
471 iterator_t *iterator;
472 status_t status = NOT_FOUND;
473
474 iterator = this->configurations->create_iterator(this->configurations,TRUE);
475
476 while (iterator->has_next(iterator))
477 {
478 configuration_entry_t *entry;
479 iterator->current(iterator,(void **) &entry);
480
481 if (strcmp(entry->name,name) == 0)
482 {
483 /* found configuration */
484 *sa_config = entry->sa_config;
485 status = SUCCESS;
486 break;
487 }
488 }
489
490 iterator->destroy(iterator);
491
492 return status;
493 }
494
495 /**
496 * Implementation of configuration_manager_t.get_sa_config_for_init_config_and_id.
497 */
498 static status_t get_sa_config_for_init_config_and_id (private_configuration_manager_t *this, init_config_t *init_config, identification_t *other_id, identification_t *my_id,sa_config_t **sa_config)
499 {
500 iterator_t *iterator;
501 status_t status = NOT_FOUND;
502
503 iterator = this->configurations->create_iterator(this->configurations,TRUE);
504
505 while (iterator->has_next(iterator))
506 {
507 configuration_entry_t *entry;
508 iterator->current(iterator,(void **) &entry);
509
510 if (entry->init_config == init_config)
511 {
512 identification_t *config_my_id = entry->sa_config->get_my_id(entry->sa_config);
513 identification_t *config_other_id = entry->sa_config->get_other_id(entry->sa_config);
514
515 /* host informations seem to be the same */
516 if (config_other_id->equals(config_other_id,other_id))
517 {
518 /* other ids seems to match */
519
520 if (my_id == NULL)
521 {
522 /* first matching one is selected */
523
524 /* TODO priorize found entries */
525 *sa_config = entry->sa_config;
526 status = SUCCESS;
527 break;
528 }
529
530 if (config_my_id->equals(config_my_id,my_id))
531 {
532 *sa_config = entry->sa_config;
533 status = SUCCESS;
534 break;
535 }
536
537 }
538 }
539 }
540
541 iterator->destroy(iterator);
542
543 return status;
544 }
545
546 /**
547 * Implementation of private_configuration_manager_t.add_new_configuration.
548 */
549 static void add_new_configuration (private_configuration_manager_t *this, char *name, init_config_t *init_config, sa_config_t *sa_config)
550 {
551 iterator_t *iterator;
552 bool found;
553
554 iterator = this->init_configs->create_iterator(this->init_configs,TRUE);
555 found = FALSE;
556 while (iterator->has_next(iterator))
557 {
558 init_config_t *found_init_config;
559 iterator->current(iterator,(void **) &found_init_config);
560 if (init_config == found_init_config)
561 {
562 found = TRUE;
563 break;
564 }
565 }
566 iterator->destroy(iterator);
567 if (!found)
568 {
569 this->init_configs->insert_first(this->init_configs,init_config);
570 }
571
572 iterator = this->sa_configs->create_iterator(this->sa_configs,TRUE);
573 found = FALSE;
574 while (iterator->has_next(iterator))
575 {
576 sa_config_t *found_sa_config;
577 iterator->current(iterator,(void **) &found_sa_config);
578 if (sa_config == found_sa_config)
579 {
580 found = TRUE;
581 break;
582 }
583 }
584 iterator->destroy(iterator);
585 if (!found)
586 {
587 this->sa_configs->insert_first(this->sa_configs,sa_config);
588 }
589
590 this->configurations->insert_first(this->configurations,configuration_entry_create(name,init_config,sa_config));
591 }
592
593 /**
594 * Implementation of private_configuration_manager_t.add_new_preshared_secret.
595 */
596 static void add_new_preshared_secret (private_configuration_manager_t *this,id_type_t type, char *id_string, char *preshared_secret)
597 {
598 preshared_secret_entry_t *entry = allocator_alloc_thing(preshared_secret_entry_t);
599
600 entry->identification = identification_create_from_string(type,id_string);
601 entry->preshared_secret.len = strlen(preshared_secret);
602 entry->preshared_secret.ptr = allocator_alloc(entry->preshared_secret.len);
603 memcpy(entry->preshared_secret.ptr,preshared_secret,entry->preshared_secret.len);
604
605 this->preshared_secrets->insert_last(this->preshared_secrets,entry);
606 }
607
608 /**
609 * Implementation of private_configuration_manager_t.add_new_preshared_secret.
610 */
611 static void add_new_rsa_public_key (private_configuration_manager_t *this, id_type_t type, char *id_string, u_int8_t* key_pos, size_t key_len)
612 {
613 chunk_t key;
614 key.ptr = key_pos;
615 key.len = key_len;
616
617 rsa_public_key_entry_t *entry = allocator_alloc_thing(rsa_public_key_entry_t);
618
619 entry->identification = identification_create_from_string(type,id_string);
620 entry->public_key = rsa_public_key_create();
621 entry->public_key->set_key(entry->public_key, key);
622
623 this->rsa_public_keys->insert_last(this->rsa_public_keys, entry);
624 }
625
626 /**
627 * Implementation of private_configuration_manager_t.add_new_preshared_secret.
628 */
629 static void add_new_rsa_private_key (private_configuration_manager_t *this, id_type_t type, char *id_string, u_int8_t* key_pos, size_t key_len)
630 {
631 chunk_t key;
632 key.ptr = key_pos;
633 key.len = key_len;
634
635 rsa_private_key_entry_t *entry = allocator_alloc_thing(rsa_private_key_entry_t);
636
637 entry->identification = identification_create_from_string(type,id_string);
638 entry->private_key = rsa_private_key_create();
639 entry->private_key->set_key(entry->private_key, key);
640
641 this->rsa_private_keys->insert_last(this->rsa_private_keys, entry);
642 }
643
644 /**
645 * Implementation of configuration_manager_t.get_shared_secret.
646 */
647 static status_t get_shared_secret(private_configuration_manager_t *this, identification_t *identification, chunk_t *preshared_secret)
648 {
649 iterator_t *iterator;
650
651 iterator = this->preshared_secrets->create_iterator(this->preshared_secrets,TRUE);
652 while (iterator->has_next(iterator))
653 {
654 preshared_secret_entry_t *entry;
655 iterator->current(iterator,(void **) &entry);
656 if (entry->identification->equals(entry->identification,identification))
657 {
658 *preshared_secret = entry->preshared_secret;
659 iterator->destroy(iterator);
660 return SUCCESS;
661 }
662 }
663 iterator->destroy(iterator);
664 return NOT_FOUND;
665 }
666
667 /**
668 * Implementation of configuration_manager_t.get_shared_secret.
669 */
670 static status_t get_rsa_public_key(private_configuration_manager_t *this, identification_t *identification, rsa_public_key_t **public_key)
671 {
672 iterator_t *iterator;
673
674 iterator = this->rsa_public_keys->create_iterator(this->rsa_public_keys,TRUE);
675 while (iterator->has_next(iterator))
676 {
677 rsa_public_key_entry_t *entry;
678 iterator->current(iterator,(void **) &entry);
679 if (entry->identification->equals(entry->identification,identification))
680 {
681 *public_key = entry->public_key;
682 iterator->destroy(iterator);
683 return SUCCESS;
684 }
685 }
686 iterator->destroy(iterator);
687 return NOT_FOUND;
688 }
689
690 /**
691 * Implementation of configuration_manager_t.get_shared_secret.
692 */
693 static status_t get_rsa_private_key(private_configuration_manager_t *this, identification_t *identification, rsa_private_key_t **private_key)
694 {
695 iterator_t *iterator;
696
697 iterator = this->rsa_private_keys->create_iterator(this->rsa_private_keys,TRUE);
698 while (iterator->has_next(iterator))
699 {
700 rsa_private_key_entry_t *entry;
701 iterator->current(iterator,(void **) &entry);
702 if (entry->identification->equals(entry->identification,identification))
703 {
704 *private_key = entry->private_key;
705 iterator->destroy(iterator);
706 return SUCCESS;
707 }
708 }
709 iterator->destroy(iterator);
710 return NOT_FOUND;
711 }
712
713 /**
714 * Implementation of configuration_manager_t.destroy.
715 */
716 static status_t get_retransmit_timeout (private_configuration_manager_t *this, u_int32_t retransmit_count, u_int32_t *timeout)
717 {
718 if ((retransmit_count > this->max_retransmit_count) && (this->max_retransmit_count != 0))
719 {
720 return FAILED;
721 }
722
723 /**
724 * TODO implement a good retransmit policy
725 */
726 *timeout = this->first_retransmit_timeout * (retransmit_count + 1);
727
728 return SUCCESS;
729 }
730
731 /**
732 * Implementation of configuration_manager_t.destroy.
733 */
734 static void destroy(private_configuration_manager_t *this)
735 {
736 this->logger->log(this->logger,CONTROL | MORE, "Going to destroy configuration manager ");
737
738 while (this->configurations->get_count(this->configurations) > 0)
739 {
740 configuration_entry_t *entry;
741 this->configurations->remove_first(this->configurations,(void **) &entry);
742 entry->destroy(entry);
743 }
744 /* todo delete all config objects */
745
746 this->configurations->destroy(this->configurations);
747
748 while (this->sa_configs->get_count(this->sa_configs) > 0)
749 {
750 sa_config_t *sa_config;
751 this->sa_configs->remove_first(this->sa_configs,(void **) &sa_config);
752 sa_config->destroy(sa_config);
753 }
754
755 this->sa_configs->destroy(this->sa_configs);
756
757 while (this->init_configs->get_count(this->init_configs) > 0)
758 {
759 init_config_t *init_config;
760 this->init_configs->remove_first(this->init_configs,(void **) &init_config);
761 init_config->destroy(init_config);
762 }
763 this->init_configs->destroy(this->init_configs);
764
765 while (this->preshared_secrets->get_count(this->preshared_secrets) > 0)
766 {
767 preshared_secret_entry_t *entry;
768 this->preshared_secrets->remove_first(this->preshared_secrets,(void **) &entry);
769 entry->identification->destroy(entry->identification);
770 allocator_free_chunk(&(entry->preshared_secret));
771 allocator_free(entry);
772 }
773 this->preshared_secrets->destroy(this->preshared_secrets);
774
775 while (this->rsa_private_keys->get_count(this->rsa_private_keys) > 0)
776 {
777 rsa_private_key_entry_t *entry;
778 this->rsa_private_keys->remove_first(this->rsa_private_keys,(void **) &entry);
779 entry->identification->destroy(entry->identification);
780 entry->private_key->destroy(entry->private_key);
781 allocator_free(entry);
782 }
783 this->rsa_private_keys->destroy(this->rsa_private_keys);
784
785 while (this->rsa_public_keys->get_count(this->rsa_public_keys) > 0)
786 {
787 rsa_public_key_entry_t *entry;
788 this->rsa_public_keys->remove_first(this->rsa_public_keys,(void **) &entry);
789 entry->identification->destroy(entry->identification);
790 entry->public_key->destroy(entry->public_key);
791 allocator_free(entry);
792 }
793 this->rsa_public_keys->destroy(this->rsa_public_keys);
794
795 this->logger->log(this->logger,CONTROL | MOST, "Destroy assigned logger");
796 charon->logger_manager->destroy_logger(charon->logger_manager,this->logger);
797 allocator_free(this);
798 }
799
800 /*
801 * Described in header-file
802 */
803 configuration_manager_t *configuration_manager_create(u_int32_t first_retransmit_timeout,u_int32_t max_retransmit_count)
804 {
805 private_configuration_manager_t *this = allocator_alloc_thing(private_configuration_manager_t);
806
807 /* public functions */
808 this->public.destroy = (void(*)(configuration_manager_t*))destroy;
809 this->public.get_init_config_for_name = (status_t (*) (configuration_manager_t *, char *, init_config_t **)) get_init_config_for_name;
810 this->public.get_init_config_for_host = (status_t (*) (configuration_manager_t *, host_t *, host_t *,init_config_t **)) get_init_config_for_host;
811 this->public.get_sa_config_for_name =(status_t (*) (configuration_manager_t *, char *, sa_config_t **)) get_sa_config_for_name;
812 this->public.get_sa_config_for_init_config_and_id =(status_t (*) (configuration_manager_t *, init_config_t *, identification_t *, identification_t *,sa_config_t **)) get_sa_config_for_init_config_and_id;
813 this->public.get_retransmit_timeout = (status_t (*) (configuration_manager_t *, u_int32_t retransmit_count, u_int32_t *timeout))get_retransmit_timeout;
814 this->public.get_shared_secret = (status_t (*) (configuration_manager_t *, identification_t *, chunk_t *))get_shared_secret;
815 this->public.get_rsa_private_key = (status_t (*) (configuration_manager_t *, identification_t *, rsa_private_key_t**))get_rsa_private_key;
816 this->public.get_rsa_public_key = (status_t (*) (configuration_manager_t *, identification_t *, rsa_public_key_t**))get_rsa_public_key;
817
818 /* private functions */
819 this->load_default_config = load_default_config;
820 this->add_new_configuration = add_new_configuration;
821 this->add_new_preshared_secret = add_new_preshared_secret;
822 this->add_new_rsa_public_key = add_new_rsa_public_key;
823 this->add_new_rsa_private_key = add_new_rsa_private_key;
824
825 /* private variables */
826 this->logger = charon->logger_manager->create_logger(charon->logger_manager,CONFIGURATION_MANAGER,NULL);
827 this->configurations = linked_list_create();
828 this->sa_configs = linked_list_create();
829 this->init_configs = linked_list_create();
830 this->preshared_secrets = linked_list_create();
831 this->rsa_private_keys = linked_list_create();
832 this->rsa_public_keys = linked_list_create();
833 this->max_retransmit_count = max_retransmit_count;
834 this->first_retransmit_timeout = first_retransmit_timeout;
835
836 this->load_default_config(this);
837
838 return (&this->public);
839 }
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855 u_int8_t public_key_1[] = {
856 0xD4,0x8D,0x40,0x8E,0xBD,0xFC,0x6D,0xE9,0xDB,0x1C,0xD2,0x21,0x19,0x37,0x6B,0xE2,
857 0xDC,0xCE,0x74,0xA2,0x63,0xF6,0xD8,0x8D,0xAF,0x1C,0xC0,0xFF,0x07,0x3F,0xFB,0x52,
858 0x59,0x45,0x01,0x10,0x35,0xA9,0xB8,0x16,0x69,0x31,0x19,0x4F,0xDD,0x66,0xAD,0xAC,
859 0x80,0x11,0x33,0x38,0x5A,0x11,0xF9,0x33,0x3F,0xD2,0x41,0x4A,0x21,0x9B,0x54,0x44,
860 0x00,0xB6,0x07,0x33,0x4A,0x5B,0x4E,0x09,0x7C,0x9D,0xB8,0xDE,0x6B,0xA2,0xB2,0x78,
861 0x23,0x3D,0xF0,0xB7,0x37,0x2B,0x7A,0x71,0x50,0x6E,0xEA,0x93,0x3E,0xB5,0x2C,0xBD,
862 0xD6,0x08,0x43,0x12,0x0A,0xE8,0x8D,0xE6,0x6C,0x24,0xCC,0x3F,0xF7,0x18,0x7E,0x87,
863 0x59,0x0C,0xA9,0x5D,0x85,0xF8,0x6E,0x83,0xD8,0x18,0x77,0x07,0xB6,0x44,0x3C,0x8D,
864 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
865 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
866 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
867 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
868 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
869 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
870 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
871 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x01
872 };
873
874 u_int8_t private_key_1[] = {
875 0xD4,0x8D,0x40,0x8E,0xBD,0xFC,0x6D,0xE9,0xDB,0x1C,0xD2,0x21,0x19,0x37,0x6B,0xE2,
876 0xDC,0xCE,0x74,0xA2,0x63,0xF6,0xD8,0x8D,0xAF,0x1C,0xC0,0xFF,0x07,0x3F,0xFB,0x52,
877 0x59,0x45,0x01,0x10,0x35,0xA9,0xB8,0x16,0x69,0x31,0x19,0x4F,0xDD,0x66,0xAD,0xAC,
878 0x80,0x11,0x33,0x38,0x5A,0x11,0xF9,0x33,0x3F,0xD2,0x41,0x4A,0x21,0x9B,0x54,0x44,
879 0x00,0xB6,0x07,0x33,0x4A,0x5B,0x4E,0x09,0x7C,0x9D,0xB8,0xDE,0x6B,0xA2,0xB2,0x78,
880 0x23,0x3D,0xF0,0xB7,0x37,0x2B,0x7A,0x71,0x50,0x6E,0xEA,0x93,0x3E,0xB5,0x2C,0xBD,
881 0xD6,0x08,0x43,0x12,0x0A,0xE8,0x8D,0xE6,0x6C,0x24,0xCC,0x3F,0xF7,0x18,0x7E,0x87,
882 0x59,0x0C,0xA9,0x5D,0x85,0xF8,0x6E,0x83,0xD8,0x18,0x77,0x07,0xB6,0x44,0x3C,0x8D,
883 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
884 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
885 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
886 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
887 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
888 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
889 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
890 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x01,
891 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
892 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
893 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
894 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
895 0xEE,0xF2,0x37,0xF2,0x98,0xEB,0x33,0xC6,0x84,0xE8,0xB9,0xD1,0x18,0xB5,0x29,0x00,
896 0xAC,0x6B,0x78,0xBC,0x9E,0xB6,0x01,0x21,0x29,0xEE,0x4A,0x99,0xFB,0x3D,0x07,0x23,
897 0x77,0x84,0x93,0x4B,0x53,0x49,0xB0,0xA4,0x6F,0xB0,0xF5,0x50,0xDB,0x35,0xDD,0xDF,
898 0x41,0x6F,0x7B,0xA9,0x88,0x3D,0x0B,0x1C,0x2E,0x2B,0x44,0x35,0x24,0x72,0x66,0xC1,
899 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
900 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
901 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
902 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
903 0xE3,0xB8,0xC8,0x30,0x67,0xD0,0x5D,0xF1,0x32,0x64,0xDC,0x4B,0xB3,0x7E,0xE3,0x1A,
904 0xC5,0xBC,0xAC,0xC9,0x95,0x5C,0x96,0x0D,0x5A,0x52,0x90,0xE0,0x08,0x3F,0xA6,0x71,
905 0xC7,0x18,0xC5,0x64,0xA2,0xE4,0xB8,0x43,0x5A,0x8A,0x7A,0x9B,0xDF,0xDA,0x81,0x85,
906 0x6C,0x0F,0xA4,0xC9,0xAC,0x25,0x19,0x54,0xFE,0x75,0xAA,0x1D,0x22,0xB8,0xF4,0xCD,
907 0x1A,0x91,0xC2,0xA3,0x65,0x3F,0xD7,0xFC,0x7E,0xE1,0x92,0x29,0xC5,0x85,0x6E,0x44,
908 0xC8,0x4D,0xBD,0x7A,0x2C,0x2D,0x47,0xE2,0x24,0x24,0xDF,0xC2,0x31,0x65,0x8F,0xD4,
909 0xBA,0x28,0x7C,0x4A,0xCA,0xAE,0x79,0xBE,0xC1,0x6C,0xFC,0x09,0x45,0xF7,0x87,0x17,
910 0xB4,0x55,0x92,0x15,0xC5,0xFA,0x8F,0xB0,0x56,0x96,0xC1,0x87,0x12,0xFE,0xDF,0xF0,
911 0x3A,0xE1,0xB1,0x83,0x19,0x74,0xF0,0x7D,0x37,0x41,0x3E,0x6A,0xFE,0x33,0x3E,0x74,
912 0x01,0x45,0xE4,0x65,0xAE,0xC9,0xAE,0x64,0xE3,0xF1,0x90,0xFD,0x1A,0x30,0x44,0x82,
913 0xEE,0x34,0x94,0xF2,0x68,0x3D,0x61,0x90,0xFB,0xEB,0xD8,0x18,0xE6,0x7C,0xEC,0x69,
914 0x70,0xD0,0xEB,0x2F,0xC1,0x3D,0x9C,0x6A,0x4B,0x89,0x50,0x6B,0x3F,0xA5,0x38,0x41,
915 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
916 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
917 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
918 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
919 0x65,0xEE,0x34,0x09,0xAC,0x4C,0x21,0x71,0x1D,0x3F,0x7E,0x0D,0x01,0xC2,0x3E,0x34,
920 0x88,0x58,0xEC,0x4F,0x62,0x50,0xF7,0xD8,0x62,0xDF,0xC1,0x39,0x40,0xA0,0xBF,0x0B,
921 0xD5,0x2F,0x5B,0xFA,0x35,0x14,0x69,0x63,0x2C,0x36,0x4B,0xDF,0xEB,0x33,0x66,0x6B,
922 0x97,0xA9,0x6C,0x12,0x5D,0x08,0xD5,0x55,0x77,0x28,0x83,0xD7,0x3B,0xAE,0x05,0xC1,
923 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
924 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
925 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
926 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
927 0x9F,0x96,0x17,0x75,0x14,0xCB,0xC9,0x8A,0x06,0xAE,0xF8,0x53,0x74,0xEF,0x2F,0x68,
928 0xCB,0xBA,0x75,0xBC,0xAF,0x97,0xBA,0xF0,0x90,0xA3,0xDC,0x33,0xA4,0x94,0x36,0xA8,
929 0xF5,0xC6,0x3E,0x4F,0x50,0x78,0xC9,0x49,0x2A,0x62,0x71,0x9A,0x5B,0x3E,0x5E,0x16,
930 0x8A,0xAC,0x4B,0xE7,0xA9,0x64,0x36,0x64,0x82,0x0F,0x23,0xB0,0x57,0x6D,0x16,0xE1,
931 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
932 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
933 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
934 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
935 0x25,0xF1,0x40,0x05,0x58,0x19,0x37,0x61,0x34,0x98,0xBB,0x29,0x1B,0x44,0x08,0x1A,
936 0xD3,0x66,0x62,0x4C,0x9C,0x47,0xD2,0x91,0x60,0x46,0x6F,0x8E,0xA6,0xE7,0x80,0x7B,
937 0x17,0x77,0x9A,0xB5,0x18,0x8A,0x15,0x8F,0x77,0xA1,0x55,0x3E,0x96,0x66,0x86,0x57,
938 0x75,0x73,0xF5,0x57,0x50,0x28,0xEA,0x83,0x14,0xB1,0x55,0xA3,0x82,0xCD,0x36,0xF8
939 };
940 u_int8_t public_key_2[] = {
941 0x88,0x3E,0xE2,0x2E,0x5D,0x01,0x13,0xDF,0x1D,0x8B,0xF4,0x39,0xCA,0xE6,0x3C,0xE1,
942 0x46,0x8E,0xD4,0xF1,0x06,0x56,0x12,0x8D,0xCD,0x51,0xBD,0x32,0xF5,0x18,0x15,0x4D,
943 0x0F,0x98,0xDF,0xFF,0xA5,0xA3,0xAB,0x39,0x43,0xC4,0xF6,0xAC,0x98,0x5C,0x84,0x63,
944 0x8C,0x46,0x33,0xA2,0x23,0x8C,0xF0,0x4D,0xFE,0xE7,0xF3,0x38,0xC4,0x19,0x39,0xC4,
945 0x90,0xF4,0xC8,0x0D,0xB0,0xFE,0x65,0x11,0x0B,0x41,0x73,0xBB,0x05,0xA6,0x4B,0xC5,
946 0x27,0xA4,0x48,0x21,0xC5,0xAE,0x91,0x9C,0xD8,0x62,0x27,0xBE,0xDF,0xDA,0xC6,0x4E,
947 0xC1,0x6E,0x5B,0x61,0x51,0xAA,0xC9,0x53,0xCD,0x02,0x5B,0xC5,0xEE,0xE9,0xC7,0x7B,
948 0xB1,0x7E,0xD2,0xC2,0xFE,0x5F,0xD7,0x0F,0x75,0x2B,0xB9,0x49,0x5F,0x35,0xF1,0x83,
949 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
950 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
951 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
952 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
953 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
954 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
955 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
956 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x01
957 };
958 u_int8_t private_key_2[] = {
959 0x88,0x3E,0xE2,0x2E,0x5D,0x01,0x13,0xDF,0x1D,0x8B,0xF4,0x39,0xCA,0xE6,0x3C,0xE1,
960 0x46,0x8E,0xD4,0xF1,0x06,0x56,0x12,0x8D,0xCD,0x51,0xBD,0x32,0xF5,0x18,0x15,0x4D,
961 0x0F,0x98,0xDF,0xFF,0xA5,0xA3,0xAB,0x39,0x43,0xC4,0xF6,0xAC,0x98,0x5C,0x84,0x63,
962 0x8C,0x46,0x33,0xA2,0x23,0x8C,0xF0,0x4D,0xFE,0xE7,0xF3,0x38,0xC4,0x19,0x39,0xC4,
963 0x90,0xF4,0xC8,0x0D,0xB0,0xFE,0x65,0x11,0x0B,0x41,0x73,0xBB,0x05,0xA6,0x4B,0xC5,
964 0x27,0xA4,0x48,0x21,0xC5,0xAE,0x91,0x9C,0xD8,0x62,0x27,0xBE,0xDF,0xDA,0xC6,0x4E,
965 0xC1,0x6E,0x5B,0x61,0x51,0xAA,0xC9,0x53,0xCD,0x02,0x5B,0xC5,0xEE,0xE9,0xC7,0x7B,
966 0xB1,0x7E,0xD2,0xC2,0xFE,0x5F,0xD7,0x0F,0x75,0x2B,0xB9,0x49,0x5F,0x35,0xF1,0x83,
967 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
968 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
969 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
970 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
971 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
972 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
973 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
974 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x01,
975 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
976 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
977 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
978 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
979 0xE8,0x37,0xB6,0x08,0xD8,0x9C,0x72,0xC5,0x34,0xDB,0x3A,0xA2,0xF9,0x24,0xE1,0x44,
980 0x23,0x3B,0x72,0x70,0x5D,0xCC,0xC3,0xBA,0x3D,0xCE,0x82,0xAC,0x6A,0x71,0x72,0x90,
981 0xC7,0x94,0xB3,0x8B,0x85,0xE0,0xEF,0x39,0xF0,0xE4,0x08,0x31,0xEA,0xE6,0x3B,0x7D,
982 0xB0,0x36,0xFA,0x71,0x6E,0xA3,0xF9,0x4C,0x39,0x05,0x8C,0xB7,0x8C,0x99,0x94,0x85,
983 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
984 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
985 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
986 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
987 0x96,0x32,0xF9,0xD9,0xA8,0xC0,0x84,0xFD,0xE5,0x6B,0xA6,0xC2,0x85,0x85,0x68,0x17,
988 0x7E,0x98,0xD0,0x6A,0xDC,0xD8,0x4C,0x46,0xCB,0x6D,0x4C,0x25,0xE5,0xF9,0x58,0xB2,
989 0x17,0xE4,0x20,0x8A,0x87,0x0D,0xD7,0x4C,0x79,0xA3,0xB3,0x69,0x98,0x7F,0x5D,0x08,
990 0x33,0x5B,0xAD,0xA3,0x34,0xE8,0x55,0x5E,0x09,0x60,0x70,0xA8,0x11,0xFD,0x70,0x67,
991 0x00,0xE1,0xA7,0x44,0xF5,0x85,0x14,0x43,0xD5,0x45,0x1A,0x87,0x65,0x30,0xA8,0x24,
992 0x2C,0xF8,0xAF,0x97,0xFF,0x9A,0x7E,0xF4,0x3B,0xE7,0xD3,0x79,0x88,0xEC,0x66,0xF6,
993 0xE0,0xAA,0xF4,0x88,0x0A,0xE2,0x4C,0x31,0x4A,0xA6,0xF3,0x91,0x9A,0x4A,0xBE,0xF0,
994 0x85,0xEF,0xCE,0x55,0xB6,0x35,0x2B,0x38,0xD5,0xF5,0x5A,0x35,0x7B,0xCF,0x4D,0xF8,
995 0x5D,0x1E,0x57,0x99,0xAF,0xED,0x33,0x6F,0xD5,0xA7,0x49,0x5B,0x14,0x4C,0x7D,0x17,
996 0x81,0xAE,0x1E,0xDA,0x9D,0xFB,0xA9,0xC3,0x00,0x4C,0x17,0x37,0x30,0x96,0x60,0xE1,
997 0x6A,0xCC,0xD3,0xDB,0x40,0xCE,0x96,0x96,0x0D,0x95,0x0D,0x84,0x38,0xBD,0xDA,0x2F,
998 0xEC,0xED,0x22,0x39,0x8E,0x8C,0xDF,0xCD,0x07,0xCF,0x0F,0xB0,0x2B,0x76,0xDB,0xC1,
999 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1000 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1001 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1002 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1003 0xA5,0x37,0x9E,0x08,0x45,0x35,0x6A,0x62,0xEC,0xEC,0x5D,0x97,0xBE,0x73,0x82,0xE2,
1004 0x9B,0xBE,0x9B,0xF9,0x5E,0x83,0x65,0x6E,0x88,0xB2,0xF9,0x3D,0xFA,0xAD,0xA4,0xB9,
1005 0x65,0x86,0x63,0x08,0x0D,0xC4,0xAF,0xF0,0x25,0x77,0xD8,0x6C,0xCB,0x97,0xEB,0x13,
1006 0xCD,0xE0,0x0F,0xE7,0xCC,0xB4,0x55,0x96,0xE9,0xAB,0x0D,0x27,0x3A,0x9D,0xBA,0x91,
1007 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1008 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1009 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1010 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1011 0x44,0xA3,0x44,0xF4,0x47,0x9E,0xBA,0xE7,0xBF,0xF8,0xC2,0xFB,0x2F,0xC3,0x38,0x3F,
1012 0x4C,0x56,0x0F,0x20,0x56,0x8D,0xED,0xC5,0x88,0x5F,0x09,0x26,0x64,0x82,0xDF,0x1A,
1013 0x7B,0xBA,0x7F,0x78,0x6E,0xA1,0x4F,0x9B,0x1E,0x17,0x45,0xFC,0xE2,0x78,0x89,0x8E,
1014 0x1E,0xD2,0x2D,0x76,0x60,0xCE,0x2F,0x7C,0xCA,0xB2,0x2C,0xA9,0x51,0x97,0x4C,0xCF,
1015 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1016 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1017 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1018 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1019 0x01,0x40,0x4B,0x7D,0xAB,0x8A,0xB9,0x5E,0xEE,0xA1,0x81,0xED,0x27,0x89,0xF6,0x4C,
1020 0x59,0x8C,0x23,0x14,0x3B,0x1B,0xBA,0xC3,0xB2,0x00,0x9A,0x9E,0xDF,0x54,0x82,0xA7,
1021 0x3E,0xC9,0x23,0x85,0x4D,0xD3,0x80,0xA7,0x89,0x11,0xBA,0x76,0xF5,0xC1,0x55,0x37,
1022 0x0A,0x0D,0x8C,0x07,0x0A,0xC8,0xC5,0x11,0x74,0x9C,0xB6,0x80,0x3B,0x0A,0x9A,0xA2
1023 };