- rewrite of logger_manager, uses now one instance per context

- cleanups for logger here and there
- removed critical flag check in payload verification (conformance to IKEv2)
- so thats and theres everywere... ;-)
This commit is contained in:
Martin Willi
2006-03-23 15:25:43 +00:00
parent 3264ce50b9
commit dec598220b
59 changed files with 461 additions and 762 deletions
@@ -39,7 +39,7 @@ void test_diffie_hellman(protected_tester_t *tester)
chunk_t my_public_value, other_public_value;
chunk_t my_secret, other_secret;
logger = charon->logger_manager->create_logger(charon->logger_manager,TESTER,"Diffie Hellman");
logger = charon->logger_manager->get_logger(charon->logger_manager,TESTER);
my_diffie_hellman = diffie_hellman_create(MODP_1024_BIT);
@@ -60,18 +60,17 @@ void test_diffie_hellman(protected_tester_t *tester)
allocator_free(my_public_value.ptr);
allocator_free(other_public_value.ptr);
tester->assert_true(tester,( my_diffie_hellman->get_shared_secret(my_diffie_hellman,&my_secret) == SUCCESS), "get_shared_secret call check");
tester->assert_true(tester,(my_diffie_hellman->get_shared_secret(my_diffie_hellman,&my_secret) == SUCCESS), "get_shared_secret call check");
logger->log_chunk(logger,RAW,"My shared secret",my_secret);
tester->assert_true(tester,( other_diffie_hellman->get_shared_secret(other_diffie_hellman,&other_secret) == SUCCESS), "get_shared_secret call check");
tester->assert_true(tester,(other_diffie_hellman->get_shared_secret(other_diffie_hellman,&other_secret) == SUCCESS), "get_shared_secret call check");
logger->log_chunk(logger,RAW,"Other shared secret",other_secret);
tester->assert_true(tester,( memcmp(my_secret.ptr,other_secret.ptr,other_secret.len) == 0), "shared secret same value check");
tester->assert_true(tester,(memcmp(my_secret.ptr,other_secret.ptr,other_secret.len) == 0), "shared secret same value check");
allocator_free(my_secret.ptr);
allocator_free(other_secret.ptr);
my_diffie_hellman->destroy(my_diffie_hellman);
other_diffie_hellman->destroy(other_diffie_hellman);
charon->logger_manager->destroy_logger(charon->logger_manager,logger);
}