proposal: Move proposal_t from libcharon to libstrongswan

This allows us to use it without having to initialize libcharon, which
was required for the logging (we probably could have included debug.h
instead of daemon.h to workaround that but this seems more correct).
This commit is contained in:
Tobias Brunner
2017-11-17 18:09:54 +01:00
parent 92c1b52487
commit 2307bffe56
26 changed files with 24 additions and 29 deletions
+1 -1
View File
@@ -17,7 +17,7 @@
#include <tests/test_suite.h>
#include <daemon.h>
#include <config/proposal.h>
#include <crypto/proposal/proposal.h>
#include <encoding/payloads/ike_header.h>
#include <tkm/client.h>
+1 -1
View File
@@ -18,7 +18,7 @@
#include <errno.h>
#include <encoding/payloads/sa_payload.h>
#include <config/proposal.h>
#include <crypto/proposal/proposal.h>
typedef struct private_custom_proposal_t private_custom_proposal_t;
-1
View File
@@ -16,7 +16,6 @@ config/backend_manager.c config/backend_manager.h config/backend.h \
config/child_cfg.c config/child_cfg.h \
config/ike_cfg.c config/ike_cfg.h \
config/peer_cfg.c config/peer_cfg.h \
config/proposal.c config/proposal.h \
control/controller.c control/controller.h \
daemon.c daemon.h \
encoding/generator.c encoding/generator.h \
-1
View File
@@ -14,7 +14,6 @@ config/backend_manager.c config/backend_manager.h config/backend.h \
config/child_cfg.c config/child_cfg.h \
config/ike_cfg.c config/ike_cfg.h \
config/peer_cfg.c config/peer_cfg.h \
config/proposal.c config/proposal.h \
control/controller.c control/controller.h \
daemon.c daemon.h \
encoding/generator.c encoding/generator.h \
+1 -1
View File
@@ -31,7 +31,7 @@ typedef struct child_cfg_create_t child_cfg_create_t;
#include <library.h>
#include <selectors/traffic_selector.h>
#include <config/proposal.h>
#include <crypto/proposal/proposal.h>
#include <kernel/kernel_ipsec.h>
/**
+1 -1
View File
@@ -31,7 +31,7 @@ typedef struct ike_cfg_t ike_cfg_t;
#include <networking/host.h>
#include <collections/linked_list.h>
#include <utils/identification.h>
#include <config/proposal.h>
#include <crypto/proposal/proposal.h>
#include <crypto/diffie_hellman.h>
/**
+1 -1
View File
@@ -32,7 +32,7 @@ typedef struct peer_cfg_create_t peer_cfg_create_t;
#include <utils/identification.h>
#include <collections/enumerator.h>
#include <selectors/traffic_selector.h>
#include <config/proposal.h>
#include <crypto/proposal/proposal.h>
#include <config/ike_cfg.h>
#include <config/child_cfg.h>
#include <credentials/auth_cfg.h>
-6
View File
@@ -55,7 +55,6 @@
#include <bus/listeners/sys_logger.h>
#include <bus/listeners/file_logger.h>
#include <collections/array.h>
#include <config/proposal.h>
#include <plugins/plugin_feature.h>
#include <kernel/kernel_handler.h>
#include <processing/jobs/start_action_job.h>
@@ -989,11 +988,6 @@ bool libcharon_init()
dbg_old = dbg;
dbg = dbg_bus;
lib->printf_hook->add_handler(lib->printf_hook, 'P',
proposal_printf_hook,
PRINTF_HOOK_ARGTYPE_POINTER,
PRINTF_HOOK_ARGTYPE_END);
if (lib->integrity &&
!lib->integrity->check(lib->integrity, "libcharon", libcharon_init))
{
@@ -29,7 +29,7 @@ typedef struct proposal_substructure_t proposal_substructure_t;
#include <library.h>
#include <encoding/payloads/payload.h>
#include <encoding/payloads/transform_substructure.h>
#include <config/proposal.h>
#include <crypto/proposal/proposal.h>
#include <collections/linked_list.h>
#include <kernel/kernel_ipsec.h>
#include <sa/authenticator.h>
@@ -32,7 +32,7 @@ typedef struct transform_substructure_t transform_substructure_t;
#include <crypto/signers/signer.h>
#include <crypto/prfs/prf.h>
#include <crypto/crypters/crypter.h>
#include <config/proposal.h>
#include <crypto/proposal/proposal.h>
/**
* IKEv1 Value for a transform payload.
@@ -27,7 +27,7 @@ typedef struct delete_child_sa_job_t delete_child_sa_job_t;
#include <library.h>
#include <sa/ike_sa_id.h>
#include <processing/jobs/job.h>
#include <config/proposal.h>
#include <crypto/proposal/proposal.h>
/**
@@ -26,7 +26,7 @@ typedef struct rekey_child_sa_job_t rekey_child_sa_job_t;
#include <library.h>
#include <sa/ike_sa_id.h>
#include <processing/jobs/job.h>
#include <config/proposal.h>
#include <crypto/proposal/proposal.h>
/**
* Class representing an REKEY_CHILD_SA Job.
@@ -50,4 +50,5 @@ struct rekey_child_sa_job_t {
*/
rekey_child_sa_job_t *rekey_child_sa_job_create(protocol_id_t protocol,
uint32_t spi, host_t *dst);
#endif /** REKEY_CHILD_SA_JOB_H_ @}*/
@@ -26,7 +26,7 @@ typedef struct update_sa_job_t update_sa_job_t;
#include <library.h>
#include <networking/host.h>
#include <processing/jobs/job.h>
#include <config/proposal.h>
#include <crypto/proposal/proposal.h>
/**
* Update the addresses of an IKE and its CHILD_SAs.
+1 -1
View File
@@ -30,7 +30,7 @@ typedef struct child_sa_t child_sa_t;
#include <library.h>
#include <crypto/prf_plus.h>
#include <encoding/payloads/proposal_substructure.h>
#include <config/proposal.h>
#include <crypto/proposal/proposal.h>
#include <config/child_cfg.h>
/**
+1 -1
View File
@@ -27,7 +27,7 @@ typedef struct keymat_t keymat_t;
#include <utils/identification.h>
#include <crypto/prfs/prf.h>
#include <crypto/aead.h>
#include <config/proposal.h>
#include <crypto/proposal/proposal.h>
#include <config/peer_cfg.h>
#include <sa/ike_sa_id.h>
-1
View File
@@ -3,7 +3,6 @@ TESTS = libcharon_tests exchange_tests
check_PROGRAMS = $(TESTS)
libcharon_tests_SOURCES = \
suites/test_proposal.c \
suites/test_ike_cfg.c \
suites/test_mem_pool.c \
suites/test_message_chapoly.c \
-1
View File
@@ -24,7 +24,6 @@
* @ingroup libcharon-tests
*/
TEST_SUITE(proposal_suite_create)
TEST_SUITE(ike_cfg_suite_create)
TEST_SUITE(mem_pool_suite_create)
TEST_SUITE_DEPEND(message_chapoly_suite_create, AEAD, ENCR_CHACHA20_POLY1305, 32)
+1 -1
View File
@@ -8,7 +8,7 @@ asn1/asn1.c asn1/asn1_parser.c asn1/oid.c bio/bio_reader.c bio/bio_writer.c \
collections/blocking_queue.c collections/enumerator.c collections/hashtable.c \
collections/array.c \
collections/linked_list.c crypto/crypters/crypter.c crypto/hashers/hasher.c \
crypto/hashers/hash_algorithm_set.c \
crypto/hashers/hash_algorithm_set.c crypto/proposal/proposal.c \
crypto/proposal/proposal_keywords.c crypto/proposal/proposal_keywords_static.c \
crypto/prfs/prf.c crypto/prfs/mac_prf.c crypto/pkcs5.c \
crypto/rngs/rng.c crypto/prf_plus.c crypto/signers/signer.c \
+2 -2
View File
@@ -6,7 +6,7 @@ asn1/asn1.c asn1/asn1_parser.c asn1/oid.c bio/bio_reader.c bio/bio_writer.c \
collections/blocking_queue.c collections/enumerator.c collections/hashtable.c \
collections/array.c \
collections/linked_list.c crypto/crypters/crypter.c crypto/hashers/hasher.c \
crypto/hashers/hash_algorithm_set.c \
crypto/hashers/hash_algorithm_set.c crypto/proposal/proposal.c \
crypto/proposal/proposal_keywords.c crypto/proposal/proposal_keywords_static.c \
crypto/prfs/prf.c crypto/prfs/mac_prf.c crypto/pkcs5.c \
crypto/rngs/rng.c crypto/prf_plus.c crypto/signers/signer.c \
@@ -69,7 +69,7 @@ asn1/asn1.h asn1/asn1_parser.h asn1/oid.h bio/bio_reader.h bio/bio_writer.h \
collections/blocking_queue.h collections/enumerator.h collections/hashtable.h \
collections/linked_list.h collections/array.h collections/dictionary.h \
crypto/crypters/crypter.h crypto/hashers/hasher.h \
crypto/hashers/hash_algorithm_set.h crypto/mac.h \
crypto/hashers/hash_algorithm_set.h crypto/mac.h crypto/proposal/proposal.h \
crypto/proposal/proposal_keywords.h crypto/proposal/proposal_keywords_static.h \
crypto/prfs/prf.h crypto/prfs/mac_prf.h crypto/rngs/rng.h crypto/nonce_gen.h \
crypto/prf_plus.h crypto/signers/signer.h crypto/signers/mac_signer.h \
@@ -19,7 +19,6 @@
#include "proposal.h"
#include <daemon.h>
#include <collections/array.h>
#include <utils/identification.h>
@@ -16,7 +16,7 @@
/**
* @defgroup proposal proposal
* @{ @ingroup config
* @{ @ingroup crypto
*/
#ifndef PROPOSAL_H_
@@ -37,7 +37,7 @@
/**
* @defgroup proposal_keywords proposal_keywords
* @{ @ingroup crypto
* @{ @ingroup proposal
*/
#ifndef PROPOSAL_KEYWORDS_H_
+3
View File
@@ -26,6 +26,7 @@
#include <collections/hashtable.h>
#include <utils/backtrace.h>
#include <selectors/traffic_selector.h>
#include <crypto/proposal/proposal.h>
#define CHECKSUM_LIBRARY IPSEC_LIB_DIR"/libchecksum.so"
@@ -369,6 +370,8 @@ bool library_init(char *settings, const char *namespace)
PRINTF_HOOK_ARGTYPE_POINTER, PRINTF_HOOK_ARGTYPE_END);
pfh->add_handler(pfh, 'R', traffic_selector_printf_hook,
PRINTF_HOOK_ARGTYPE_POINTER, PRINTF_HOOK_ARGTYPE_END);
pfh->add_handler(pfh, 'P', proposal_printf_hook,
PRINTF_HOOK_ARGTYPE_POINTER, PRINTF_HOOK_ARGTYPE_END);
this->objects = hashtable_create((hashtable_hash_t)hash,
(hashtable_equals_t)equals, 4);
+1
View File
@@ -47,6 +47,7 @@ libstrongswan_tests_SOURCES = tests.h tests.c \
suites/test_auth_cfg.c \
suites/test_hasher.c \
suites/test_crypter.c \
suites/test_proposal.c \
suites/test_crypto_factory.c \
suites/test_iv_gen.c \
suites/test_pen.c \
@@ -15,7 +15,7 @@
#include "test_suite.h"
#include <config/proposal.h>
#include <crypto/proposal/proposal.h>
static struct {
protocol_id_t proto;
+1
View File
@@ -40,6 +40,7 @@ TEST_SUITE(printf_suite_create)
TEST_SUITE(auth_cfg_suite_create)
TEST_SUITE(hasher_suite_create)
TEST_SUITE(crypter_suite_create)
TEST_SUITE(proposal_suite_create)
TEST_SUITE(crypto_factory_suite_create)
TEST_SUITE_DEPEND(iv_gen_suite_create, RNG, RNG_STRONG)
TEST_SUITE(pen_suite_create)