diff options
author | Martin Willi <martin@strongswan.org> | 2006-06-07 13:26:23 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2006-06-07 13:26:23 +0000 |
commit | 8d77eddec2bddbbf44eeec1b95c44a69426c87a6 (patch) | |
tree | b6cc5552d9f19357d9b789ee18d858236089da82 /src/charon/testing/proposal_test.c | |
parent | a401efd09157382ba95a398e71995fd67a5fd337 (diff) | |
download | strongswan-8d77eddec2bddbbf44eeec1b95c44a69426c87a6.tar.bz2 strongswan-8d77eddec2bddbbf44eeec1b95c44a69426c87a6.tar.xz |
further work for rekeying:
get liftimes from policy
added new state
initiation of rekeying done
proposal redone:
removed support for AH+ESP proposals
Diffstat (limited to 'src/charon/testing/proposal_test.c')
-rw-r--r-- | src/charon/testing/proposal_test.c | 48 |
1 files changed, 18 insertions, 30 deletions
diff --git a/src/charon/testing/proposal_test.c b/src/charon/testing/proposal_test.c index 1b16390d3..7adad91f5 100644 --- a/src/charon/testing/proposal_test.c +++ b/src/charon/testing/proposal_test.c @@ -37,58 +37,46 @@ void test_proposal(protected_tester_t *tester) algorithm_t *algo; bool result; - proposal1 = proposal_create(1); - proposal1->add_algorithm(proposal1, PROTO_ESP, ENCRYPTION_ALGORITHM, ENCR_3DES, 0); - proposal1->add_algorithm(proposal1, PROTO_ESP, ENCRYPTION_ALGORITHM, ENCR_AES_CBC, 32); - proposal1->add_algorithm(proposal1, PROTO_ESP, ENCRYPTION_ALGORITHM, ENCR_AES_CBC, 16); - proposal1->add_algorithm(proposal1, PROTO_ESP, ENCRYPTION_ALGORITHM, ENCR_BLOWFISH, 0); - proposal1->add_algorithm(proposal1, PROTO_ESP, INTEGRITY_ALGORITHM, AUTH_HMAC_SHA1_96, 20); - proposal1->add_algorithm(proposal1, PROTO_ESP, INTEGRITY_ALGORITHM, AUTH_HMAC_MD5_96, 20); - proposal1->add_algorithm(proposal1, PROTO_AH, DIFFIE_HELLMAN_GROUP, MODP_1024_BIT, 0); - proposal1->add_algorithm(proposal1, PROTO_AH, DIFFIE_HELLMAN_GROUP, MODP_2048_BIT, 0); + proposal1 = proposal_create(PROTO_ESP); + proposal1->add_algorithm(proposal1, ENCRYPTION_ALGORITHM, ENCR_3DES, 0); + proposal1->add_algorithm(proposal1, ENCRYPTION_ALGORITHM, ENCR_AES_CBC, 32); + proposal1->add_algorithm(proposal1, ENCRYPTION_ALGORITHM, ENCR_AES_CBC, 16); + proposal1->add_algorithm(proposal1, ENCRYPTION_ALGORITHM, ENCR_BLOWFISH, 0); + proposal1->add_algorithm(proposal1, INTEGRITY_ALGORITHM, AUTH_HMAC_SHA1_96, 0); + proposal1->add_algorithm(proposal1, INTEGRITY_ALGORITHM, AUTH_HMAC_MD5_96, 0); + proposal1->add_algorithm(proposal1, DIFFIE_HELLMAN_GROUP, MODP_1024_BIT, 0); + proposal1->add_algorithm(proposal1, DIFFIE_HELLMAN_GROUP, MODP_2048_BIT, 0); - proposal2 = proposal_create(2); - proposal2->add_algorithm(proposal2, PROTO_ESP, ENCRYPTION_ALGORITHM, ENCR_3IDEA, 0); - proposal2->add_algorithm(proposal2, PROTO_ESP, ENCRYPTION_ALGORITHM, ENCR_AES_CBC, 16); - proposal2->add_algorithm(proposal2, PROTO_ESP, INTEGRITY_ALGORITHM, AUTH_HMAC_MD5_96, 20); - proposal1->add_algorithm(proposal2, PROTO_AH, DIFFIE_HELLMAN_GROUP, MODP_1024_BIT, 0); + proposal2 = proposal_create(PROTO_ESP); + proposal2->add_algorithm(proposal2, ENCRYPTION_ALGORITHM, ENCR_3IDEA, 0); + proposal2->add_algorithm(proposal2, ENCRYPTION_ALGORITHM, ENCR_AES_CBC, 0); + proposal2->add_algorithm(proposal2, INTEGRITY_ALGORITHM, AUTH_HMAC_MD5_96, 0); /* ah and esp prop */ proposal3 = proposal1->select(proposal1, proposal2); tester->assert_false(tester, proposal3 == NULL, "proposal select"); if (proposal3) { - result = proposal3->get_algorithm(proposal3, PROTO_ESP, ENCRYPTION_ALGORITHM, &algo); + result = proposal3->get_algorithm(proposal3, ENCRYPTION_ALGORITHM, &algo); tester->assert_true(tester, result, "encryption algo select"); tester->assert_true(tester, algo->algorithm == ENCR_AES_CBC, "encryption algo"); tester->assert_true(tester, algo->key_size == 16, "encryption keylen"); - result = proposal3->get_algorithm(proposal3, PROTO_ESP, INTEGRITY_ALGORITHM, &algo); + result = proposal3->get_algorithm(proposal3, INTEGRITY_ALGORITHM, &algo); tester->assert_true(tester, result, "integrity algo select"); tester->assert_true(tester, algo->algorithm == AUTH_HMAC_MD5_96, "integrity algo"); - tester->assert_true(tester, algo->key_size == 20, "integrity keylen"); + tester->assert_true(tester, algo->key_size == 16, "integrity keylen"); - iterator = proposal3->create_algorithm_iterator(proposal3, PROTO_ESP, INTEGRITY_ALGORITHM); + iterator = proposal3->create_algorithm_iterator(proposal3, INTEGRITY_ALGORITHM); tester->assert_false(tester, iterator == NULL, "integrity algo select"); while(iterator->has_next(iterator)) { iterator->current(iterator, (void**)&algo); tester->assert_true(tester, algo->algorithm == AUTH_HMAC_MD5_96, "integrity algo"); - tester->assert_true(tester, algo->key_size == 20, "integrity keylen"); + tester->assert_true(tester, algo->key_size == 16, "integrity keylen"); } iterator->destroy(iterator); - - iterator = proposal3->create_algorithm_iterator(proposal3, PROTO_AH, DIFFIE_HELLMAN_GROUP ); - tester->assert_false(tester, iterator == NULL, "dh group algo select"); - while(iterator->has_next(iterator)) - { - iterator->current(iterator, (void**)&algo); - tester->assert_true(tester, algo->algorithm == MODP_1024_BIT, "dh group algo"); - tester->assert_true(tester, algo->key_size == 0, "dh gorup keylen"); - } - iterator->destroy(iterator); - proposal3->destroy(proposal3); } |