]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
proposal: Move proposal_t from libcharon to libstrongswan
authorTobias Brunner <tobias@strongswan.org>
Fri, 17 Nov 2017 16:15:14 +0000 (17:15 +0100)
committerTobias Brunner <tobias@strongswan.org>
Fri, 17 Nov 2017 17:09:54 +0000 (18:09 +0100)
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).

26 files changed:
src/charon-tkm/tests/keymat_tests.c
src/conftest/hooks/custom_proposal.c
src/libcharon/Android.mk
src/libcharon/Makefile.am
src/libcharon/config/child_cfg.h
src/libcharon/config/ike_cfg.h
src/libcharon/config/peer_cfg.h
src/libcharon/daemon.c
src/libcharon/encoding/payloads/proposal_substructure.h
src/libcharon/encoding/payloads/transform_substructure.h
src/libcharon/processing/jobs/delete_child_sa_job.h
src/libcharon/processing/jobs/rekey_child_sa_job.h
src/libcharon/processing/jobs/update_sa_job.h
src/libcharon/sa/child_sa.h
src/libcharon/sa/keymat.h
src/libcharon/tests/Makefile.am
src/libcharon/tests/libcharon_tests.h
src/libstrongswan/Android.mk
src/libstrongswan/Makefile.am
src/libstrongswan/crypto/proposal/proposal.c [moved from src/libcharon/config/proposal.c with 99% similarity]
src/libstrongswan/crypto/proposal/proposal.h [moved from src/libcharon/config/proposal.h with 99% similarity]
src/libstrongswan/crypto/proposal/proposal_keywords.h
src/libstrongswan/library.c
src/libstrongswan/tests/Makefile.am
src/libstrongswan/tests/suites/test_proposal.c [moved from src/libcharon/tests/suites/test_proposal.c with 99% similarity]
src/libstrongswan/tests/tests.h

index 8bba1f9d9bf56609c8fa42d4f6a7ba37c3f3e5ee..d4751f7d075a1ec391983dfe1031ae45ddbc7d36 100644 (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>
 
index c4f8385c0d6e6a9a8c09fb70cb282a628fb6ded4..5e1cec089c9217f8dc7c7cc3904f67fe9fafe825 100644 (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;
 
index f381860b90bbf142efa4101d67b86d77a8aa9793..d1fb33702e41bdcf3aa02c72701d841e53e2dbed 100644 (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 \
index 964a19ec86deab89c5f9124c6f0ac60b69d5fff7..fe28f1eadb395b2c8d5383418f03a23b92b17eba 100644 (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 \
index 93904ec71d6136807d60873a51a40ee1fd3f9f09..e2834fa8fb96d5fac301fb8647c3cf7c0111b14e 100644 (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>
 
 /**
index 034996f601f1cfa06077ec28d2ce96c172b98cd7..3020244431073232291f52732ba48de533f1f58a 100644 (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>
 
 /**
index b294ae72f7fb6fbb9fc15e32a0efa3df9fd23adf..6074a7cd44ae06568f5db3df528121e12391ceef 100644 (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>
index 7c9f83d1208edc8043529d3b7e741ef953a7d10c..e4b81971058aecd6ad3d9c3d954cea9c4c3b98dd 100644 (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))
        {
index 796c10890573739bde0ceba3aecdd5cf7da760d7..cad597e58b31f2ba419a80318a48712e91216b75 100644 (file)
@@ -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>
index cb75f1ea7df9eb9d3fbf8b5419f478dfe24312dc..a9d4f9f7d869a10af7a25232409ea3a3f1523593 100644 (file)
@@ -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.
index b2d5a11f67fcf8924e72b72be6f9bc385047c083..b33ea617bc3bfe56ba97e7c2541706c8b09ef30c 100644 (file)
@@ -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>
 
 
 /**
index 1de06fd0754f62c5ae9133a90637fec36d81b19f..1c9d9b400d6e699eb1aca085f11846b92879fe8c 100644 (file)
@@ -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_ @}*/
index ed978dc8bff469d314b814c688a9060e721adf4b..17beb68b69c69466d200b635a04fa3606b0f1df7 100644 (file)
@@ -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.
index 082404d93908138ea642a1ae7ec66a5fff9d9671..85c1a42cff7890e81da8f3efec4e969b4dc3a755 100644 (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>
 
 /**
index bc40b3d92a8bbac4e95dac97b6c7b1022923fca6..17d2efe375ec6714e1efc48030390ef0b50c446b 100644 (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>
 
index 8f762a2e6ee882cd8a0cdc2f07565142d2de0738..5ebd0456ccfda301fe5edc2a71df21b7917023f6 100644 (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 \
index f770f464df1022e618a0969e257dc058787511e4..d17ea041d8eb7bc616d3f4bf7e0f6554a6353ea5 100644 (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)
index 0247add964529fe9449e2d10080784c2c3ebcaa3..fb7c62a8a8c595452950720e7a74dc6c0fe6367a 100644 (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 \
index a9759aeee1d15f698bcc502e58016d56e7e4aee6..66539a8797b90e1b651099e67b71967819583d73 100644 (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 \
similarity index 99%
rename from src/libcharon/config/proposal.c
rename to src/libstrongswan/crypto/proposal/proposal.c
index 46c3c9400a03971b92485ba2bb92e136d482741f..221375f7b8faa71456f883873282fe63b85ec402 100644 (file)
@@ -19,7 +19,6 @@
 
 #include "proposal.h"
 
-#include <daemon.h>
 #include <collections/array.h>
 #include <utils/identification.h>
 
similarity index 99%
rename from src/libcharon/config/proposal.h
rename to src/libstrongswan/crypto/proposal/proposal.h
index 0dc70f4c5ea62fdc7545359c9fa716a805c56b7b..d9a2af79fc29e52f7d26c61e6dd7b7ec37a407a6 100644 (file)
@@ -16,7 +16,7 @@
 
 /**
  * @defgroup proposal proposal
- * @{ @ingroup config
+ * @{ @ingroup crypto
  */
 
 #ifndef PROPOSAL_H_
index 856abdce6e09da46964ea9d1e6b3f7125ffc770e..b062221e50ad47a3aad38d83994a93fc342ae084 100644 (file)
@@ -37,7 +37,7 @@
 
 /**
  * @defgroup proposal_keywords proposal_keywords
- * @{ @ingroup crypto
+ * @{ @ingroup proposal
  */
 
 #ifndef PROPOSAL_KEYWORDS_H_
index 7944b9356d8e76fa519d7db7e45707d3d593ee86..dbdf5cfe9b5a2ac01cbc952f96e0a37f2a8141da 100644 (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);
index 07f5eb5f2d778d0442f6b1b3f7579500fa64199a..5737e7a17deff2850049ac4ccdc434e5998a225a 100644 (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 \
similarity index 99%
rename from src/libcharon/tests/suites/test_proposal.c
rename to src/libstrongswan/tests/suites/test_proposal.c
index f1591794a1769fddc99539c4eaa0538210f23ab0..91766266d0ebfb8ba6050c226680370d93fd3acf 100644 (file)
@@ -15,7 +15,7 @@
 
 #include "test_suite.h"
 
-#include <config/proposal.h>
+#include <crypto/proposal/proposal.h>
 
 static struct {
        protocol_id_t proto;
index 525bdeb94c1e2c480eb9086d02a941faca1860f0..5fab227f229ea89b96a05bf1d62f2e8c4911ca40 100644 (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)