../svn-commit.tmp
authorMartin Willi <martin@strongswan.org>
Wed, 5 Apr 2006 12:10:50 +0000 (12:10 -0000)
committerMartin Willi <martin@strongswan.org>
Wed, 5 Apr 2006 12:10:50 +0000 (12:10 -0000)
303 files changed:
Source/Doxyfile [new file with mode: 0644]
Source/Makefile [new file with mode: 0644]
Source/charon.kdevelop [new file with mode: 0644]
Source/charon/Doxyfile [deleted file]
Source/charon/Makefile [deleted file]
Source/charon/Makefile.charon [new file with mode: 0644]
Source/charon/asn1/Makefile.asn1 [deleted file]
Source/charon/asn1/asn1.c [deleted file]
Source/charon/asn1/asn1.h [deleted file]
Source/charon/asn1/der_decoder.c [deleted file]
Source/charon/asn1/der_decoder.h [deleted file]
Source/charon/asn1/der_encoder.c [deleted file]
Source/charon/asn1/der_encoder.h [deleted file]
Source/charon/charon-support.patch [deleted file]
Source/charon/config/Makefile.config
Source/charon/config/connection.h
Source/charon/config/credential_store.h
Source/charon/config/proposal.h
Source/charon/config/traffic_selector.h
Source/charon/daemon.h
Source/charon/definitions.c [deleted file]
Source/charon/definitions.h [deleted file]
Source/charon/doc/Architecture.txt [deleted file]
Source/charon/doc/Todo-list.txt [deleted file]
Source/charon/encoding/Makefile.encoding
Source/charon/encoding/message.h
Source/charon/encoding/payloads/Makefile.payloads
Source/charon/encoding/payloads/encryption_payload.c
Source/charon/encoding/payloads/encryption_payload.h
Source/charon/encoding/payloads/traffic_selector_substructure.h
Source/charon/encoding/payloads/transform_substructure.h
Source/charon/network/Makefile.network
Source/charon/network/host.c [deleted file]
Source/charon/network/host.h [deleted file]
Source/charon/network/packet.h
Source/charon/queues/Makefile.queues
Source/charon/queues/jobs/Makefile.jobs
Source/charon/sa/Makefile.sa
Source/charon/sa/child_sa.h
Source/charon/sa/ike_sa.c
Source/charon/sa/ike_sa.h
Source/charon/sa/states/Makefile.states
Source/charon/sa/states/ike_auth_requested.c
Source/charon/sa/states/ike_sa_init_requested.c
Source/charon/sa/states/ike_sa_init_requested.h
Source/charon/sa/states/ike_sa_init_responded.c
Source/charon/sa/states/initiator_init.c
Source/charon/sa/states/responder_init.c
Source/charon/stroke.c [deleted file]
Source/charon/stroke.h [deleted file]
Source/charon/testcases/Makefile.testcases [deleted file]
Source/charon/testcases/aes_cbc_crypter_test.c [deleted file]
Source/charon/testcases/aes_cbc_crypter_test.h [deleted file]
Source/charon/testcases/certificate_test.c [deleted file]
Source/charon/testcases/certificate_test.h [deleted file]
Source/charon/testcases/child_sa_test.c [deleted file]
Source/charon/testcases/child_sa_test.h [deleted file]
Source/charon/testcases/connection_test.c [deleted file]
Source/charon/testcases/connection_test.h [deleted file]
Source/charon/testcases/der_decoder_test.c [deleted file]
Source/charon/testcases/der_decoder_test.h [deleted file]
Source/charon/testcases/diffie_hellman_test.c [deleted file]
Source/charon/testcases/diffie_hellman_test.h [deleted file]
Source/charon/testcases/encryption_payload_test.c [deleted file]
Source/charon/testcases/encryption_payload_test.h [deleted file]
Source/charon/testcases/event_queue_test.c [deleted file]
Source/charon/testcases/event_queue_test.h [deleted file]
Source/charon/testcases/generator_test.c [deleted file]
Source/charon/testcases/generator_test.h [deleted file]
Source/charon/testcases/hasher_test.c [deleted file]
Source/charon/testcases/hasher_test.h [deleted file]
Source/charon/testcases/hmac_signer_test.c [deleted file]
Source/charon/testcases/hmac_signer_test.h [deleted file]
Source/charon/testcases/hmac_test.c [deleted file]
Source/charon/testcases/hmac_test.h [deleted file]
Source/charon/testcases/ike_sa_id_test.c [deleted file]
Source/charon/testcases/ike_sa_id_test.h [deleted file]
Source/charon/testcases/ike_sa_manager_test.c [deleted file]
Source/charon/testcases/ike_sa_manager_test.h [deleted file]
Source/charon/testcases/ike_sa_test.c [deleted file]
Source/charon/testcases/ike_sa_test.h [deleted file]
Source/charon/testcases/job_queue_test.c [deleted file]
Source/charon/testcases/job_queue_test.h [deleted file]
Source/charon/testcases/kernel_interface_test.c [deleted file]
Source/charon/testcases/kernel_interface_test.h [deleted file]
Source/charon/testcases/linked_list_test.c [deleted file]
Source/charon/testcases/linked_list_test.h [deleted file]
Source/charon/testcases/packet_test.c [deleted file]
Source/charon/testcases/packet_test.h [deleted file]
Source/charon/testcases/parser_test.c [deleted file]
Source/charon/testcases/parser_test.h [deleted file]
Source/charon/testcases/policy_test.c [deleted file]
Source/charon/testcases/policy_test.h [deleted file]
Source/charon/testcases/prf_plus_test.c [deleted file]
Source/charon/testcases/prf_plus_test.h [deleted file]
Source/charon/testcases/proposal_test.c [deleted file]
Source/charon/testcases/proposal_test.h [deleted file]
Source/charon/testcases/receiver_test.c [deleted file]
Source/charon/testcases/receiver_test.h [deleted file]
Source/charon/testcases/rsa_test.c [deleted file]
Source/charon/testcases/rsa_test.h [deleted file]
Source/charon/testcases/scheduler_test.c [deleted file]
Source/charon/testcases/scheduler_test.h [deleted file]
Source/charon/testcases/send_queue_test.c [deleted file]
Source/charon/testcases/send_queue_test.h [deleted file]
Source/charon/testcases/sender_test.c [deleted file]
Source/charon/testcases/sender_test.h [deleted file]
Source/charon/testcases/socket_test.c [deleted file]
Source/charon/testcases/socket_test.h [deleted file]
Source/charon/testcases/testcases.c [deleted file]
Source/charon/testcases/thread_pool_test.c [deleted file]
Source/charon/testcases/thread_pool_test.h [deleted file]
Source/charon/threads/Makefile.threads
Source/charon/threads/kernel_interface.h
Source/charon/threads/stroke_interface.c
Source/charon/transforms/Makefile.transforms [deleted file]
Source/charon/transforms/certificate.c [deleted file]
Source/charon/transforms/certificate.h [deleted file]
Source/charon/transforms/crypters/Makefile.crypters [deleted file]
Source/charon/transforms/crypters/aes_cbc_crypter.c [deleted file]
Source/charon/transforms/crypters/aes_cbc_crypter.h [deleted file]
Source/charon/transforms/crypters/crypter.c [deleted file]
Source/charon/transforms/crypters/crypter.h [deleted file]
Source/charon/transforms/diffie_hellman.c [deleted file]
Source/charon/transforms/diffie_hellman.h [deleted file]
Source/charon/transforms/hashers/Makefile.hashers [deleted file]
Source/charon/transforms/hashers/hasher.c [deleted file]
Source/charon/transforms/hashers/hasher.h [deleted file]
Source/charon/transforms/hashers/md5_hasher.c [deleted file]
Source/charon/transforms/hashers/md5_hasher.h [deleted file]
Source/charon/transforms/hashers/sha1_hasher.c [deleted file]
Source/charon/transforms/hashers/sha1_hasher.h [deleted file]
Source/charon/transforms/hmac.c [deleted file]
Source/charon/transforms/hmac.h [deleted file]
Source/charon/transforms/prf_plus.c [deleted file]
Source/charon/transforms/prf_plus.h [deleted file]
Source/charon/transforms/prfs/Makefile.prfs [deleted file]
Source/charon/transforms/prfs/hmac_prf.c [deleted file]
Source/charon/transforms/prfs/hmac_prf.h [deleted file]
Source/charon/transforms/prfs/prf.c [deleted file]
Source/charon/transforms/prfs/prf.h [deleted file]
Source/charon/transforms/rsa/Makefile.rsa [deleted file]
Source/charon/transforms/rsa/rsa_private_key.c [deleted file]
Source/charon/transforms/rsa/rsa_private_key.h [deleted file]
Source/charon/transforms/rsa/rsa_public_key.c [deleted file]
Source/charon/transforms/rsa/rsa_public_key.h [deleted file]
Source/charon/transforms/signers/Makefile.signers [deleted file]
Source/charon/transforms/signers/hmac_signer.c [deleted file]
Source/charon/transforms/signers/hmac_signer.h [deleted file]
Source/charon/transforms/signers/signer.c [deleted file]
Source/charon/transforms/signers/signer.h [deleted file]
Source/charon/types.c [deleted file]
Source/charon/types.h [deleted file]
Source/charon/utils/Makefile.utils [deleted file]
Source/charon/utils/allocator.c [deleted file]
Source/charon/utils/allocator.h [deleted file]
Source/charon/utils/identification.c [deleted file]
Source/charon/utils/identification.h [deleted file]
Source/charon/utils/iterator.h [deleted file]
Source/charon/utils/linked_list.c [deleted file]
Source/charon/utils/linked_list.h [deleted file]
Source/charon/utils/logger.c [deleted file]
Source/charon/utils/logger.h [deleted file]
Source/charon/utils/logger_manager.c [deleted file]
Source/charon/utils/logger_manager.h [deleted file]
Source/charon/utils/randomizer.c [deleted file]
Source/charon/utils/randomizer.h [deleted file]
Source/charon/utils/tester.c [deleted file]
Source/charon/utils/tester.h [deleted file]
Source/doc/Architecture.txt [new file with mode: 0644]
Source/doc/Known-bugs.txt [new file with mode: 0644]
Source/doc/Todo-list.txt [new file with mode: 0644]
Source/lib/Makefile.lib [new file with mode: 0644]
Source/lib/asn1/Makefile.asn1 [new file with mode: 0644]
Source/lib/asn1/asn1.c [new file with mode: 0644]
Source/lib/asn1/asn1.h [new file with mode: 0644]
Source/lib/asn1/der_decoder.c [new file with mode: 0644]
Source/lib/asn1/der_decoder.h [new file with mode: 0644]
Source/lib/asn1/der_encoder.c [new file with mode: 0644]
Source/lib/asn1/der_encoder.h [new file with mode: 0644]
Source/lib/crypto/Makefile.transforms [new file with mode: 0644]
Source/lib/crypto/certificate.c [new file with mode: 0755]
Source/lib/crypto/certificate.h [new file with mode: 0755]
Source/lib/crypto/crypters/Makefile.crypters [new file with mode: 0644]
Source/lib/crypto/crypters/aes_cbc_crypter.c [new file with mode: 0644]
Source/lib/crypto/crypters/aes_cbc_crypter.h [new file with mode: 0644]
Source/lib/crypto/crypters/crypter.c [new file with mode: 0644]
Source/lib/crypto/crypters/crypter.h [new file with mode: 0644]
Source/lib/crypto/diffie_hellman.c [new file with mode: 0644]
Source/lib/crypto/diffie_hellman.h [new file with mode: 0644]
Source/lib/crypto/hashers/Makefile.hashers [new file with mode: 0644]
Source/lib/crypto/hashers/hasher.c [new file with mode: 0644]
Source/lib/crypto/hashers/hasher.h [new file with mode: 0644]
Source/lib/crypto/hashers/md5_hasher.c [new file with mode: 0644]
Source/lib/crypto/hashers/md5_hasher.h [new file with mode: 0644]
Source/lib/crypto/hashers/sha1_hasher.c [new file with mode: 0644]
Source/lib/crypto/hashers/sha1_hasher.h [new file with mode: 0644]
Source/lib/crypto/hmac.c [new file with mode: 0644]
Source/lib/crypto/hmac.h [new file with mode: 0644]
Source/lib/crypto/prf_plus.c [new file with mode: 0644]
Source/lib/crypto/prf_plus.h [new file with mode: 0644]
Source/lib/crypto/prfs/Makefile.prfs [new file with mode: 0644]
Source/lib/crypto/prfs/hmac_prf.c [new file with mode: 0644]
Source/lib/crypto/prfs/hmac_prf.h [new file with mode: 0644]
Source/lib/crypto/prfs/prf.c [new file with mode: 0644]
Source/lib/crypto/prfs/prf.h [new file with mode: 0644]
Source/lib/crypto/rsa/Makefile.rsa [new file with mode: 0644]
Source/lib/crypto/rsa/rsa_private_key.c [new file with mode: 0644]
Source/lib/crypto/rsa/rsa_private_key.h [new file with mode: 0644]
Source/lib/crypto/rsa/rsa_public_key.c [new file with mode: 0644]
Source/lib/crypto/rsa/rsa_public_key.h [new file with mode: 0644]
Source/lib/crypto/signers/Makefile.signers [new file with mode: 0644]
Source/lib/crypto/signers/hmac_signer.c [new file with mode: 0644]
Source/lib/crypto/signers/hmac_signer.h [new file with mode: 0644]
Source/lib/crypto/signers/signer.c [new file with mode: 0644]
Source/lib/crypto/signers/signer.h [new file with mode: 0644]
Source/lib/definitions.c [new file with mode: 0644]
Source/lib/definitions.h [new file with mode: 0644]
Source/lib/types.c [new file with mode: 0644]
Source/lib/types.h [new file with mode: 0644]
Source/lib/utils/Makefile.utils [new file with mode: 0644]
Source/lib/utils/allocator.c [new file with mode: 0644]
Source/lib/utils/allocator.h [new file with mode: 0644]
Source/lib/utils/host.c [new file with mode: 0644]
Source/lib/utils/host.h [new file with mode: 0644]
Source/lib/utils/identification.c [new file with mode: 0644]
Source/lib/utils/identification.h [new file with mode: 0644]
Source/lib/utils/iterator.h [new file with mode: 0644]
Source/lib/utils/linked_list.c [new file with mode: 0644]
Source/lib/utils/linked_list.h [new file with mode: 0644]
Source/lib/utils/logger.c [new file with mode: 0644]
Source/lib/utils/logger.h [new file with mode: 0644]
Source/lib/utils/logger_manager.c [new file with mode: 0644]
Source/lib/utils/logger_manager.h [new file with mode: 0644]
Source/lib/utils/randomizer.c [new file with mode: 0644]
Source/lib/utils/randomizer.h [new file with mode: 0644]
Source/lib/utils/tester.c [new file with mode: 0644]
Source/lib/utils/tester.h [new file with mode: 0644]
Source/stroke/Makefile.stroke [new file with mode: 0644]
Source/stroke/stroke.c [new file with mode: 0644]
Source/stroke/stroke.h [new file with mode: 0644]
Source/testing/Makefile.testcases [new file with mode: 0644]
Source/testing/aes_cbc_crypter_test.c [new file with mode: 0644]
Source/testing/aes_cbc_crypter_test.h [new file with mode: 0644]
Source/testing/certificate_test.c [new file with mode: 0644]
Source/testing/certificate_test.h [new file with mode: 0644]
Source/testing/child_sa_test.c [new file with mode: 0644]
Source/testing/child_sa_test.h [new file with mode: 0644]
Source/testing/connection_test.c [new file with mode: 0644]
Source/testing/connection_test.h [new file with mode: 0644]
Source/testing/der_decoder_test.c [new file with mode: 0644]
Source/testing/der_decoder_test.h [new file with mode: 0644]
Source/testing/diffie_hellman_test.c [new file with mode: 0644]
Source/testing/diffie_hellman_test.h [new file with mode: 0644]
Source/testing/encryption_payload_test.c [new file with mode: 0644]
Source/testing/encryption_payload_test.h [new file with mode: 0644]
Source/testing/event_queue_test.c [new file with mode: 0644]
Source/testing/event_queue_test.h [new file with mode: 0644]
Source/testing/generator_test.c [new file with mode: 0644]
Source/testing/generator_test.h [new file with mode: 0644]
Source/testing/hasher_test.c [new file with mode: 0644]
Source/testing/hasher_test.h [new file with mode: 0644]
Source/testing/hmac_signer_test.c [new file with mode: 0644]
Source/testing/hmac_signer_test.h [new file with mode: 0644]
Source/testing/hmac_test.c [new file with mode: 0644]
Source/testing/hmac_test.h [new file with mode: 0644]
Source/testing/ike_sa_id_test.c [new file with mode: 0644]
Source/testing/ike_sa_id_test.h [new file with mode: 0644]
Source/testing/ike_sa_manager_test.c [new file with mode: 0644]
Source/testing/ike_sa_manager_test.h [new file with mode: 0644]
Source/testing/ike_sa_test.c [new file with mode: 0644]
Source/testing/ike_sa_test.h [new file with mode: 0644]
Source/testing/job_queue_test.c [new file with mode: 0644]
Source/testing/job_queue_test.h [new file with mode: 0644]
Source/testing/kernel_interface_test.c [new file with mode: 0644]
Source/testing/kernel_interface_test.h [new file with mode: 0644]
Source/testing/linked_list_test.c [new file with mode: 0644]
Source/testing/linked_list_test.h [new file with mode: 0644]
Source/testing/packet_test.c [new file with mode: 0644]
Source/testing/packet_test.h [new file with mode: 0644]
Source/testing/parser_test.c [new file with mode: 0644]
Source/testing/parser_test.h [new file with mode: 0644]
Source/testing/policy_test.c [new file with mode: 0644]
Source/testing/policy_test.h [new file with mode: 0644]
Source/testing/prf_plus_test.c [new file with mode: 0644]
Source/testing/prf_plus_test.h [new file with mode: 0644]
Source/testing/proposal_test.c [new file with mode: 0644]
Source/testing/proposal_test.h [new file with mode: 0644]
Source/testing/receiver_test.c [new file with mode: 0644]
Source/testing/receiver_test.h [new file with mode: 0644]
Source/testing/rsa_test.c [new file with mode: 0644]
Source/testing/rsa_test.h [new file with mode: 0644]
Source/testing/scheduler_test.c [new file with mode: 0644]
Source/testing/scheduler_test.h [new file with mode: 0644]
Source/testing/send_queue_test.c [new file with mode: 0644]
Source/testing/send_queue_test.h [new file with mode: 0644]
Source/testing/sender_test.c [new file with mode: 0644]
Source/testing/sender_test.h [new file with mode: 0644]
Source/testing/socket_test.c [new file with mode: 0644]
Source/testing/socket_test.h [new file with mode: 0644]
Source/testing/testcases.c [new file with mode: 0644]
Source/testing/thread_pool_test.c [new file with mode: 0644]
Source/testing/thread_pool_test.h [new file with mode: 0644]

diff --git a/Source/Doxyfile b/Source/Doxyfile
new file mode 100644 (file)
index 0000000..f9481b3
--- /dev/null
@@ -0,0 +1,220 @@
+# Doxyfile 1.4.1-KDevelop
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+PROJECT_NAME = "charon - IKEv2 for strongSwan"
+PROJECT_NUMBER = 1.0
+OUTPUT_DIRECTORY = doc/api
+CREATE_SUBDIRS = NO
+OUTPUT_LANGUAGE = English
+USE_WINDOWS_ENCODING = NO
+BRIEF_MEMBER_DESC = YES
+REPEAT_BRIEF = YES
+ABBREVIATE_BRIEF = 
+ALWAYS_DETAILED_SEC = NO
+INLINE_INHERITED_MEMB = NO
+FULL_PATH_NAMES = YES
+STRIP_FROM_PATH = 
+STRIP_FROM_INC_PATH = 
+SHORT_NAMES = NO
+JAVADOC_AUTOBRIEF = YES
+MULTILINE_CPP_IS_BRIEF = NO
+DETAILS_AT_TOP = YES
+INHERIT_DOCS = YES
+DISTRIBUTE_GROUP_DOC = NO
+TAB_SIZE = 1
+ALIASES = 
+OPTIMIZE_OUTPUT_FOR_C = NO
+OPTIMIZE_OUTPUT_JAVA = NO
+SUBGROUPING = YES
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+EXTRACT_ALL = NO
+EXTRACT_PRIVATE = NO
+EXTRACT_STATIC = NO
+EXTRACT_LOCAL_CLASSES = NO
+EXTRACT_LOCAL_METHODS = NO
+HIDE_UNDOC_MEMBERS = NO
+HIDE_UNDOC_CLASSES = NO
+HIDE_FRIEND_COMPOUNDS = NO
+HIDE_IN_BODY_DOCS = NO
+INTERNAL_DOCS = NO
+CASE_SENSE_NAMES = YES
+HIDE_SCOPE_NAMES = NO
+SHOW_INCLUDE_FILES = YES
+INLINE_INFO = YES
+SORT_MEMBER_DOCS = YES
+SORT_BRIEF_DOCS = NO
+SORT_BY_SCOPE_NAME = NO
+GENERATE_TODOLIST = YES
+GENERATE_TESTLIST = NO
+GENERATE_BUGLIST = YES
+GENERATE_DEPRECATEDLIST = YES
+ENABLED_SECTIONS = 
+MAX_INITIALIZER_LINES = 30
+SHOW_USED_FILES = YES
+SHOW_DIRECTORIES = NO
+FILE_VERSION_FILTER = 
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET = NO
+WARNINGS = YES
+WARN_IF_UNDOCUMENTED = YES
+WARN_IF_DOC_ERROR = YES
+WARN_NO_PARAMDOC = NO
+WARN_FORMAT = "$file:$line: $text"
+WARN_LOGFILE = 
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT = ./
+FILE_PATTERNS = *.h
+RECURSIVE = YES
+EXCLUDE = 
+EXCLUDE_SYMLINKS = NO
+EXCLUDE_PATTERNS = 
+EXAMPLE_PATH = 
+EXAMPLE_PATTERNS = 
+EXAMPLE_RECURSIVE = NO
+IMAGE_PATH = 
+INPUT_FILTER = 
+FILTER_PATTERNS = 
+FILTER_SOURCE_FILES = NO
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+SOURCE_BROWSER = NO
+INLINE_SOURCES = NO
+STRIP_CODE_COMMENTS = YES
+REFERENCED_BY_RELATION = NO
+REFERENCES_RELATION = NO
+VERBATIM_HEADERS = YES
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+ALPHABETICAL_INDEX = NO
+COLS_IN_ALPHA_INDEX = 5
+IGNORE_PREFIX = 
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+GENERATE_HTML = YES
+HTML_OUTPUT = .
+HTML_FILE_EXTENSION = .html
+HTML_HEADER = 
+HTML_FOOTER = 
+HTML_STYLESHEET = 
+HTML_ALIGN_MEMBERS = YES
+GENERATE_HTMLHELP = NO
+CHM_FILE = 
+HHC_LOCATION = 
+GENERATE_CHI = NO
+BINARY_TOC = NO
+TOC_EXPAND = NO
+DISABLE_INDEX = YES
+ENUM_VALUES_PER_LINE = 1
+GENERATE_TREEVIEW = YES
+TREEVIEW_WIDTH = 250
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+GENERATE_LATEX = NO
+LATEX_OUTPUT = latex
+LATEX_CMD_NAME = latex
+MAKEINDEX_CMD_NAME = makeindex
+COMPACT_LATEX = NO
+PAPER_TYPE = a4wide
+EXTRA_PACKAGES = 
+LATEX_HEADER = 
+PDF_HYPERLINKS = NO
+USE_PDFLATEX = NO
+LATEX_BATCHMODE = NO
+LATEX_HIDE_INDICES = NO
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+GENERATE_RTF = NO
+RTF_OUTPUT = rtf
+COMPACT_RTF = NO
+RTF_HYPERLINKS = NO
+RTF_STYLESHEET_FILE = 
+RTF_EXTENSIONS_FILE = 
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+GENERATE_MAN = NO
+MAN_OUTPUT = man
+MAN_EXTENSION = .3
+MAN_LINKS = YES
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+GENERATE_XML = NO
+XML_OUTPUT = xml
+XML_SCHEMA = 
+XML_DTD = 
+XML_PROGRAMLISTING = YES
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+GENERATE_AUTOGEN_DEF = NO
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+GENERATE_PERLMOD = NO
+PERLMOD_LATEX = NO
+PERLMOD_PRETTY = YES
+PERLMOD_MAKEVAR_PREFIX = 
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor   
+#---------------------------------------------------------------------------
+ENABLE_PREPROCESSING = YES
+MACRO_EXPANSION = YES
+EXPAND_ONLY_PREDEF = NO
+SEARCH_INCLUDES = YES
+INCLUDE_PATH = 
+INCLUDE_FILE_PATTERNS = 
+PREDEFINED = LEAK_DETECTIVE
+EXPAND_AS_DEFINED = 
+SKIP_FUNCTION_MACROS = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references   
+#---------------------------------------------------------------------------
+TAGFILES = 
+GENERATE_TAGFILE = 
+ALLEXTERNALS = NO
+EXTERNAL_GROUPS = YES
+PERL_PATH = /usr/bin/perl
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool   
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS = YES
+HIDE_UNDOC_RELATIONS = YES
+HAVE_DOT = NO
+CLASS_GRAPH = YES
+COLLABORATION_GRAPH = YES
+GROUP_GRAPHS = YES
+UML_LOOK = NO
+TEMPLATE_RELATIONS = NO
+INCLUDE_GRAPH = YES
+INCLUDED_BY_GRAPH = YES
+CALL_GRAPH = NO
+GRAPHICAL_HIERARCHY = YES
+DIRECTORY_GRAPH = YES
+DOT_IMAGE_FORMAT = png
+DOT_PATH = 
+DOTFILE_DIRS = 
+MAX_DOT_GRAPH_WIDTH = 1024
+MAX_DOT_GRAPH_HEIGHT = 1024
+MAX_DOT_GRAPH_DEPTH = 0
+DOT_TRANSPARENT = NO
+DOT_MULTI_TARGETS = NO
+GENERATE_LEGEND = YES
+DOT_CLEANUP = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine   
+#---------------------------------------------------------------------------
+SEARCHENGINE = NO
diff --git a/Source/Makefile b/Source/Makefile
new file mode 100644 (file)
index 0000000..7a1f865
--- /dev/null
@@ -0,0 +1,88 @@
+# Copyright (C) 2005 Jan Hutter, Martin Willi
+# Hochschule fuer Technik Rapperswil
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 2 of the License, or (at your
+# option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+
+FREESWANSRCDIR=../..
+# include strongswan Makefile, if charon sits in its tree
+ifeq ($(shell ls $(FREESWANSRCDIR)/Makefile.inc 2>&1), ../../Makefile.inc)
+  include ${FREESWANSRCDIR}/Makefile.inc
+endif
+
+BUILD_DIR= ./bin/
+
+BINNAMECHARON= $(BUILD_DIR)charon
+BINNAMESTROKE= $(BUILD_DIR)stroke
+BINNAMETEST= $(BUILD_DIR)run_tests
+BINNAMELIB=  $(BUILD_DIR)libstrong.so
+
+MAIN_DIR= ./
+
+LDFLAGS= -lgmp -lpthread 
+
+CFLAGS= -Icharon -Ilib -Istroke -Wall -g -fPIC -DLEAK_DETECTIVE 
+
+# objects is extended by each included Makefile
+CHARON_OBJS=
+LIB_OBJS=
+TEST_OBJS=
+
+all :                                          programs
+
+include $(MAIN_DIR)charon/Makefile.charon
+include $(MAIN_DIR)lib/Makefile.lib
+include $(MAIN_DIR)stroke/Makefile.stroke
+include $(MAIN_DIR)testing/Makefile.testcases
+
+programs :                                     $(BINNAMECHARON) $(BINNAMESTROKE)
+
+test :                                         $(BINNAMETEST)
+                                                       LD_LIBRARY_PATH=$(BUILD_DIR) $(BINNAMETEST)
+
+run :                                          $(BINNAMECHARON)
+                                                       LD_LIBRARY_PATH=$(BUILD_DIR) $(BINNAMECHARON)
+
+apidoc : 
+                                                       doxygen Doxyfile
+
+build_dir:
+                                                       mkdir -p $(BUILD_DIR)
+                                                       
+$(BINNAMELIB) :                                build_dir $(LIB_OBJS)
+                                                       $(CC) -shared $(LIB_OBJS) $(LDFLAGS) -o $@
+
+$(BINNAMECHARON) :                     build_dir $(CHARON_OBJS) $(BINNAMELIB) $(BUILD_DIR)daemon.o
+                                                       $(CC) $(LDFLAGS) -L./bin -lstrong $(CHARON_OBJS) $(BUILD_DIR)daemon.o -o $@
+
+$(BINNAMETEST) :                       build_dir $(CHARON_OBJS) $(TEST_OBJS) $(BINNAMELIB) $(BUILD_DIR)testcases.o
+                                                       $(CC) $(LDFLAGS) -L./bin -lstrong $(CHARON_OBJS) $(TEST_OBJS) $(BUILD_DIR)testcases.o -o $@
+
+$(BINNAMESTROKE) :                     build_dir $(BINNAMELIB) $(BUILD_DIR)stroke.o
+                                                       $(CC) $(LDFLAGS) $(CFLAGS) $(BUILD_DIR)stroke.o -o $@
+
+install :                                      $(BINNAMECHARON) $(BINNAMESTROKE)
+                                                       $(INSTALL) $(INSTBINFLAGS) $(BINNAMECHARON) $(BINNAMESTROKE) $(LIBEXECDIR)
+                               
+install_file_list:
+                                                       @echo $(LIBEXECDIR)/charon
+                                                       @echo $(LIBEXECDIR)/stroke
+
+clean :                
+                                                       rm -fR $(BUILD_DIR)
+                               
+cleanall: clean
+
+distclean: clean
+
+mostlyclean: clean
+
+realclean: clean
diff --git a/Source/charon.kdevelop b/Source/charon.kdevelop
new file mode 100644 (file)
index 0000000..4ab9354
--- /dev/null
@@ -0,0 +1,102 @@
+<?xml version = '1.0'?>
+<kdevelop>
+  <general>
+    <author>Martin Willi</author>
+    <email>martin@strongswan.org</email>
+    <version>$VERSION$</version>
+    <projectmanagement>KDevCustomProject</projectmanagement>
+    <primarylanguage>C</primarylanguage>
+    <ignoreparts/>
+  </general>
+  <kdevcustomproject>
+    <run>
+      <mainprogram>Source</mainprogram>
+      <directoryradio>executable</directoryradio>
+    </run>
+  </kdevcustomproject>
+  <kdevdebugger>
+    <general>
+      <dbgshell/>
+    </general>
+  </kdevdebugger>
+  <kdevdoctreeview>
+    <ignoretocs>
+      <toc>ada</toc>
+      <toc>ada_bugs_gcc</toc>
+      <toc>bash</toc>
+      <toc>bash_bugs</toc>
+      <toc>clanlib</toc>
+      <toc>fortran_bugs_gcc</toc>
+      <toc>gnome1</toc>
+      <toc>gnustep</toc>
+      <toc>gtk</toc>
+      <toc>gtk_bugs</toc>
+      <toc>haskell</toc>
+      <toc>haskell_bugs_ghc</toc>
+      <toc>java_bugs_gcc</toc>
+      <toc>java_bugs_sun</toc>
+      <toc>kde2book</toc>
+      <toc>libstdc++</toc>
+      <toc>opengl</toc>
+      <toc>pascal_bugs_fp</toc>
+      <toc>php</toc>
+      <toc>php_bugs</toc>
+      <toc>perl</toc>
+      <toc>perl_bugs</toc>
+      <toc>python</toc>
+      <toc>python_bugs</toc>
+      <toc>qt-kdev3</toc>
+      <toc>ruby</toc>
+      <toc>ruby_bugs</toc>
+      <toc>sdl</toc>
+      <toc>stl</toc>
+      <toc>sw</toc>
+      <toc>w3c-dom-level2-html</toc>
+      <toc>w3c-svg</toc>
+      <toc>w3c-uaag10</toc>
+      <toc>wxwidgets_bugs</toc>
+    </ignoretocs>
+    <ignoreqt_xml>
+      <toc>Guide to the Qt Translation Tools</toc>
+      <toc>Qt Assistant Manual</toc>
+      <toc>Qt Designer Manual</toc>
+      <toc>Qt Reference Documentation</toc>
+      <toc>qmake User Guide</toc>
+    </ignoreqt_xml>
+    <ignoredoxygen>
+      <toc>KDE Libraries (Doxygen)</toc>
+    </ignoredoxygen>
+  </kdevdoctreeview>
+  <kdevfilecreate>
+    <filetypes/>
+    <useglobaltypes>
+      <type ext="c" />
+      <type ext="h" />
+    </useglobaltypes>
+  </kdevfilecreate>
+  <kdevcppsupport>
+    <references/>
+    <codecompletion>
+      <includeGlobalFunctions>true</includeGlobalFunctions>
+      <includeTypes>true</includeTypes>
+      <includeEnums>true</includeEnums>
+      <includeTypedefs>false</includeTypedefs>
+      <automaticCodeCompletion>true</automaticCodeCompletion>
+      <automaticArgumentsHint>true</automaticArgumentsHint>
+      <automaticHeaderCompletion>true</automaticHeaderCompletion>
+      <codeCompletionDelay>250</codeCompletionDelay>
+      <argumentsHintDelay>400</argumentsHintDelay>
+      <headerCompletionDelay>250</headerCompletionDelay>
+    </codecompletion>
+  </kdevcppsupport>
+  <kdevfileview>
+    <groups>
+      <hidenonprojectfiles>false</hidenonprojectfiles>
+      <hidenonlocation>false</hidenonlocation>
+    </groups>
+    <tree>
+      <hidepatterns>*.o,*.lo,CVS</hidepatterns>
+      <hidenonprojectfiles>false</hidenonprojectfiles>
+    </tree>
+  </kdevfileview>
+</kdevelop>
diff --git a/Source/charon/Doxyfile b/Source/charon/Doxyfile
deleted file mode 100644 (file)
index f9481b3..0000000
+++ /dev/null
@@ -1,220 +0,0 @@
-# Doxyfile 1.4.1-KDevelop
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-PROJECT_NAME = "charon - IKEv2 for strongSwan"
-PROJECT_NUMBER = 1.0
-OUTPUT_DIRECTORY = doc/api
-CREATE_SUBDIRS = NO
-OUTPUT_LANGUAGE = English
-USE_WINDOWS_ENCODING = NO
-BRIEF_MEMBER_DESC = YES
-REPEAT_BRIEF = YES
-ABBREVIATE_BRIEF = 
-ALWAYS_DETAILED_SEC = NO
-INLINE_INHERITED_MEMB = NO
-FULL_PATH_NAMES = YES
-STRIP_FROM_PATH = 
-STRIP_FROM_INC_PATH = 
-SHORT_NAMES = NO
-JAVADOC_AUTOBRIEF = YES
-MULTILINE_CPP_IS_BRIEF = NO
-DETAILS_AT_TOP = YES
-INHERIT_DOCS = YES
-DISTRIBUTE_GROUP_DOC = NO
-TAB_SIZE = 1
-ALIASES = 
-OPTIMIZE_OUTPUT_FOR_C = NO
-OPTIMIZE_OUTPUT_JAVA = NO
-SUBGROUPING = YES
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-EXTRACT_ALL = NO
-EXTRACT_PRIVATE = NO
-EXTRACT_STATIC = NO
-EXTRACT_LOCAL_CLASSES = NO
-EXTRACT_LOCAL_METHODS = NO
-HIDE_UNDOC_MEMBERS = NO
-HIDE_UNDOC_CLASSES = NO
-HIDE_FRIEND_COMPOUNDS = NO
-HIDE_IN_BODY_DOCS = NO
-INTERNAL_DOCS = NO
-CASE_SENSE_NAMES = YES
-HIDE_SCOPE_NAMES = NO
-SHOW_INCLUDE_FILES = YES
-INLINE_INFO = YES
-SORT_MEMBER_DOCS = YES
-SORT_BRIEF_DOCS = NO
-SORT_BY_SCOPE_NAME = NO
-GENERATE_TODOLIST = YES
-GENERATE_TESTLIST = NO
-GENERATE_BUGLIST = YES
-GENERATE_DEPRECATEDLIST = YES
-ENABLED_SECTIONS = 
-MAX_INITIALIZER_LINES = 30
-SHOW_USED_FILES = YES
-SHOW_DIRECTORIES = NO
-FILE_VERSION_FILTER = 
-#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-QUIET = NO
-WARNINGS = YES
-WARN_IF_UNDOCUMENTED = YES
-WARN_IF_DOC_ERROR = YES
-WARN_NO_PARAMDOC = NO
-WARN_FORMAT = "$file:$line: $text"
-WARN_LOGFILE = 
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-INPUT = ./
-FILE_PATTERNS = *.h
-RECURSIVE = YES
-EXCLUDE = 
-EXCLUDE_SYMLINKS = NO
-EXCLUDE_PATTERNS = 
-EXAMPLE_PATH = 
-EXAMPLE_PATTERNS = 
-EXAMPLE_RECURSIVE = NO
-IMAGE_PATH = 
-INPUT_FILTER = 
-FILTER_PATTERNS = 
-FILTER_SOURCE_FILES = NO
-#---------------------------------------------------------------------------
-# configuration options related to source browsing
-#---------------------------------------------------------------------------
-SOURCE_BROWSER = NO
-INLINE_SOURCES = NO
-STRIP_CODE_COMMENTS = YES
-REFERENCED_BY_RELATION = NO
-REFERENCES_RELATION = NO
-VERBATIM_HEADERS = YES
-#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-ALPHABETICAL_INDEX = NO
-COLS_IN_ALPHA_INDEX = 5
-IGNORE_PREFIX = 
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-GENERATE_HTML = YES
-HTML_OUTPUT = .
-HTML_FILE_EXTENSION = .html
-HTML_HEADER = 
-HTML_FOOTER = 
-HTML_STYLESHEET = 
-HTML_ALIGN_MEMBERS = YES
-GENERATE_HTMLHELP = NO
-CHM_FILE = 
-HHC_LOCATION = 
-GENERATE_CHI = NO
-BINARY_TOC = NO
-TOC_EXPAND = NO
-DISABLE_INDEX = YES
-ENUM_VALUES_PER_LINE = 1
-GENERATE_TREEVIEW = YES
-TREEVIEW_WIDTH = 250
-#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-GENERATE_LATEX = NO
-LATEX_OUTPUT = latex
-LATEX_CMD_NAME = latex
-MAKEINDEX_CMD_NAME = makeindex
-COMPACT_LATEX = NO
-PAPER_TYPE = a4wide
-EXTRA_PACKAGES = 
-LATEX_HEADER = 
-PDF_HYPERLINKS = NO
-USE_PDFLATEX = NO
-LATEX_BATCHMODE = NO
-LATEX_HIDE_INDICES = NO
-#---------------------------------------------------------------------------
-# configuration options related to the RTF output
-#---------------------------------------------------------------------------
-GENERATE_RTF = NO
-RTF_OUTPUT = rtf
-COMPACT_RTF = NO
-RTF_HYPERLINKS = NO
-RTF_STYLESHEET_FILE = 
-RTF_EXTENSIONS_FILE = 
-#---------------------------------------------------------------------------
-# configuration options related to the man page output
-#---------------------------------------------------------------------------
-GENERATE_MAN = NO
-MAN_OUTPUT = man
-MAN_EXTENSION = .3
-MAN_LINKS = YES
-#---------------------------------------------------------------------------
-# configuration options related to the XML output
-#---------------------------------------------------------------------------
-GENERATE_XML = NO
-XML_OUTPUT = xml
-XML_SCHEMA = 
-XML_DTD = 
-XML_PROGRAMLISTING = YES
-#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-GENERATE_AUTOGEN_DEF = NO
-#---------------------------------------------------------------------------
-# configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-GENERATE_PERLMOD = NO
-PERLMOD_LATEX = NO
-PERLMOD_PRETTY = YES
-PERLMOD_MAKEVAR_PREFIX = 
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor   
-#---------------------------------------------------------------------------
-ENABLE_PREPROCESSING = YES
-MACRO_EXPANSION = YES
-EXPAND_ONLY_PREDEF = NO
-SEARCH_INCLUDES = YES
-INCLUDE_PATH = 
-INCLUDE_FILE_PATTERNS = 
-PREDEFINED = LEAK_DETECTIVE
-EXPAND_AS_DEFINED = 
-SKIP_FUNCTION_MACROS = YES
-#---------------------------------------------------------------------------
-# Configuration::additions related to external references   
-#---------------------------------------------------------------------------
-TAGFILES = 
-GENERATE_TAGFILE = 
-ALLEXTERNALS = NO
-EXTERNAL_GROUPS = YES
-PERL_PATH = /usr/bin/perl
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool   
-#---------------------------------------------------------------------------
-CLASS_DIAGRAMS = YES
-HIDE_UNDOC_RELATIONS = YES
-HAVE_DOT = NO
-CLASS_GRAPH = YES
-COLLABORATION_GRAPH = YES
-GROUP_GRAPHS = YES
-UML_LOOK = NO
-TEMPLATE_RELATIONS = NO
-INCLUDE_GRAPH = YES
-INCLUDED_BY_GRAPH = YES
-CALL_GRAPH = NO
-GRAPHICAL_HIERARCHY = YES
-DIRECTORY_GRAPH = YES
-DOT_IMAGE_FORMAT = png
-DOT_PATH = 
-DOTFILE_DIRS = 
-MAX_DOT_GRAPH_WIDTH = 1024
-MAX_DOT_GRAPH_HEIGHT = 1024
-MAX_DOT_GRAPH_DEPTH = 0
-DOT_TRANSPARENT = NO
-DOT_MULTI_TARGETS = NO
-GENERATE_LEGEND = YES
-DOT_CLEANUP = YES
-#---------------------------------------------------------------------------
-# Configuration::additions related to the search engine   
-#---------------------------------------------------------------------------
-SEARCHENGINE = NO
diff --git a/Source/charon/Makefile b/Source/charon/Makefile
deleted file mode 100644 (file)
index c4d65ca..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-# Copyright (C) 2005 Jan Hutter, Martin Willi
-# Hochschule fuer Technik Rapperswil
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2 of the License, or (at your
-# option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# for more details.
-#
-
-FREESWANSRCDIR=../..
-# include strongswan Makefile, if charon sits in its tree
-ifeq ($(shell ls $(FREESWANSRCDIR)/Makefile.inc 2>&1), ../../Makefile.inc)
-  include ${FREESWANSRCDIR}/Makefile.inc
-endif
-
-BUILD_DIR= ./bin/
-
-BINNAMECHARON= $(BUILD_DIR)charon
-BINNAMESTROKE= $(BUILD_DIR)stroke
-BINNAMETEST= $(BUILD_DIR)run_tests
-
-MAIN_DIR= ./
-
-LDFLAGS= -lgmp -lpthread
-
-CFLAGS+= -I. -O3#-Wall -g -DLEAK_DETECTIVE 
-
-# objects is extended by each included Makefile
-OBJS= 
-
-all :                  build_dir $(BINNAMECHARON) $(BINNAMESTROKE)
-
-programs :             all
-
-test :                 build_dir $(BINNAMETEST)
-                       $(BINNAMETEST)
-
-apidoc : 
-                       doxygen Doxyfile
-
-
-include $(MAIN_DIR)network/Makefile.network
-include $(MAIN_DIR)config/Makefile.config
-include $(MAIN_DIR)encoding/Makefile.encoding
-include $(MAIN_DIR)queues/Makefile.queues
-include $(MAIN_DIR)sa/Makefile.sa
-include $(MAIN_DIR)threads/Makefile.threads
-include $(MAIN_DIR)transforms/Makefile.transforms
-include $(MAIN_DIR)utils/Makefile.utils        
-include $(MAIN_DIR)asn1/Makefile.asn1  
-
-
-build_dir:
-                               mkdir -p $(BUILD_DIR)
-
-$(BUILD_DIR)daemon.o :         daemon.c daemon.h 
-                               $(CC) $(CFLAGS) -c -o $@ $<
-
-OBJS+=$(BUILD_DIR)types.o
-$(BUILD_DIR)types.o :          types.c types.h
-                               $(CC) $(CFLAGS) -c -o $@ $<
-
-OBJS+=$(BUILD_DIR)definitions.o
-$(BUILD_DIR)definitions.o :    definitions.c definitions.h
-                               $(CC) $(CFLAGS) -c -o $@ $<
-
-$(BINNAMECHARON) :             $(OBJS) $(BUILD_DIR)daemon.o
-                               $(CC) $(LDFLAGS) $(OBJS) $(BUILD_DIR)daemon.o -o $@
-
-$(BINNAMESTROKE) :             stroke.c
-                               $(CC) $(LDFLAGS) $(CFLAGS) stroke.c -o $@
-
-TEST_OBJS = $(OBJS)
-include $(MAIN_DIR)testcases/Makefile.testcases        
-
-$(BUILD_DIR)run_tests :                build_dir $(TEST_OBJS)
-                               $(CC) $(LDFLAGS) $(TEST_OBJS) -o $@
-
-install :                      $(BINNAMECHARON)
-                               $(INSTALL) $(INSTBINFLAGS) $(BINNAMECHARON) $(BINNAMESTROKE) $(LIBEXECDIR)
-                               
-install_file_list:
-                               @echo $(LIBEXECDIR)/charon
-                               @echo $(LIBEXECDIR)/stroke
-
-clean :                
-                               rm -fR $(BUILD_DIR); rm -Rf doc/api
-                               
-cleanall: clean
-
-distclean: clean
-
-mostlyclean: clean
-
-realclean: clean
diff --git a/Source/charon/Makefile.charon b/Source/charon/Makefile.charon
new file mode 100644 (file)
index 0000000..336495d
--- /dev/null
@@ -0,0 +1,25 @@
+# Copyright (C) 2006 Martin Willi
+# Hochschule fuer Technik Rapperswil
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 2 of the License, or (at your
+# option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+CHARON_DIR= $(MAIN_DIR)charon/
+
+$(BUILD_DIR)daemon.o :                 $(CHARON_DIR)daemon.c $(CHARON_DIR)daemon.h
+                                                               $(CC) $(CFLAGS) -c -o $@ $<
+
+
+include $(CHARON_DIR)network/Makefile.network
+include $(CHARON_DIR)config/Makefile.config
+include $(CHARON_DIR)encoding/Makefile.encoding
+include $(CHARON_DIR)queues/Makefile.queues
+include $(CHARON_DIR)sa/Makefile.sa
+include $(CHARON_DIR)threads/Makefile.threads
\ No newline at end of file
diff --git a/Source/charon/asn1/Makefile.asn1 b/Source/charon/asn1/Makefile.asn1
deleted file mode 100644 (file)
index 4aaedf4..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright (C) 2005 Jan Hutter, Martin Willi
-# Hochschule fuer Technik Rapperswil
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2 of the License, or (at your
-# option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# for more details.
-#
-
-ASN1_DIR= $(MAIN_DIR)asn1/
-
-
-OBJS+= $(BUILD_DIR)asn1.o
-$(BUILD_DIR)asn1.o :                                           $(ASN1_DIR)asn1.c $(ASN1_DIR)asn1.h
-                                                                                       $(CC) $(CFLAGS) -c -o $@ $<
-                                                                                       
-OBJS+= $(BUILD_DIR)der_decoder.o
-$(BUILD_DIR)der_decoder.o :                                    $(ASN1_DIR)der_decoder.c $(ASN1_DIR)der_decoder.h
-                                                                                       $(CC) $(CFLAGS) -c -o $@ $<
\ No newline at end of file
diff --git a/Source/charon/asn1/asn1.c b/Source/charon/asn1/asn1.c
deleted file mode 100644 (file)
index 0195238..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/**
- * @file asn1.c
- *
- * @brief String mappings for asn1.h
- *
- */
-
-/*
- * Copyright (C) 2006 Martin Willi
- * Hochschule fuer Technik Rapperswil
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * for more details.
- */
-
-#include "asn1.h"
-
-mapping_t asn1_type_m[] = {
-       {ASN1_END, "ASN1_END"},
-       {ASN1_BOOLEAN, "ASN1_BOOLEAN"},
-       {ASN1_INTEGER, "ASN1_INTEGER"},
-       {ASN1_BITSTRING, "ASN1_BITSTRING"},
-       {ASN1_OCTETSTRING, "ASN1_OCTETSTRING"},
-       {ASN1_NULL, "ASN1_NULL"},
-       {ASN1_OID, "ASN1_OID"},
-       {ASN1_ENUMERATED, "ASN1_ENUMERATED"},
-       {ASN1_UTF8STRING, "ASN1_UTF8STRING"},
-       {ASN1_NUMERICSTRING, "ASN1_NUMERICSTRING"},
-       {ASN1_PRINTABLESTRING, "ASN1_PRINTABLESTRING"},
-       {ASN1_T61STRING, "ASN1_T61STRING"},
-       {ASN1_VIDEOTEXSTRING, "ASN1_VIDEOTEXSTRING"},
-       {ASN1_IA5STRING, "ASN1_IA5STRING"},
-       {ASN1_UTCTIME, "ASN1_UTCTIME"},
-       {ASN1_GENERALIZEDTIME, "ASN1_GENERALIZEDTIME"},
-       {ASN1_GRAPHICSTRING, "ASN1_GRAPHICSTRING"},
-       {ASN1_VISIBLESTRING, "ASN1_VISIBLESTRING"},
-       {ASN1_GENERALSTRING, "ASN1_GENERALSTRING"},
-       {ASN1_UNIVERSALSTRING, "ASN1_UNIVERSALSTRING"},
-       {ASN1_BMPSTRING, "ASN1_BMPSTRING"},
-       {ASN1_CONSTRUCTED, "ASN1_CONSTRUCTED"},
-       {ASN1_SEQUENCE, "ASN1_SEQUENCE"},
-       {ASN1_SET, "ASN1_SET"},
-       {ASN1_TAG_E_0, "ASN1_TAG_E_0"},
-       {ASN1_TAG_E_1, "ASN1_TAG_E_1"},
-       {ASN1_TAG_E_2, "ASN1_TAG_E_2"},
-       {ASN1_TAG_E_3, "ASN1_TAG_E_3"},
-       {ASN1_TAG_E_4, "ASN1_TAG_E_4"},
-       {ASN1_TAG_E_5, "ASN1_TAG_E_5"},
-       {ASN1_TAG_E_6, "ASN1_TAG_E_6"},
-       {ASN1_TAG_E_7, "ASN1_TAG_E_7"},
-       {ASN1_TAG_I_0, "ASN1_TAG_I_0"},
-       {ASN1_TAG_I_1, "ASN1_TAG_I_1"},
-       {ASN1_TAG_I_2, "ASN1_TAG_I_2"},
-       {ASN1_TAG_I_3, "ASN1_TAG_I_3"},
-       {ASN1_TAG_I_4, "ASN1_TAG_I_4"},
-       {ASN1_TAG_I_5, "ASN1_TAG_I_5"},
-       {ASN1_TAG_I_6, "ASN1_TAG_I_6"},
-       {ASN1_TAG_I_7, "ASN1_TAG_I_7"},
-       {ASN1_CHOICE, "ASN1_CHOICE"},
-};
-
-mapping_t asn1_flag_m[] = {
-       {ASN1_OPTIONAL, "ASN1_OPTIONAL"},
-       {ASN1_DEFAULT, "ASN1_DEFAULT"},
-       {ASN1_MPZ, "ASN1_MPZ"},
-       {ASN1_OF, "ASN1_OF"},
-};
diff --git a/Source/charon/asn1/asn1.h b/Source/charon/asn1/asn1.h
deleted file mode 100644 (file)
index 894f048..0000000
+++ /dev/null
@@ -1,172 +0,0 @@
-/**
- * @file asn1.h
- *
- * @brief Definition of asn1_rule_t and other ASN1 stuff.
- *
- */
-
-/*
- * Copyright (C) 2006 Martin Willi
- * Hochschule fuer Technik Rapperswil
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * for more details.
- */
-
-#ifndef ASN1_H_
-#define ASN1_H_
-
-#include <types.h>
-
-typedef enum asn1_type_t asn1_type_t;
-
-/**
- * @brief Real and some special ASN1 types.
- * 
- * @ingroup asn1
- */
-enum asn1_type_t {
-       /**
-        * End of a sequence, set, choice
-        */
-       ASN1_END = 0x00,
-       ASN1_BOOLEAN = 0x01,
-       ASN1_INTEGER = 0x02,
-       ASN1_BITSTRING = 0x03,
-       ASN1_OCTETSTRING = 0x04,
-       ASN1_NULL = 0x05,
-       ASN1_OID = 0x06,
-       ASN1_ENUMERATED = 0x0A,
-       ASN1_UTF8STRING = 0x0C,
-       ASN1_NUMERICSTRING = 0x12,
-       ASN1_PRINTABLESTRING = 0x13,
-       ASN1_T61STRING = 0x14,
-       ASN1_VIDEOTEXSTRING = 0x15,
-       ASN1_IA5STRING = 0x16,
-       ASN1_UTCTIME = 0x17,
-       ASN1_GENERALIZEDTIME = 0x18,
-       ASN1_GRAPHICSTRING = 0x19,
-       ASN1_VISIBLESTRING = 0x1A,
-       ASN1_GENERALSTRING = 0x1B,
-       ASN1_UNIVERSALSTRING = 0x1C,
-       ASN1_BMPSTRING = 0x1E,
-       ASN1_CONSTRUCTED = 0x20,
-       ASN1_SEQUENCE = 0x30,
-       ASN1_SET = 0x31,
-       /**
-        * EXCPLICIT tags 
-        */
-       ASN1_TAG_E_0 = 0xA0,
-       ASN1_TAG_E_1 = 0xA1,
-       ASN1_TAG_E_2 = 0xA2,
-       ASN1_TAG_E_3 = 0xA3,
-       ASN1_TAG_E_4 = 0xA4,
-       ASN1_TAG_E_5 = 0xA5,
-       ASN1_TAG_E_6 = 0xA6,
-       ASN1_TAG_E_7 = 0xA7,
-       /**
-        * IMPLICIT tags 
-        */
-       ASN1_TAG_I_0 = 0x80,
-       ASN1_TAG_I_1 = 0x81,
-       ASN1_TAG_I_2 = 0x82,
-       ASN1_TAG_I_3 = 0x83,
-       ASN1_TAG_I_4 = 0x84,
-       ASN1_TAG_I_5 = 0x85,
-       ASN1_TAG_I_6 = 0x86,
-       ASN1_TAG_I_7 = 0x87,
-       /**
-        * Begin of a choice
-        */
-       ASN1_CHOICE = 0xFE,
-       /**
-        * ANY type
-        */
-       ASN1_ANY = 0xFF,
-};
-
-/**
- * String mappings for asn1_type_t
- */
-extern mapping_t asn1_type_m[];
-
-
-typedef enum asn1_flag_t asn1_flag_t;
-
-/**
- * @brief Flags used to build ASN1 rules.
- * 
- * @ingroup asn1
- */
-enum asn1_flag_t {
-       /**
-        * Field is optional
-        */
-       ASN1_OPTIONAL = 0x01,
-       /**
-        * Field has a default value and is therefore optional
-        */
-       ASN1_DEFAULT = 0x02,
-       /**
-        * Convert this INTEGER to an mpz_t
-        */
-       ASN1_MPZ = 0x04,
-       /**
-        * SEQUENCE or SET OF
-        */
-       ASN1_OF = 0x08,
-       /**
-        * Parse this Sequence in a RAW chunk too.
-        * Used for crypto calculations...
-        */
-       ASN1_RAW = 0x10,
-};
-
-/**
- * String mappings for asn1_flag_t
- */
-extern mapping_t asn1_flag_m[];
-
-
-typedef struct asn1_rule_t asn1_rule_t;
-
-/**
- * @brief Single rule of a complet ruleset.
- * 
- * This rule containing a type, flags and additional
- * data allow modellation of complex ASN1 structures and
- * allow their en- and decoding...
- * 
- * @ingroup asn1
- */
-struct asn1_rule_t {
-       /** 
-        * ASN1 type 
-        */
-       asn1_type_t type;
-       /** 
-        * implicit or explicit tag, if any 
-        */
-       asn1_flag_t flags;
-       /** 
-        * offset of data in structure 
-        */
-       u_int data_offset;
-       /**
-        * offset to a boolean, which says if optional 
-        * data is available at data_offset. Used if
-        * flags & ASN1_OPTIONAL.
-        * default value, used if flags & ASN1_DEFAULT
-        */
-       u_int additional;
-};
-
-
-#endif /* ASN1_H_ */
diff --git a/Source/charon/asn1/der_decoder.c b/Source/charon/asn1/der_decoder.c
deleted file mode 100644 (file)
index 9ded40f..0000000
+++ /dev/null
@@ -1,501 +0,0 @@
-/**
- * @file der_decoder.c
- *
- * @brief Implementation of der_decoder_t.
- */
-
-/*
- * Copyright (C) 2000-2004 Andreas Steffen
- * Copyright (C) 2006 Martin Willi
- * Hochschule fuer Technik Rapperswil
- *
- * Some parts taken over from pluto/asn1.c
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * for more details.
- */
-
-#include <gmp.h>
-
-#include "der_decoder.h"
-
-#include <utils/allocator.h>
-#include <daemon.h>
-
-
-
-typedef struct private_der_decoder_t private_der_decoder_t;
-
-/**
- * Private data of a der_decoder_t object.
- */
-struct private_der_decoder_t {
-       /**
-        * Public interface for this signer.
-        */
-       der_decoder_t public;
-       
-       /**
-        * Rule which was just processed
-        */
-       asn1_rule_t *rule;
-       
-       /**
-        * First rule of the whole ruleset
-        */
-       asn1_rule_t *first_rule;
-       
-       /**
-        * Output data struct
-        */
-       void *output;
-       
-       /**
-        * Complex things like this need a logger ;-)
-        */
-       logger_t *logger;
-};
-
-status_t read_hdr(private_der_decoder_t *this, chunk_t *data);
-
-/**
- * Read a sequence from data, parse its contents recursivly
- */
-status_t read_sequence(private_der_decoder_t *this, chunk_t data)
-{
-       status_t status;
-       asn1_rule_t *next_rule;
-       
-       while(TRUE)
-       {
-               next_rule = this->rule + 1;
-               if (next_rule->type == ASN1_END)
-               {
-                       this->rule++;
-                       break;
-               }
-               status = read_hdr(this, &data);
-               if (status != SUCCESS)
-               {
-                       return status;
-               }
-       }
-       
-       this->logger->log(this->logger, CONTROL|LEVEL2, "Sequence end");
-       return SUCCESS;
-}
-
-/**
- * Read choice of data, parse if one of the choosable types arise
- */
-status_t read_choice(private_der_decoder_t *this, chunk_t *data)
-{
-       status_t status = PARSE_ERROR;
-       asn1_rule_t *next_rule;
-       bool found = FALSE;
-       
-       this->logger->log_chunk(this->logger, CONTROL|LEVEL2, "Choice data", *data);
-       
-       while(TRUE)
-       {
-               next_rule = this->rule + 1;
-               if (next_rule->type == ASN1_END)
-               {
-                       this->rule++;
-                       return status;
-               }
-               if (!found && *(data->ptr) == next_rule->type)
-               {
-                       found = TRUE;
-                       status = read_hdr(this, data);
-               }
-               else
-               {
-                       this->rule++;
-               }
-       }
-       this->logger->log(this->logger, CONTROL|LEVEL2, "Choice end");
-       return status;
-}
-
-/**
- * Read a utc or generalized time
- */
-status_t read_time(private_der_decoder_t *this, chunk_t data)
-{
-       struct tm t;
-       time_t tz_offset;
-       u_char *eot = NULL;
-       const char* format;
-       time_t *result = (time_t*)((u_int8_t*)this->output + this->rule->data_offset);
-       
-       /* TODO: Test it */
-       this->logger->log_chunk(this->logger, CONTROL|LEVEL2, "TIME", data);
-       
-       if ((eot = memchr(data.ptr, 'Z', data.len)) != NULL)
-       {
-               /* Zulu time with a zero time zone offset */
-               tz_offset = 0;
-       }
-       else if ((eot = memchr(data.ptr, '+', data.len)) != NULL)
-       {
-               int tz_hour, tz_min;
-               
-               sscanf(eot+1, "%2d%2d", &tz_hour, &tz_min);
-               /* positive time zone offset */
-               tz_offset = 3600*tz_hour + 60*tz_min;
-       }
-       else if ((eot = memchr(data.ptr, '-', data.len)) != NULL)
-       {
-               int tz_hour, tz_min;
-               
-               sscanf(eot+1, "%2d%2d", &tz_hour, &tz_min);
-               /* negative time zone offset */
-               tz_offset = -3600*tz_hour - 60*tz_min;
-       }
-       else
-       {
-               /* error in time format */
-               return PARSE_ERROR; 
-       }
-
-       if (this->rule->type == ASN1_UTCTIME)
-       {
-               format = "%2d%2d%2d%2d%2d";
-       }
-       else
-       {
-               format = "%4d%2d%2d%2d%2d";
-       }
-       
-       sscanf(data.ptr, format, &t.tm_year, &t.tm_mon, &t.tm_mday, &t.tm_hour, &t.tm_min);
-       
-       /* is there a seconds field? */
-       if ((eot - data.ptr) == ((this->rule->type == ASN1_UTCTIME)?12:14))
-       {
-               sscanf(eot-2, "%2d", &t.tm_sec);
-       }
-       else
-       {
-               t.tm_sec = 0;
-       }
-
-       /* representation of year */
-       if (t.tm_year >= 1900)
-       {
-               t.tm_year -= 1900;
-       }
-       else if (t.tm_year >= 100)
-       {
-               return PARSE_ERROR;
-       }
-       else if (t.tm_year < 50)
-       {
-               t.tm_year += 100;
-       }
-
-       /* representation of month 0..11*/
-       t.tm_mon--;
-
-       /* set daylight saving time to off */
-       t.tm_isdst = 0;
-
-       /* compensate timezone */
-
-       *result = mktime(&t) - timezone - tz_offset;
-       return SUCCESS;
-}
-
-/**
- * Read an integer as u_int or as mpz_t
- */
-status_t read_int(private_der_decoder_t *this, chunk_t data)
-{
-       this->logger->log_chunk(this->logger, CONTROL|LEVEL2, "ASN1_INTEGER", data);
-       
-       if (this->rule->flags & ASN1_MPZ)
-       {
-               mpz_t *mpz = (mpz_t*)((u_int8_t*)this->output + this->rule->data_offset);
-               mpz_import(*mpz, data.len, 1, 1, 1, 0, data.ptr);
-       }
-       else
-       {       
-               u_int *integ = (u_int*)((u_int8_t*)this->output + this->rule->data_offset);
-               
-               *integ = 0;
-               while (data.len-- > 0)
-               {
-                       *integ = 256 * (*integ) + *data.ptr++;
-               }
-       }
-       return SUCCESS;
-}
-
-/**
- * Read boolean value 
- */
-status_t read_bool(private_der_decoder_t *this, chunk_t data)
-{
-       this->logger->log_chunk(this->logger, CONTROL|LEVEL2, "ASN1_BOOLEAN", data);
-
-       bool *boolean = (u_int*)((u_int8_t*)this->output + this->rule->data_offset);
-       
-       *boolean = *data.ptr;
-       
-       return SUCCESS;
-}
-
-/**
- * Read an OID
- */
-status_t read_oid(private_der_decoder_t *this, chunk_t data)
-{
-       this->logger->log_chunk(this->logger, CONTROL|LEVEL2, "ASN1_OID", data);
-       /* TODO: OID parsing stuff */
-       return SUCCESS;
-}
-
-/**
- * Read a bitstring
- */
-status_t read_bitstring(private_der_decoder_t *this, chunk_t data)
-{
-       /* TODO: cleanly determine amount of unused bits */
-       
-       /* skip "unused-bits-in-following-byte"-byte */
-       data.ptr += 1;
-       data.len -= 1;
-       
-       if (data.len < 1)
-       {
-               return FAILED;
-       }
-       
-       chunk_t *chunk = (chunk_t*)((u_int8_t*)this->output + this->rule->data_offset);
-       
-       *chunk = allocator_clone_chunk(data);
-       
-       this->logger->log_chunk(this->logger, CONTROL|LEVEL2, "ASN1_BITSTRING", data);
-       return SUCCESS;
-}
-
-/**
- * Read any type which appears in a chunk
- */
-status_t read_any(private_der_decoder_t *this, chunk_t data)
-{      
-       chunk_t *chunk = (chunk_t*)((u_int8_t*)this->output + this->rule->data_offset);
-       
-       *chunk = allocator_clone_chunk(data);
-       
-       this->logger->log_chunk(this->logger, CONTROL|LEVEL2, "ASN1_ANY", data);
-       return SUCCESS;
-}
-
-/**
- * Read the length field of a type
- */
-u_int32_t read_length(chunk_t *data)
-{
-       u_int8_t n;
-       size_t len;
-       
-       if (data->len < 1)
-       {
-               return -1;
-       }
-       
-       /* read first octet of length field */
-       n = *data->ptr;
-       data->ptr++; data->len--;
-
-       if ((n & 0x80) == 0) 
-       {
-               /* single length octet */
-               return n;
-       }
-       
-       /* composite length, determine number of length octets */
-       n &= 0x7f;
-       
-       if (n > data->len)
-       {
-               /* length longer than available bytes */
-               return -1;
-       }
-       
-       if (n > sizeof(len))
-       {
-               /* larger than size_t can hold */
-               return -1;
-       }
-       
-       len = 0;
-       while (n-- > 0)
-       {
-               len = 256 * len + *data->ptr;
-               data->ptr++; data->len--;
-       }
-       return len;
-}
-
-/**
- * Read the next field
- */
-status_t read_hdr(private_der_decoder_t *this, chunk_t *data)
-{
-       chunk_t inner;
-       /* TODO: Redo this that an average mid-european can understand it */
-       
-beginning:
-       /* advance to the next rule */
-       this->rule++;
-       
-       this->logger->log(this->logger, CONTROL|LEVEL2, "reading rule %d %s",
-                                               this->rule - this->first_rule,
-                                               mapping_find(asn1_type_m, this->rule->type));
-       
-       switch (this->rule->type)
-       {
-               case ASN1_END:
-                       /* ignore, handled outside */
-                       return SUCCESS;
-               case ASN1_CHOICE:
-                       /* CHOICE has no type/length */
-                       break;
-               default:
-                       /* anything else has type/length */
-                       if (data->len == 0)
-                       {
-                               goto beginning;
-                       }
-                       this->logger->log_chunk(this->logger, CONTROL|LEVEL3, "reading from:", *data);
-                       
-                       /* read type, advance in data */
-                       if (this->rule->type != ASN1_ANY && *(data->ptr) != this->rule->type)
-                       {
-                               if (this->rule->flags & ASN1_OPTIONAL)
-                               {
-                                       goto beginning;
-                               }
-                               if (this->rule->flags & ASN1_DEFAULT)
-                               {
-                                       goto beginning;
-                               }
-                               this->logger->log(this->logger, CONTROL|LEVEL2, "Bad byte found: %x, %x expected", 
-                                                               *data->ptr, this->rule->type);
-                               return PARSE_ERROR;
-                       }
-                       data->ptr++;
-                       data->len--;
-                       
-                       /* read length, advance in data */
-                       inner.len = read_length(data);
-                       if (inner.len == -1)
-                       {
-                               this->logger->log(this->logger, CONTROL|LEVEL2, "Error reading length");
-                               return PARSE_ERROR;
-                       }
-                       this->logger->log(this->logger, CONTROL|LEVEL2, "Length is %d", inner.len);
-                       inner.ptr = data->ptr;
-                       
-                       /* advance in data, at the size of the inner */
-                       data->ptr += inner.len;
-                       data->len -= inner.len;
-       }
-       
-       /* process inner */
-       while (TRUE)
-       {
-               switch (this->rule->type)
-               {
-                       case ASN1_INTEGER:
-                               return read_int(this, inner);
-                       case ASN1_BOOLEAN:
-                               return read_bool(this, inner);
-                       case ASN1_SEQUENCE:
-                       case ASN1_SET:
-                               return read_sequence(this, inner);
-                       case ASN1_TAG_E_0:
-                       case ASN1_TAG_E_1:
-                       case ASN1_TAG_E_2:
-                       case ASN1_TAG_E_3:
-                       case ASN1_TAG_E_4:
-                       case ASN1_TAG_E_5:
-                       case ASN1_TAG_E_6:
-                       case ASN1_TAG_E_7:
-                               return read_hdr(this, &inner);
-                       case ASN1_TAG_I_0:
-                       case ASN1_TAG_I_1:
-                       case ASN1_TAG_I_2:
-                       case ASN1_TAG_I_3:
-                       case ASN1_TAG_I_4:
-                       case ASN1_TAG_I_5:
-                       case ASN1_TAG_I_6:
-                       case ASN1_TAG_I_7:
-                               this->rule++;
-                               continue;
-                       case ASN1_OID:
-                               return read_oid(this, inner);
-                       case ASN1_CHOICE:
-                               return read_choice(this, data);
-                       case ASN1_NULL:
-                               return SUCCESS;
-                       case ASN1_ANY:
-                               return read_any(this, inner);
-                       case ASN1_UTCTIME:
-                               return read_time(this, inner);
-                       case  ASN1_GENERALIZEDTIME:
-                               return read_time(this, inner);
-                       case ASN1_BITSTRING:
-                               return read_bitstring(this, inner);
-                       case ASN1_OCTETSTRING:
-                               return read_any(this, inner);
-                       default:
-                               return NOT_SUPPORTED;
-               }
-       }
-}
-
-/**
- * Implements der_decoder_t.decode
- */
-status_t decode(private_der_decoder_t *this, chunk_t input, void *output)
-{
-       this->rule = this->first_rule - 1;
-       this->output = output;
-       /* start parsing recursivly */
-       return read_hdr(this, &input);
-}
-
-/**
- * Implementation of der_decoder.destroy.
- */
-static void destroy(private_der_decoder_t *this)
-{
-       allocator_free(this);
-}
-
-/*
- * Described in header.
- */
-der_decoder_t *der_decoder_create(asn1_rule_t *rules)
-{
-       private_der_decoder_t *this = allocator_alloc_thing(private_der_decoder_t);
-       
-       /* public functions */
-       this->public.decode = (status_t (*) (der_decoder_t*,chunk_t,void*))decode;
-       this->public.destroy = (void (*) (der_decoder_t*))destroy;
-       
-       this->first_rule = rules;
-       this->logger = charon->logger_manager->get_logger(charon->logger_manager, DER_DECODER);
-       
-       return &(this->public);
-}
diff --git a/Source/charon/asn1/der_decoder.h b/Source/charon/asn1/der_decoder.h
deleted file mode 100644 (file)
index 68731b5..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
- * @file der_decoder.h
- *
- * @brief Interface of der_decoder_t.
- *
- */
-
-/*
- * Copyright (C) 2006 Martin Willi
- * Hochschule fuer Technik Rapperswil
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * for more details.
- */
-
-#ifndef DER_DECODER_H_
-#define DER_DECODER_H_
-
-#include <types.h>
-#include <asn1/asn1.h>
-
-typedef struct der_decoder_t der_decoder_t;
-
-/**
- * @brief Decode ASN1 DER encoded chunks.
- * 
- * @b Constructors:
- *  - der_decoder_create()
- * 
- * @todo A lot.
- * 
- * @ingroup asn1
- */
-struct der_decoder_t {
-       
-       /**
-        * @brief Decode a chunk of bytes to a data structure
-        *
-        * @param der_decoder   calling object
-        * @param input                 chunk of data to decode
-        * @param output                data structure where decoded data is written
-        * @return
-        *                                              - PARSE_ERROR
-        *                                              - FAILED
-        *                                              - NOT_SUPPORTED
-        *                                              - or SUCCESS sometimes
-        */
-       status_t (*decode) (der_decoder_t *this, chunk_t input, void *output);
-
-       /**
-        * @brief Destroys a der_decoder object.
-        *
-        * @param der_decoder   calling object
-        */
-       void (*destroy) (der_decoder_t *this);
-};
-
-
-/**
- * @brief Create a der_decoder instance.
- * 
- * The instance needs ASN1 rules to know how to decode
- * data...
- * 
- * @param rules                set of ASN1 coding rules
- * @return                     der_decoder_t object
- * 
- * @ingroup ans1
- */
-der_decoder_t * der_decoder_create(asn1_rule_t* rules);
-
-#endif /* DER_DECODER_H_ */
diff --git a/Source/charon/asn1/der_encoder.c b/Source/charon/asn1/der_encoder.c
deleted file mode 100644 (file)
index 669a140..0000000
+++ /dev/null
@@ -1,218 +0,0 @@
-/**
- * @file der_encoder.c
- *
- * @brief Implementation of der_encoder_t.
- */
-
-/*
- * Copyright (C) 2005 Jan Hutter, Martin Willi
- * Hochschule fuer Technik Rapperswil
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * for more details.
- */
-
-#include <gmp.h>
-
-#include "der_encoder.h"
-
-#include <utils/allocator.h>
-#include <daemon.h>
-
-
-
-typedef struct private_der_encoder_t private_der_encoder_t;
-
-/**
- * Private data of a der_encoder_t object.
- */
-struct private_der_encoder_t {
-       /**
-        * Public interface for this signer.
-        */
-       der_encoder_t public;
-       
-       asn1_rule_t *rule;
-       
-       asn1_rule_t *first_rule;
-       
-       void *output;
-       
-       logger_t *logger;
-};
-
-status_t read_hdr(private_der_encoder_t *this, chunk_t *data);
-
-status_t read_sequence(private_der_encoder_t *this, chunk_t data)
-{
-       while (this->rule->type != ASN1_END)
-       {
-               read_hdr(this, &data);
-       }
-       return SUCCESS;
-}
-
-
-status_t read_int(private_der_encoder_t *this, chunk_t data)
-{
-       this->logger->log_chunk(this->logger, CONTROL|LEVEL2, "ASN1_INTEGER", data);
-       u_int *integ = (u_int*)((u_int8_t*)this->output + this->rule->data_offset);
-       
-       *integ = 0;
-       while (data.len-- > 0)
-       {
-               *integ = 256 * (*integ) + *data.ptr++;
-       }
-       return SUCCESS;
-}
-
-status_t read_mpz(private_der_encoder_t *this, chunk_t data)
-{
-       this->logger->log_chunk(this->logger, CONTROL|LEVEL2, "ASN1_INTEGER as mpz", data);
-       mpz_t *mpz = (mpz_t*)((u_int8_t*)this->output + this->rule->data_offset);
-       
-       mpz_import(*mpz, data.len, 1, 1, 1, 0, data.ptr);
-       return SUCCESS;
-}
-
-u_int32_t read_length(chunk_t *data)
-{
-       u_int8_t n;
-       size_t len;
-       
-       /* read first octet of length field */
-       n = *data->ptr++;
-
-       if ((n & 0x80) == 0) 
-       {
-               /* single length octet */
-               return n;
-       }
-       
-       /* composite length, determine number of length octets */
-       n &= 0x7f;
-       
-       if (n > data->len)
-       {
-               /* length longer than available bytes */
-               return -1;
-       }
-       
-       if (n > sizeof(len))
-       {
-               /* larger than size_t can hold */
-               return -1;
-       }
-       
-       len = 0;
-       while (n-- > 0)
-       {
-               len = 256 * len + *data->ptr++;
-       }
-       return len;
-}
-
-status_t read_hdr(private_der_encoder_t *this, chunk_t *data)
-{
-       chunk_t inner;
-       
-       /* advance to the next rule */
-       this->rule++;
-       
-       if (this->rule->type == ASN1_END)
-       {
-               return SUCCESS;
-       }
-       
-       this->logger->log(this->logger, CONTROL|LEVEL2, "reading header of rule %s",
-                                         mapping_find(asn1_type_m, this->rule->type));
-       
-       this->logger->log_chunk(this->logger, CONTROL|LEVEL2, "reading from:", *data);
-       
-       /* read type, advance in data */
-       if (*(data->ptr) != this->rule->type)
-       {
-               this->logger->log(this->logger, CONTROL|LEVEL2, "Bad byte found (%x)", *data->ptr);
-               return PARSE_ERROR;
-       }
-       data->ptr++; 
-       data->len--;
-       
-       /* read length, advance in data */
-       inner.len = read_length(data);
-       if (inner.len == -1)
-       {
-               this->logger->log(this->logger, CONTROL|LEVEL2, "Error reading length");
-               return PARSE_ERROR;
-       }
-       this->logger->log(this->logger, CONTROL|LEVEL2, "Length is %d",
-                                         inner.len);
-       inner.ptr = data->ptr;
-       
-       /* advance in data */
-       data->ptr += inner.len;
-       data->len -= inner.len;
-       
-       /* process inner */
-       switch (this->rule->type)
-       {
-               case ASN1_INTEGER:
-                       if (this->rule->flags & ASN1_MPZ)
-                       {
-                               read_mpz(this, inner);
-                       }
-                       else
-                       {
-                               read_int(this, inner);
-                       }
-                       break;
-               case ASN1_SEQUENCE:
-                       read_sequence(this, inner);
-                       break;
-               default:
-                       break;
-       }
-       
-       return SUCCESS;
-}
-
-
-
-status_t decode(private_der_encoder_t *this, chunk_t input, void *output)
-{
-       this->rule = this->first_rule - 1;
-       this->output = output;
-       return read_hdr(this, &input);
-}
-
-/**
- * Implementation of der_encoder.destroy.
- */
-static void destroy(private_der_encoder_t *this)
-{
-       allocator_free(this);
-}
-
-/*
- * Described in header.
- */
-der_encoder_t *der_encoder_create(asn1_rule_t *rules)
-{
-       private_der_encoder_t *this = allocator_alloc_thing(private_der_encoder_t);
-       
-       /* public functions */
-       this->public.decode = (status_t (*) (der_encoder_t*,chunk_t,void*))decode;
-       this->public.destroy = (void (*) (der_encoder_t*))destroy;
-       
-       this->first_rule = rules;
-       this->logger = charon->logger_manager->get_logger(charon->logger_manager, DER_DECODER);
-       
-       return &(this->public);
-}
diff --git a/Source/charon/asn1/der_encoder.h b/Source/charon/asn1/der_encoder.h
deleted file mode 100644 (file)
index ee4443e..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/**
- * @file der_encoder.h
- *
- * @brief Interface of der_encoder_t.
- *
- */
-
-/*
- * Copyright (C) 2006 Martin Willi
- * Hochschule fuer Technik Rapperswil
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * for more details.
- */
-
-#ifndef DER_ENCODER_H_
-#define DER_ENCODER_H_
-
-#include <types.h>
-
-typedef struct der_encoder_t der_encoder_t;
-
-/**
- * @brief Decode der_encoded bytes to usable structures.
- * 
- * @b Constructors:
- *  - der_encoder_create()
- * 
- * @ingroup asn1
- */
-struct der_encoder_t {
-       
-       status_t encode(der_encoder_t *this, void *input, chunk_t output);
-
-       /**
-        * @brief Destroys a der_encoder object.
-        *
-        * @param der_encoder   calling object
-        */
-       void (*destroy) (der_encoder_t *this);
-};
-
-
-/**
- * @brief Create a der_encoder instance.
- * 
- * @return     der_encoder_t object
- * 
- * @ingroup ans1
- */
-der_encoder_t * der_encoder_create(asn1_rule_t *rules);
-
-#endif /* DER_ENCODER_H_ */
diff --git a/Source/charon/charon-support.patch b/Source/charon/charon-support.patch
deleted file mode 100644 (file)
index 20004d4..0000000
+++ /dev/null
@@ -1,867 +0,0 @@
-diff -Naur strongswan-2.6.3/Makefile.inc strongswan-2.6.3-charon/Makefile.inc
---- strongswan-2.6.3/Makefile.inc      2006-01-25 18:23:15.000000000 +0100
-+++ strongswan-2.6.3-charon/Makefile.inc       2006-03-21 09:26:23.000000000 +0100
-@@ -284,6 +284,9 @@
- # include PKCS11-based smartcard support
- USE_SMARTCARD?=false
-+# support IKEv2 via charon
-+USE_IKEV2?=true
-+
- # Default PKCS11 library
- # Uncomment this line if using OpenSC <= 0.9.6
- PKCS11_DEFAULT_LIB=\"/usr/lib/pkcs11/opensc-pkcs11.so\"
-diff -Naur strongswan-2.6.3/programs/Makefile strongswan-2.6.3-charon/programs/Makefile
---- strongswan-2.6.3/programs/Makefile 2006-01-01 16:14:08.000000000 +0100
-+++ strongswan-2.6.3-charon/programs/Makefile  2006-03-21 09:26:23.000000000 +0100
-@@ -32,6 +32,10 @@
- SUBDIRS+=showpolicy
- endif
-+ifeq ($(USE_IKEV2),true)
-+SUBDIRS+=charon
-+endif
-+
- def:
-       @echo "Please read doc/intro.html or INSTALL before running make"
-       @false
-diff -Naur strongswan-2.6.3/programs/ipsec/ipsec.in strongswan-2.6.3-charon/programs/ipsec/ipsec.in
---- strongswan-2.6.3/programs/ipsec/ipsec.in   2006-03-09 21:09:33.000000000 +0100
-+++ strongswan-2.6.3-charon/programs/ipsec/ipsec.in    2006-03-21 09:49:10.000000000 +0100
-@@ -123,6 +123,10 @@
- down)
-       shift
-       $IPSEC_EXECDIR/whack --name "$1" --terminate
-+      if test -e $IPSEC_EXECDIR/stroke
-+      then
-+          $IPSEC_EXECDIR/stroke --name "$1" --terminate
-+      fi
-       exit 0
-       ;;
- listalgs|listpubkeys|listcerts|listcacerts|\
-@@ -134,11 +138,19 @@
-       op="$1"
-       shift
-         $IPSEC_EXECDIR/whack "$@" "--$op"
-+      if test -e $IPSEC_EXECDIR/stroke
-+      then
-+            $IPSEC_EXECDIR/stroke "$@" "--$op"
-+        fi
-       exit 0
-       ;;
- ready)
-       shift
-       $IPSEC_EXECDIR/whack --listen
-+      if test -e $IPSEC_EXECDIR/stroke
-+      then
-+          $IPSEC_EXECDIR/stroke --listen
-+      fi
-       exit 0
-       ;;
- reload)
-@@ -180,8 +192,16 @@
-       if test $# -eq 0
-       then
-           $IPSEC_EXECDIR/whack "--$op"
-+          if test -e $IPSEC_EXECDIR/stroke
-+          then
-+              $IPSEC_EXECDIR/stroke "--$op"
-+          fi
-       else
-           $IPSEC_EXECDIR/whack --name "$1" "--$op"
-+          if test -e $IPSEC_EXECDIR/stroke
-+          then
-+              $IPSEC_EXECDIR/stroke --name "$1" "--$op"
-+          fi
-       fi
-       exit 0
-       ;;
-diff -Naur strongswan-2.6.3/programs/pluto/Makefile strongswan-2.6.3-charon/programs/pluto/Makefile
---- strongswan-2.6.3/programs/pluto/Makefile   2006-01-25 18:22:19.000000000 +0100
-+++ strongswan-2.6.3-charon/programs/pluto/Makefile    2006-03-21 10:00:41.000000000 +0100
-@@ -170,6 +170,11 @@
-   LIBSPLUTO+= -ldl
- endif
-+# enable IKEv2 support
-+ifeq ($(USE_IKEV2),true)
-+  DEFINES+= -DIKEV2
-+endif
-+
- # This compile option activates the leak detective
- ifeq ($(USE_LEAK_DETECTIVE),true)
-   DEFINES+= -DLEAK_DETECTIVE
-diff -Naur strongswan-2.6.3/programs/pluto/demux.c strongswan-2.6.3-charon/programs/pluto/demux.c
---- strongswan-2.6.3/programs/pluto/demux.c    2005-02-18 22:08:59.000000000 +0100
-+++ strongswan-2.6.3-charon/programs/pluto/demux.c     2006-03-21 09:26:24.000000000 +0100
-@@ -1229,6 +1229,15 @@
-       if (md->packet_pbs.roof - md->packet_pbs.cur >= (ptrdiff_t)isakmp_hdr_desc.size)
-       {
-           struct isakmp_hdr *hdr = (struct isakmp_hdr *)md->packet_pbs.cur;
-+#ifdef IKEV2
-+          if ((hdr->isa_version >> ISA_MAJ_SHIFT) == 0x2 &&
-+                      (hdr->isa_version & ISA_MIN_MASK) == 0x0)
-+          {
-+              /* IKEv2 is handled from charon, ignore */
-+              return;
-+          }
-+          else 
-+#endif /* IKEV2 */
-           if ((hdr->isa_version >> ISA_MAJ_SHIFT) != ISAKMP_MAJOR_VERSION)
-           {
-               SEND_NOTIFICATION(INVALID_MAJOR_VERSION);
-diff -Naur strongswan-2.6.3/programs/starter/Makefile strongswan-2.6.3-charon/programs/starter/Makefile
---- strongswan-2.6.3/programs/starter/Makefile 2006-02-17 20:34:02.000000000 +0100
-+++ strongswan-2.6.3-charon/programs/starter/Makefile  2006-03-21 09:26:24.000000000 +0100
-@@ -34,6 +34,11 @@
-   DEFINES+= -DLEAK_DETECTIVE
- endif
-+# Enable charon support
-+ifeq ($(USE_IKEV2),true)
-+  DEFINES+= -DIKEV2
-+endif
-+
- INCLUDES=-I${FREESWANDIR}/linux/include
- CFLAGS=$(DEFINES) $(INCLUDES) -Wall
- CFLAGS+=-DIPSEC_EXECDIR=\"${FINALLIBEXECDIR}\" -DIPSEC_CONFDDIR=\"${FINALCONFDDIR}\"
-@@ -46,6 +51,11 @@
-      starterwhack.o klips.o netkey.o interfaces.o exec.o cmp.o confread.o \
-      loglite.o ${PLUTO_OBJS}
-+# Build charon-only objs
-+ifeq ($(USE_IKEV2),true)
-+  OBJS+= invokecharon.o starterstroke.o
-+endif
-+
- DISTSRC=$(OBJS:.o=.c)
- DISTSRC+=cmp.h confread.h confwrite.h exec.h files.h interfaces.h klips.h netkey.h
- DISTSRC+=parser.h args.h invokepluto.h starterwhack.h keywords.h keywords.txt
-diff -Naur strongswan-2.6.3/programs/starter/args.c strongswan-2.6.3-charon/programs/starter/args.c
---- strongswan-2.6.3/programs/starter/args.c   2006-03-10 21:37:10.000000000 +0100
-+++ strongswan-2.6.3-charon/programs/starter/args.c    2006-03-21 09:26:24.000000000 +0100
-@@ -86,6 +86,10 @@
- static const char *LST_keyexchange[] = {
-     "ike",
-+#ifdef IKEV2
-+    "ikev1",
-+    "ikev2",
-+#endif /* IKEV2 */
-      NULL
- };
-diff -Naur strongswan-2.6.3/programs/starter/files.h strongswan-2.6.3-charon/programs/starter/files.h
---- strongswan-2.6.3/programs/starter/files.h  2006-02-04 19:52:58.000000000 +0100
-+++ strongswan-2.6.3-charon/programs/starter/files.h   2006-03-21 09:26:24.000000000 +0100
-@@ -37,8 +37,15 @@
- #define SECRETS_FILE  IPSEC_CONFDIR"/ipsec.secrets"
- #define PLUTO_CMD       IPSEC_EXECDIR"/pluto"
--#define CTL_FILE        DEFAULT_CTLBASE CTL_SUFFIX
--#define PID_FILE        DEFAULT_CTLBASE PID_SUFFIX
-+#define PLUTO_CTL_FILE  DEFAULT_CTLBASE CTL_SUFFIX
-+#define PLUTO_PID_FILE  DEFAULT_CTLBASE PID_SUFFIX
-+
-+#ifdef IKEV2
-+#define CHARON_CMD            IPSEC_EXECDIR"/charon"
-+#define CHARON_BASE           "/var/run/charon"
-+#define CHARON_CTL_FILE CHARON_BASE CTL_SUFFIX
-+#define CHARON_PID_FILE CHARON_BASE PID_SUFFIX
-+#endif /* IKEV2 */
- #define DYNIP_DIR       "/var/run/dynip"
- #define INFO_FILE       "/var/run/ipsec.info"
-diff -Naur strongswan-2.6.3/programs/starter/invokecharon.c strongswan-2.6.3-charon/programs/starter/invokecharon.c
---- strongswan-2.6.3/programs/starter/invokecharon.c   1970-01-01 01:00:00.000000000 +0100
-+++ strongswan-2.6.3-charon/programs/starter/invokecharon.c    2006-03-21 09:26:24.000000000 +0100
-@@ -0,0 +1,168 @@
-+/* strongSwan charon launcher
-+ * Copyright (C) 2001-2002 Mathieu Lafon - Arkoon Network Security
-+ * Copyright (C) 2006 Martin Willi - Hochschule fuer Technik Rapperswil
-+ *
-+ * Ported from invokepluto.c to fit charons needs.
-+ *
-+ * This program is free software; you can redistribute it and/or modify it
-+ * under the terms of the GNU General Public License as published by the
-+ * Free Software Foundation; either version 2 of the License, or (at your
-+ * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
-+ *
-+ * This program is distributed in the hope that it will be useful, but
-+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-+ * for more details.
-+ *
-+ * RCSID $Id: invokecharon.c $
-+ */
-+
-+#include <sys/types.h>
-+#include <sys/stat.h>
-+#include <unistd.h>
-+#include <signal.h>
-+#include <string.h>
-+#include <stdlib.h>
-+#include <errno.h>
-+
-+#include <freeswan.h>
-+
-+#include "../pluto/constants.h"
-+#include "../pluto/defs.h"
-+#include "../pluto/log.h"
-+
-+#include "confread.h"
-+#include "invokecharon.h"
-+#include "files.h"
-+
-+static int _charon_pid = 0;
-+static int _stop_requested;
-+
-+pid_t
-+starter_charon_pid(void)
-+{
-+    return _charon_pid;
-+}
-+
-+void
-+starter_charon_sigchild(pid_t pid)
-+{
-+      if (pid == _charon_pid)
-+    {
-+              _charon_pid = 0;
-+      if (!_stop_requested)
-+      {
-+          plog("charon has died -- restart scheduled (%dsec)"
-+              , CHARON_RESTART_DELAY);
-+          alarm(CHARON_RESTART_DELAY);   // restart in 5 sec
-+      }
-+      unlink(CHARON_PID_FILE);
-+    }
-+}
-+
-+int
-+starter_stop_charon (void)
-+{
-+    pid_t pid;
-+    int i;
-+
-+    pid = _charon_pid;
-+    if (pid)
-+    {
-+      _stop_requested = 1;
-+
-+      /* be more and more aggressive */
-+      for (i = 0; i < 20 && (pid = _charon_pid) != 0; i++)
-+      {
-+              if (i == 0)
-+                      kill(pid, SIGINT);
-+          else if (i < 10)
-+                      kill(pid, SIGTERM);
-+          else
-+                      kill(pid, SIGKILL);
-+          usleep(20000);
-+      }
-+      if (_charon_pid == 0)
-+          return 0;
-+      plog("starter_stop_charon(): can't stop charon !!!");
-+      return -1;
-+    }
-+    else
-+    {
-+      plog("stater_stop_charon(): charon is not started...");
-+    }
-+    return -1;
-+}
-+
-+
-+int
-+starter_start_charon (starter_config_t *cfg, bool debug)
-+{
-+      int pid, i;
-+      struct stat stb;    
-+      char *arg[] = {
-+              CHARON_CMD, NULL
-+      };
-+      
-+    if (_charon_pid)
-+    {
-+      plog("starter_start_charon(): charon already started...");
-+      return -1;
-+    }
-+    else
-+    {
-+      unlink(CHARON_CTL_FILE);
-+      _stop_requested = 0;
-+
-+      pid = fork();
-+      switch (pid)
-+      {
-+      case -1:
-+          plog("can't fork(): %s", strerror(errno));
-+          return -1;
-+      case 0:
-+          /* child */
-+          setsid();
-+          sigprocmask(SIG_SETMASK, 0, NULL);
-+              execv(arg[0], arg);
-+              plog("can't execv(%s,...): %s", arg[0], strerror(errno));
-+          exit(1);
-+      default:
-+          /* father */
-+              _charon_pid = pid;
-+              for (i = 0; i < 50 && _charon_pid; i++)
-+          {
-+              /* wait for charon */
-+              usleep(20000);
-+              if (stat(CHARON_PID_FILE, &stb) == 0)
-+              {
-+                  DBG(DBG_CONTROL,
-+                      DBG_log("charon (%d) started", _charon_pid)
-+                  )
-+                  return 0;
-+              }
-+          }
-+          if (_charon_pid)
-+          {
-+              /* If charon is started but with no ctl file, stop it */
-+              plog("charon too long to start... - kill kill");
-+              for (i = 0; i < 20 && (pid = _charon_pid) != 0; i++)
-+              {
-+                      if (i == 0)
-+                      kill(pid, SIGINT);
-+                  else if (i < 10)
-+                      kill(pid, SIGTERM);
-+                  else
-+                      kill(pid, SIGKILL);
-+                  usleep(20000);
-+              }
-+          }
-+          else
-+          {
-+              plog("charon refused to be started");
-+          }
-+          return -1;
-+      }
-+    }
-+    return -1;
-+}
-diff -Naur strongswan-2.6.3/programs/starter/invokecharon.h strongswan-2.6.3-charon/programs/starter/invokecharon.h
---- strongswan-2.6.3/programs/starter/invokecharon.h   1970-01-01 01:00:00.000000000 +0100
-+++ strongswan-2.6.3-charon/programs/starter/invokecharon.h    2006-03-21 09:26:24.000000000 +0100
-@@ -0,0 +1,31 @@
-+/* strongSwan charon launcher
-+ * Copyright (C) 2001-2002 Mathieu Lafon - Arkoon Network Security
-+ * Copyright (C) 2006 Martin Willi - Hochschule fuer Technik Rapperswil
-+ *
-+ * Ported from invokepluto.h to fit charons needs.
-+ *
-+ * This program is free software; you can redistribute it and/or modify it
-+ * under the terms of the GNU General Public License as published by the
-+ * Free Software Foundation; either version 2 of the License, or (at your
-+ * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
-+ *
-+ * This program is distributed in the hope that it will be useful, but
-+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-+ * for more details.
-+ *
-+ * RCSID $Id: invokecharon.h $
-+ */
-+
-+#ifndef _STARTER_CHARON_H_
-+#define _STARTER_CHARON_H_
-+
-+#define CHARON_RESTART_DELAY    5
-+
-+extern void starter_charon_sigchild (pid_t pid);
-+extern pid_t starter_charon_pid (void);
-+extern int starter_stop_charon (void);
-+extern int starter_start_charon(struct starter_config *cfg, bool debug);
-+
-+#endif /* _STARTER_CHARON_H_ */
-+
-diff -Naur strongswan-2.6.3/programs/starter/invokepluto.c strongswan-2.6.3-charon/programs/starter/invokepluto.c
---- strongswan-2.6.3/programs/starter/invokepluto.c    2006-02-17 22:41:50.000000000 +0100
-+++ strongswan-2.6.3-charon/programs/starter/invokepluto.c     2006-03-21 09:26:24.000000000 +0100
-@@ -54,7 +54,7 @@
-               , PLUTO_RESTART_DELAY);
-           alarm(PLUTO_RESTART_DELAY);   // restart in 5 sec
-       }
--      unlink(PID_FILE);
-+      unlink(PLUTO_PID_FILE);
-     }
- }
-@@ -203,7 +203,7 @@
-     }
-     else
-     {
--      unlink(CTL_FILE);
-+      unlink(PLUTO_CTL_FILE);
-       _stop_requested = 0;
-       if (cfg->setup.prepluto)
-@@ -252,7 +252,7 @@
-           {
-               /* wait for pluto */
-               usleep(20000);
--              if (stat(CTL_FILE, &stb) == 0)
-+              if (stat(PLUTO_CTL_FILE, &stb) == 0)
-               {
-                   DBG(DBG_CONTROL,
-                       DBG_log("pluto (%d) started", _pluto_pid)
-diff -Naur strongswan-2.6.3/programs/starter/starter.c strongswan-2.6.3-charon/programs/starter/starter.c
---- strongswan-2.6.3/programs/starter/starter.c        2006-02-15 19:37:46.000000000 +0100
-+++ strongswan-2.6.3-charon/programs/starter/starter.c 2006-03-21 09:26:24.000000000 +0100
-@@ -37,6 +37,7 @@
- #include "files.h"
- #include "starterwhack.h"
- #include "invokepluto.h"
-+#include "invokecharon.h"
- #include "klips.h"
- #include "netkey.h"
- #include "cmp.h"
-@@ -47,6 +48,9 @@
- #define FLAG_ACTION_RELOAD        0x04
- #define FLAG_ACTION_QUIT          0x08
- #define FLAG_ACTION_LISTEN        0x10
-+#ifdef IKEV2
-+#define FLAG_ACTION_START_CHARON  0x20
-+#endif /* IKEV2 */
- static unsigned int _action_ = 0;
-@@ -65,6 +69,10 @@
-           {
-               if (pid == starter_pluto_pid())
-                   name = " (Pluto)";
-+#ifdef IKEV2
-+              if (pid == starter_charon_pid())
-+                  name = " (Charon)";
-+#endif /* IKEV2 */
-               if (WIFSIGNALED(status))
-                   DBG(DBG_CONTROL,
-                       DBG_log("child %d%s has been killed by sig %d\n",
-@@ -87,6 +95,10 @@
-               if (pid == starter_pluto_pid())
-                   starter_pluto_sigchild(pid);
-+#ifdef IKEV2
-+              if (pid == starter_charon_pid())
-+                  starter_charon_sigchild(pid);
-+#endif /* IKEV2 */
-           }
-       }
-       break;
-@@ -97,6 +109,9 @@
-     case SIGALRM:
-       _action_ |= FLAG_ACTION_START_PLUTO;
-+#ifdef IKEV2
-+      _action_ |= FLAG_ACTION_START_CHARON;
-+#endif /* IKEV2 */
-       break;
-     case SIGHUP:
-@@ -193,6 +208,9 @@
-     signal(SIGQUIT, fsig);
-     signal(SIGALRM, fsig);
-     signal(SIGUSR1, fsig);
-+      
-+      
-+      plog("Starting strongSwan IPsec %s [starter]...", ipsec_version_code());
-     /* verify that we can start */
-     if (getuid() != 0)
-@@ -201,12 +219,24 @@
-       exit(1);
-     }
--    if (stat(PID_FILE, &stb) == 0)
-+    if (stat(PLUTO_PID_FILE, &stb) == 0)
-     {
--      plog("pluto is already running (%s exists) -- aborting", PID_FILE);
--      exit(1);
-+      plog("pluto is already running (%s exists) -- skipping pluto start", PLUTO_PID_FILE);
-     }
--
-+    else
-+    {
-+      _action_ |= FLAG_ACTION_START_PLUTO;
-+    }
-+#ifdef IKEV2
-+    if (stat(CHARON_PID_FILE, &stb) == 0)
-+    {
-+      plog("charon is already running (%s exists) -- skipping charon start", CHARON_PID_FILE);
-+    }
-+    else
-+    {
-+      _action_ |= FLAG_ACTION_START_CHARON;
-+    }
-+#endif /* IKEV2 */
-     if (stat(DEV_RANDOM, &stb) != 0)
-     {
-       plog("unable to start strongSwan IPsec -- no %s!", DEV_RANDOM);
-@@ -247,7 +277,11 @@
-     last_reload = time(NULL);
--    plog("Starting strongSwan IPsec %s [starter]...", ipsec_version_code());
-+    if (stat(MY_PID_FILE, &stb) == 0)
-+    {
-+      plog("starter is already running (%s exists) -- no fork done", MY_PID_FILE);
-+      exit(0);
-+    }
-     /* fork if we're not debugging stuff */
-     if (!no_fork)
-@@ -296,17 +330,19 @@
-                     , &cfg->defaultroute);
-     }
--    _action_ = FLAG_ACTION_START_PLUTO;
--
-     for (;;)
-     {
-       /*
--       * Stop pluto (if started) and exit
--         */
-+       * Stop pluto/charon (if started) and exit
-+       */
-       if (_action_ & FLAG_ACTION_QUIT)
-       {
-           if (starter_pluto_pid())
-               starter_stop_pluto();
-+#ifdef IKEV2
-+              if (starter_charon_pid())
-+              starter_stop_charon();
-+#endif IKEV2
-           if (has_netkey)
-               starter_netkey_cleanup();
-           else
-@@ -337,6 +373,9 @@
-                   if (conn->state == STATE_ADDED)
-                   {
-                       starter_whack_del_conn(conn);
-+#ifdef IKEV2
-+                      starter_stroke_del_conn(conn);
-+#endif /* IKEV2 */
-                       conn->state = STATE_TO_ADD;
-                   }
-               }
-@@ -427,6 +466,9 @@
-                   {
-                       if (conn->state == STATE_ADDED)
-                           starter_whack_del_conn(conn);
-+#ifdef IKEV2
-+                          starter_stroke_del_conn(conn);
-+#endif /* IKEV2 */
-                   }
-                   /* Look for new ca sections that are already loaded */
-@@ -502,6 +544,27 @@
-                   conn->state = STATE_TO_ADD;
-           }
-       }
-+      
-+#ifdef IKEV2
-+      /*
-+       * Start charon
-+       */
-+      if (_action_ & FLAG_ACTION_START_CHARON)
-+      {
-+              if (starter_charon_pid() == 0)
-+              {
-+                      DBG(DBG_CONTROL,
-+                              DBG_log("Attempting to start charon...")
-+                         )
-+                      if (starter_start_charon(cfg, no_fork) != 0)
-+                      {
-+                              /* schedule next try */
-+                              alarm(PLUTO_RESTART_DELAY);
-+                      }
-+              }
-+              _action_ &= ~FLAG_ACTION_START_CHARON;
-+      }
-+#endif /* IKEV2 */
-       /*
-        * Tell pluto to reread its interfaces
-@@ -536,11 +599,36 @@
-                       conn->id = id++;
-                   }
-                   starter_whack_add_conn(conn);
-+#ifdef IKEV2
-+                  starter_stroke_add_conn(conn);
-+#endif /* IKEV2 */
-                   conn->state = STATE_ADDED;
-                   if (conn->startup == STARTUP_START)
--                      starter_whack_initiate_conn(conn);
-+                  {
-+#ifdef IKEV2
-+                      if (conn->keyexchange == 2)
-+                      {
-+                          starter_stroke_initiate_conn(conn);
-+                      }
-+                      else
-+#endif /* IKEV2 */
-+                      {
-+                          starter_whack_initiate_conn(conn);
-+                      }
-+                  }
-                   else if (conn->startup == STARTUP_ROUTE)
--                      starter_whack_route_conn(conn);
-+                  {
-+#ifdef IKEV2
-+                      if (conn->keyexchange == 2)
-+                      {
-+                              starter_stroke_route_conn(conn);
-+                      }
-+                      else
-+#endif /* IKEV2 */
-+                      {
-+                              starter_whack_route_conn(conn); 
-+                      }
-+                  }
-               }
-           }
-       }
-diff -Naur strongswan-2.6.3/programs/starter/starterstroke.c strongswan-2.6.3-charon/programs/starter/starterstroke.c
---- strongswan-2.6.3/programs/starter/starterstroke.c  1970-01-01 01:00:00.000000000 +0100
-+++ strongswan-2.6.3-charon/programs/starter/starterstroke.c   2006-03-21 09:26:24.000000000 +0100
-@@ -0,0 +1,193 @@
-+/* Stroke for charon is the counterpart to whack from pluto
-+ * Copyright (C) 2006 Martin Willi - Hochschule fuer Technik Rapperswil
-+ *
-+ * This program is free software; you can redistribute it and/or modify it
-+ * under the terms of the GNU General Public License as published by the
-+ * Free Software Foundation; either version 2 of the License, or (at your
-+ * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
-+ *
-+ * This program is distributed in the hope that it will be useful, but
-+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-+ * for more details.
-+ *
-+ * RCSID $Id: starterstroke.c $
-+ */
-+
-+#include <sys/types.h>
-+#include <sys/socket.h>
-+#include <sys/un.h>
-+#include <linux/stddef.h>
-+#include <unistd.h>
-+#include <stdlib.h>
-+#include <errno.h>
-+#include <netinet/in.h>
-+#include <arpa/inet.h>
-+
-+#include <freeswan.h>
-+
-+#include "../pluto/constants.h"
-+#include "../pluto/defs.h"
-+#include "../pluto/log.h"
-+
-+#include "starterstroke.h"
-+#include "confread.h"
-+#include "files.h"
-+
-+typedef struct stroke_msg_t stroke_msg_t;
-+
-+struct stroke_msg_t {
-+      /* length of this message with all strings */
-+      u_int16_t length;
-+      /* type of the message */
-+      enum {
-+              /* initiate a connection */
-+              STR_INITIATE,
-+              /* install SPD entries for a connection */
-+              STR_INSTALL,
-+              /* add a connection */
-+              STR_ADD_CONN,
-+              /* delete a connection */
-+              STR_DEL_CONN,
-+              /* more to come */
-+      } type;
-+      union {
-+              /* data for STR_INITIATE, STR_INSTALL */
-+              struct {
-+                      char *name;
-+              } initiate, install;
-+              /* data for STR_ADD_CONN */
-+              struct {
-+                      char *name;
-+                      struct {
-+                              char *id;
-+                              char *address;
-+                              char *subnet;
-+                              u_int8_t subnet_mask;
-+                      } me, other;
-+              } add_conn;
-+      };
-+      u_int8_t buffer[];
-+};
-+
-+static char* push_string(stroke_msg_t **strm, char *string)
-+{
-+      stroke_msg_t *stroke_msg;
-+      size_t string_length;
-+      
-+      if (string == NULL)
-+      {
-+              return NULL;
-+      }
-+      stroke_msg = *strm;
-+      string_length = strlen(string) + 1;
-+      stroke_msg->length += string_length;
-+      
-+      stroke_msg = realloc(stroke_msg, stroke_msg->length);
-+      strcpy((char*)stroke_msg + stroke_msg->length - string_length, string);
-+      
-+      *strm = stroke_msg;
-+      return (char*)(u_int)stroke_msg->length - string_length;
-+}
-+
-+static int
-+send_stroke_msg (stroke_msg_t *msg)
-+{
-+      struct sockaddr_un ctl_addr = { AF_UNIX, CHARON_CTL_FILE };
-+      int sock;
-+      
-+      sock = socket(AF_UNIX, SOCK_STREAM, 0);
-+      if (sock < 0)
-+      {
-+      plog("socket() failed: %s", strerror(errno));
-+      return -1;
-+      }
-+      if (connect(sock, (struct sockaddr *)&ctl_addr,
-+      offsetof(struct sockaddr_un, sun_path) + strlen(ctl_addr.sun_path)) < 0)
-+      {
-+      plog("connect(charon_ctl) failed: %s", strerror(errno));
-+      close(sock);
-+      return -1;
-+      }
-+      
-+      /* send message */
-+      if (write(sock, msg, msg->length) != msg->length)
-+      {
-+      plog("write(charon_ctl) failed: %s", strerror(errno));
-+      close(sock);
-+      return -1;
-+      }
-+      
-+      close(sock);
-+      return 0;
-+}
-+
-+static char *
-+connection_name(starter_conn_t *conn)
-+{
-+    /* if connection name is '%auto', create a new name like conn_xxxxx */
-+    static char buf[32];
-+
-+    if (streq(conn->name, "%auto"))
-+    {
-+      sprintf(buf, "conn_%ld", conn->id);
-+      return buf;
-+    }
-+    return conn->name;
-+}
-+
-+
-+int starter_stroke_add_conn(starter_conn_t *conn)
-+{
-+      stroke_msg_t *msg = malloc(sizeof(stroke_msg_t));
-+      int res;
-+      
-+      msg->length = sizeof(stroke_msg_t);
-+      msg->type = STR_ADD_CONN;
-+      
-+      msg->add_conn.name = push_string(&msg, connection_name(conn));
-+      
-+      msg->add_conn.me.id = push_string(&msg, conn->left.id);
-+      msg->add_conn.me.address = push_string(&msg, inet_ntoa(conn->left.addr.u.v4.sin_addr));
-+      msg->add_conn.me.subnet = push_string(&msg, inet_ntoa(conn->left.subnet.addr.u.v4.sin_addr));
-+      msg->add_conn.me.subnet_mask = conn->left.subnet.maskbits;
-+      
-+      msg->add_conn.other.id = push_string(&msg, conn->right.id);
-+      msg->add_conn.other.address = push_string(&msg, inet_ntoa(conn->right.addr.u.v4.sin_addr));
-+      msg->add_conn.other.subnet = push_string(&msg, inet_ntoa(conn->right.subnet.addr.u.v4.sin_addr));
-+      msg->add_conn.other.subnet_mask = conn->right.subnet.maskbits;
-+      
-+      res = send_stroke_msg(msg);
-+      free(msg);
-+      return res;
-+}
-+
-+int starter_stroke_del_conn(starter_conn_t *conn)
-+{
-+      return 0;
-+}
-+int starter_stroke_route_conn(starter_conn_t *conn)
-+{
-+      stroke_msg_t *msg = malloc(sizeof(stroke_msg_t));
-+      int res;
-+      
-+      msg->length = sizeof(stroke_msg_t);
-+      msg->type = STR_INSTALL;
-+      msg->install.name = push_string(&msg, connection_name(conn));
-+      res = send_stroke_msg(msg);
-+      free(msg);
-+      return res;
-+}
-+
-+int starter_stroke_initiate_conn(starter_conn_t *conn)
-+{
-+      stroke_msg_t *msg = malloc(sizeof(stroke_msg_t));
-+      int res;
-+      
-+      msg->length = sizeof(stroke_msg_t);
-+      msg->type = STR_INITIATE;
-+      msg->initiate.name = push_string(&msg, connection_name(conn));
-+      res = send_stroke_msg(msg);
-+      free(msg);
-+      return res;
-+}
-diff -Naur strongswan-2.6.3/programs/starter/starterstroke.h strongswan-2.6.3-charon/programs/starter/starterstroke.h
---- strongswan-2.6.3/programs/starter/starterstroke.h  1970-01-01 01:00:00.000000000 +0100
-+++ strongswan-2.6.3-charon/programs/starter/starterstroke.h   2006-03-21 09:26:24.000000000 +0100
-@@ -0,0 +1,27 @@
-+/* Stroke for charon is the counterpart to whack from pluto
-+ * Copyright (C) 2006 Martin Willi - Hochschule fuer Technik Rapperswil
-+ *
-+ * This program is free software; you can redistribute it and/or modify it
-+ * under the terms of the GNU General Public License as published by the
-+ * Free Software Foundation; either version 2 of the License, or (at your
-+ * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
-+ *
-+ * This program is distributed in the hope that it will be useful, but
-+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-+ * for more details.
-+ *
-+ * RCSID $Id: starterstroke.h $
-+ */
-+
-+#ifndef _STARTER_STROKE_H_
-+#define _STARTER_STROKE_H_
-+
-+#include "confread.h"
-+
-+extern int starter_stroke_add_conn(starter_conn_t *conn);
-+extern int starter_stroke_del_conn(starter_conn_t *conn);
-+extern int starter_stroke_route_conn(starter_conn_t *conn);
-+extern int starter_stroke_initiate_conn(starter_conn_t *conn);
-+
-+#endif /* _STARTER_STROKE_H_ */
-diff -Naur strongswan-2.6.3/programs/starter/starterwhack.c strongswan-2.6.3-charon/programs/starter/starterwhack.c
---- strongswan-2.6.3/programs/starter/starterwhack.c   2006-02-08 21:56:07.000000000 +0100
-+++ strongswan-2.6.3-charon/programs/starter/starterwhack.c    2006-03-21 09:26:24.000000000 +0100
-@@ -54,7 +54,7 @@
- static int
- send_whack_msg (whack_message_t *msg)
- {
--    struct sockaddr_un ctl_addr = { AF_UNIX, CTL_FILE };
-+    struct sockaddr_un ctl_addr = { AF_UNIX, PLUTO_CTL_FILE };
-     int sock;
-     ssize_t len;
-     char *str_next, *str_roof;
index 58ff4e6..c95bccb 100644 (file)
 # for more details.
 #
 
-CONFIG_DIR= $(MAIN_DIR)config/
+CONFIG_DIR= $(CHARON_DIR)config/
 
 
                                                
-OBJS+= $(BUILD_DIR)connection.o
+CHARON_OBJS+= $(BUILD_DIR)connection.o
 $(BUILD_DIR)connection.o :                                     $(CONFIG_DIR)connection.c $(CONFIG_DIR)connection.h
                                                                                        $(CC) $(CFLAGS) -c -o $@ $<
                                                                                        
-OBJS+= $(BUILD_DIR)policy.o
+CHARON_OBJS+= $(BUILD_DIR)policy.o
 $(BUILD_DIR)policy.o :                                         $(CONFIG_DIR)policy.c $(CONFIG_DIR)policy.h
                                                                                        $(CC) $(CFLAGS) -c -o $@ $<
 
-OBJS+= $(BUILD_DIR)traffic_selector.o
+CHARON_OBJS+= $(BUILD_DIR)traffic_selector.o
 $(BUILD_DIR)traffic_selector.o :                       $(CONFIG_DIR)traffic_selector.c $(CONFIG_DIR)traffic_selector.h
                                                                                        $(CC) $(CFLAGS) -c -o $@ $<
 
-OBJS+= $(BUILD_DIR)proposal.o
+CHARON_OBJS+= $(BUILD_DIR)proposal.o
 $(BUILD_DIR)proposal.o :                                       $(CONFIG_DIR)proposal.c $(CONFIG_DIR)proposal.h
                                                                                        $(CC) $(CFLAGS) -c -o $@ $<
 
-OBJS+= $(BUILD_DIR)configuration.o
+CHARON_OBJS+= $(BUILD_DIR)configuration.o
 $(BUILD_DIR)configuration.o :                          $(CONFIG_DIR)configuration.c $(CONFIG_DIR)configuration.h
                                                                                        $(CC) $(CFLAGS) -c -o $@ $<
\ No newline at end of file
index 9ec26b7..8ecce9d 100644 (file)
 #define CONNECTION_H_
 
 #include <types.h>
-#include <network/host.h>
+#include <utils/host.h>
 #include <utils/linked_list.h>
 #include <utils/identification.h>
 #include <config/proposal.h>
-#include <transforms/diffie_hellman.h>
+#include <crypto/diffie_hellman.h>
 
 
 typedef enum auth_method_t auth_method_t;
index 27f957a..27f1a28 100755 (executable)
@@ -24,8 +24,8 @@
 #define CREDENTIAL_STORE_H_
 
 #include <types.h>
-#include <transforms/rsa/rsa_private_key.h>
-#include <transforms/rsa/rsa_public_key.h>
+#include <crypto/rsa/rsa_private_key.h>
+#include <crypto/rsa/rsa_public_key.h>
 
 
 typedef struct credential_store_t credential_store_t;
index 9c75406..48e3ad8 100644 (file)
 #include <types.h>
 #include <utils/identification.h>
 #include <utils/linked_list.h>
-#include <network/host.h>
-#include <transforms/crypters/crypter.h>
-#include <transforms/signers/signer.h>
-#include <transforms/diffie_hellman.h>
+#include <utils/host.h>
+#include <crypto/crypters/crypter.h>
+#include <crypto/signers/signer.h>
+#include <crypto/diffie_hellman.h>
 #include <config/traffic_selector.h>
 
 
index 7e59b53..5ac5bde 100644 (file)
@@ -24,7 +24,7 @@
 #define TRAFFIC_SELECTOR_H_
 
 #include <types.h>
-#include <network/host.h>
+#include <utils/host.h>
 
 typedef enum ts_type_t ts_type_t;
 
index a64845e..9f4d738 100644 (file)
 #include <config/credential_store.h>
 
 /**
+ * @mainpage
+ *
+ * @section Threading Architecture
+ *
+ * All IKEv2 stuff is handled in charon. It uses a newer and more flexible
+ * architecture than pluto. Charon uses a thread-pool, which allows parallel
+ * execution SA-management. Beside the thread-pool, there are some special purpose
+ * threads which do their job for the common health of the daemon.
+   @verbatim 
+                         +------+
+                         | E  Q |
+                         | v  u |---+                   +------+  +------+
+                         | e  e |   |                   |      |  | IKE- |
+                         | n  u |  +-----------+        |      |--| SA   |
+                         | t  e |  |           |        | I  M |  +------+
+       +------------+    | -    |  | Scheduler |        | K  a |
+       |  receiver  |    +------+  |           |        | E  n |  +------+
+       +----+-------+              +-----------+        | -  a |  | IKE- |
+            |      |     +------+   |                   | S  g |--| SA   |
+    +-------+--+   +-----| J  Q |---+  +------------+   | A  e |  +------+
+   -|  socket  |         | o  u |      |            |   | -  r |
+    +-------+--+         | b  e |      |   Thread-  |   |      |
+            |            | -  u |      |   Pool     |   |      |
+       +----+-------+    |    e |------|            |---|      |
+       |   sender   |    +------+      +------------+   +------+
+       +----+-------+
+            |            +------+
+            |            | S  Q |
+            |            | e  u |
+            |            | n  e |
+            +------------| d  u |
+                         | -  e |
+                         +--+---+
+   @endverbatim
+ * The thread-pool is the heart of the architecture. It processes jobs from a
+ * (fully synchronized) job-queue. Mostly, a job is associated with a specific
+ * IKE SA. These IKE SAs are synchronized, only one thread can work one an IKE SA.
+ * This makes it unnecesary to use further synchronisation methods once a IKE SA
+ * is checked out. The (rather complex) synchronization of IKE SAs is completely
+ * done in the IKE SA manager.
+ * The sceduler is responsible for event firing. It waits until a event in the
+ * (fully synchronized) event-queue is ready for processing and pushes the event
+ * down to the job-queue. A thread form the pool will pick it up as quick as
+ * possible. Every thread can queue events or jobs. Furter, an event can place a
+ * packet in the send-queue. The sender thread waits for those packets and sends
+ * them over the wire, via the socket. The receiver does exactly the opposite of
+ * the sender. It waits on the socket, reads in packets an places them on the
+ * job-queue for further processing by a thread from the pool.
+ * There are even more threads, not drawn in the upper scheme. The stroke thread
+ * is responsible for reading and processessing commands from another process. The
+ * kernel interface thread handles communication from and to the kernel via a
+ * netlink socket. It waits for kernel events and processes them appropriately.
+ */
+
+/**
  * Name of the daemon.
  */
 #define DAEMON_NAME "charon"
diff --git a/Source/charon/definitions.c b/Source/charon/definitions.c
deleted file mode 100644 (file)
index 59c97a2..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * @file definitions.c
- * 
- * @brief General purpose definitions and macros.
- * 
- */
-
-/*
- * Copyright (C) 2005 Jan Hutter, Martin Willi
- * Hochschule fuer Technik Rapperswil
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * for more details.
- */
-
-#include "definitions.h"
-
-/*
- * Described in header.
- */
-char *mapping_find(mapping_t * maps, int value)
-{
-       int i = 0;
-       while (maps[i].value != MAPPING_END)
-       {
-               if (maps[i].value == value)
-               {
-                       return maps[i].string;
-               }
-               i++;
-       }
-       return "INVALID MAPPING";
-}
diff --git a/Source/charon/definitions.h b/Source/charon/definitions.h
deleted file mode 100644 (file)
index 4ca4606..0000000
+++ /dev/null
@@ -1,292 +0,0 @@
-/**
- * @file definitions.h
- * 
- * @brief General purpose definitions and macros.
- * 
- */
-
-/*
- * Copyright (C) 2005 Jan Hutter, Martin Willi
- * Hochschule fuer Technik Rapperswil
- * Copyright (C) 1998, 1999  D. Hugh Redelmeier. (Endian stuff)
- * 
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * for more details.
- */
-
-#ifndef DEFINITIONS_H_
-#define DEFINITIONS_H_
-
-
-
-/* stolen from strongswan */
-#if linux
-# if defined(i386) && !defined(__i386__)
-#  define __i386__ 1
-#  define MYHACKFORTHIS 1
-# endif
-# include <endian.h>
-# ifdef MYHACKFORTHIS
-#  undef __i386__
-#  undef MYHACKFORTHIS
-# endif
-#elif !(defined(BIG_ENDIAN) && defined(LITTLE_ENDIAN) && defined(BYTE_ORDER))
- /* we don't know how to do this, so we require the macros to be defined
-  * with compiler flags:
-  *    -DBIG_ENDIAN=4321 -DLITTLE_ENDIAN=1234 -DBYTE_ORDER=BIG_ENDIAN
-  * or -DBIG_ENDIAN=4321 -DLITTLE_ENDIAN=1234 -DBYTE_ORDER=LITTLE_ENDIAN
-  * Thse match the GNU definitions
-  */
-# include <sys/endian.h>
-#endif
-
-#ifndef BIG_ENDIAN
- #error "BIG_ENDIAN must be defined"
-#endif
-
-#ifndef LITTLE_ENDIAN
- #error "LITTLE_ENDIAN must be defined"
-#endif
-
-#ifndef BYTE_ORDER
- #error "BYTE_ORDER must be defined"
-#endif
-
-/**
- * @mainpage
- *
- * @section Threading Architecture
- *
- * All IKEv2 stuff is handled in charon. It uses a newer and more flexible
- * architecture than pluto. Charon uses a thread-pool, which allows parallel
- * execution SA-management. Beside the thread-pool, there are some special purpose
- * threads which do their job for the common health of the daemon.
-   @verbatim 
-                         +------+
-                         | E  Q |
-                         | v  u |---+                   +------+  +------+
-                         | e  e |   |                   |      |  | IKE- |
-                         | n  u |  +-----------+        |      |--| SA   |
-                         | t  e |  |           |        | I  M |  +------+
-       +------------+    | -    |  | Scheduler |        | K  a |
-       |  receiver  |    +------+  |           |        | E  n |  +------+
-       +----+-------+              +-----------+        | -  a |  | IKE- |
-            |      |     +------+   |                   | S  g |--| SA   |
-    +-------+--+   +-----| J  Q |---+  +------------+   | A  e |  +------+
-   -|  socket  |         | o  u |      |            |   | -  r |
-    +-------+--+         | b  e |      |   Thread-  |   |      |
-            |            | -  u |      |   Pool     |   |      |
-       +----+-------+    |    e |------|            |---|      |
-       |   sender   |    +------+      +------------+   +------+
-       +----+-------+
-            |            +------+
-            |            | S  Q |
-            |            | e  u |
-            |            | n  e |
-            +------------| d  u |
-                         | -  e |
-                         +--+---+
-   @endverbatim
- * The thread-pool is the heart of the architecture. It processes jobs from a
- * (fully synchronized) job-queue. Mostly, a job is associated with a specific
- * IKE SA. These IKE SAs are synchronized, only one thread can work one an IKE SA.
- * This makes it unnecesary to use further synchronisation methods once a IKE SA
- * is checked out. The (rather complex) synchronization of IKE SAs is completely
- * done in the IKE SA manager.
- * The sceduler is responsible for event firing. It waits until a event in the
- * (fully synchronized) event-queue is ready for processing and pushes the event
- * down to the job-queue. A thread form the pool will pick it up as quick as
- * possible. Every thread can queue events or jobs. Furter, an event can place a
- * packet in the send-queue. The sender thread waits for those packets and sends
- * them over the wire, via the socket. The receiver does exactly the opposite of
- * the sender. It waits on the socket, reads in packets an places them on the
- * job-queue for further processing by a thread from the pool.
- * There are even more threads, not drawn in the upper scheme. The stroke thread
- * is responsible for reading and processessing commands from another process. The
- * kernel interface thread handles communication from and to the kernel via a
- * netlink socket. It waits for kernel events and processes them appropriately.
- */
-
-/**
- * @defgroup config config
- * 
- * Classes implementing configuration related things.
- */
-
-/**
- * @defgroup encoding encoding
- * 
- * Classes used to encode and decode IKEv2 messages.
- */
-
-/**
- * @defgroup network network
- * 
- * Classes for network relevant stuff.
- */
- /**
- * @defgroup payloads payloads
- * 
- * Classes representing specific IKEv2 payloads.
- * 
- * @ingroup encoding
- */
-
-/**
- * @defgroup sa sa
- * 
- * Security association and helper classes.
- */
-
-
-/**
- * @defgroup states states
- *
- * Varius states in which an IKE SA can be.
- *
- * @ingroup sa
- */
-
-/**
- * @defgroup queues queues
- * 
- * Different kind of queues.
- */
- /**
-  * @defgroup jobs jobs
-  * 
-  * Jobs used in job queue and event queue.
-  * 
-  * @ingroup queues
-  */
-
-/**
- * @defgroup testcases testcases
- * 
- * Testcases used to test the different classes in seperate module tests.
- */
-
-/**
- * @defgroup transforms transforms
- * 
- * Transform algorithms of different kind.
- */
-/**
- * @defgroup rsa rsa
- * 
- * RSA public key algorithm.
- * 
- * @ingroup transforms
- */
-/**
- * @defgroup prfs prfs
- * 
- * Pseudo random functions.
- * 
- * @ingroup transforms
- */
-
-/**
- * @defgroup signers signers
- * 
- * Symmetric signing algorithms, used to ensure message integrity.
- * 
- * @ingroup transforms
- */
-
-/**
- * @defgroup crypters crypters
- * 
- * Symmetric encryption algorithms, used to encrypt and decrypt.
- * 
- * @ingroup transforms
- */
-/**
- * @defgroup hashers hashers
- * 
- * Hashing algorithms.
- * 
- * @ingroup transforms
- */
-/**
- * @defgroup asn1 asn1
- * 
- * ASN1 structure definition, en-/decoder of for DER
- * 
- * @todo Implement a der_encoder_t class.
- */
-/**
- * @defgroup utils utils
- * 
- * Generic helper classes.
- */
-  
-/**
- * @defgroup threads threads
- * 
- * Threaded classes, which will do their job alone.
- */
-/**
- * Macro gives back larger of two values.
- */
-#define max(x,y) (x > y ? x : y)
-
-/**
- * Macro gives back smaller of two values.
- */
-#define min(x,y) (x < y ? x : y)
-
-/**
- * Debug macro to follow control flow
- */
-#define POS printf("%s, line %d\n", __FILE__, __LINE__)
-
-/**
- * Papping entry which defines the end of a mapping_t array.
- */
-#define MAPPING_END (-1)
-
-
-typedef struct mapping_t mapping_t;
-
-/**
- * @brief Mapping entry, where enum-to-string mappings are stored.
- */
-struct mapping_t
-{
-       /**
-        * Enumeration value.
-        */
-       int value;
-       
-       /**
-        * Mapped string.
-        */
-       char *string;
-};
-
-
-/**
- * @brief Find a mapping_string in the mapping[].
- * 
- * @param mappings             mappings array
- * @param value                        enum-value to get the string from
- * 
- */
-char *mapping_find(mapping_t *mappings, int value);
-
-#endif /*DEFINITIONS_H_*/
diff --git a/Source/charon/doc/Architecture.txt b/Source/charon/doc/Architecture.txt
deleted file mode 100644 (file)
index 3e8855f..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
- strongSwans overall design
-============================
-
-IKEv1 and IKEv2 is handled in different keying daemons. The ole IKEv1 stuff is
-completely handled in pluto, as it was all the times. IKEv2 is handled in the
-new keying daemon, which is called charon. 
-Daemon control is done over unix sockets. Pluto uses whack, as it did for years.
-Charon uses another socket interface, called stroke. Stroke uses another
-format as whack and therefore is not compatible to whack. The starter utility,
-wich does fast configuration parsing, speaks both the protocols, whack and
-stroke. It also handles daemon startup and termination. 
-Pluto uses starter for some commands, for other it uses the whack utility. To be
-as close to pluto as possible, charon has the same split up of commands to
-starter and stroke. All commands are wrapped together in the ipsec script, which
-allows transparent control of both daemons.
-
-         +-----------------------------------------+
-         |                  ipsec                  |
-         +-----+--------------+---------------+----+
-               |              |               |
-               |              |               |
-               |        +-----+-----+         |
-         +-----+----+   |           |   +-----+----+
-         |          |   |  starter  |   |          |
-         |  stroke  |   |           |   |   whack  |
-         |          |   +---+--+----+   |          |
-         +------+---+       |  |        +--+-------+
-                |           |  |           |
-            +---+------+    |  |    +------+--+
-            |          |    |  |    |         |
-            |  charon  +----+  +----+  pluto  |
-            |          |            |         |
-            +-----+----+            +----+----+
-                  |                      |
-            +-----+----+                 |
-            |    LSF   |                 |
-            +-----+----+                 |
-                  |                      |
-            +-----+----+            +----+----+
-            | RAW Sock |            | UDP/500 |
-            +----------+            +---------+
-
-Since IKEv2 uses the same port as IKEv1, both daemons must listen to UDP port
-500. Under Linux, there is no clean way to set up two sockets at the same port.
-To reslove this problem, charon uses a RAW socket, as they are used in network
-sniffers. An installed Linux Socket Filter (LSF) filters out all none-IKEv2
-traffic. Pluto receives any IKE message, independant of charons behavior.
-Therefore plutos behavior is changed to discard any IKEv2 traffic silently.
-
-
- IKEv2 keying daemon: charon
-=============================
-
- Threading modell
-------------------
-
-All IKEv2 stuff is handled in charon. It uses a newer and more flexible
-architecture than pluto. Charon uses a thread-pool, which allows parallel
-execution SA-management. Beside the thread-pool, there are some special purpose
-threads which do their job for the common health of the daemon.
-
-                       +------+
-                       | E  Q |
-                       | v  u |---+                   +------+  +------+
-                       | e  e |   |                   |      |  | IKE- |
-                       | n  u |  +-----------+        |      |--| SA   |
-                       | t  e |  |           |        | I  M |  +------+
-     +------------+    | -    |  | Scheduler |        | K  a |
-     |  receiver  |    +------+  |           |        | E  n |  +------+
-     +----+-------+              +-----------+        | -  a |  | IKE- |
-          |      |     +------+   |                   | S  g |--| SA   |
-  +-------+--+   +-----| J  Q |---+  +------------+   | A  e |  +------+
- -|  socket  |         | o  u |      |            |   | -  r |
-  +-------+--+         | b  e |      |   Thread-  |   |      |
-          |            | -  u |      |   Pool     |   |      |
-     +----+-------+    |    e |------|            |---|      |
-     |   sender   |    +------+      +------------+   +------+
-     +----+-------+
-          |            +------+
-          |            | S  Q |
-          |            | e  u |
-          |            | n  e |
-          +------------| d  u |
-                       | -  e |
-                       +--+---+
-
-The thread-pool is the heart of the architecture. It processes jobs from a
-(fully synchronized) job-queue. Mostly, a job is associated with a specific
-IKE SA. These IKE SAs are synchronized, only one thread can work one an IKE SA.
-This makes it unnecesary to use further synchronisation methods once a IKE SA
-is checked out. The (rather complex) synchronization of IKE SAs is completely
-done in the IKE SA manager.
-The sceduler is responsible for event firing. It waits until a event in the
-(fully synchronized) event-queue is ready for processing and pushes the event
-down to the job-queue. A thread form the pool will pick it up as quick as
-possible. Every thread can queue events or jobs. Furter, an event can place a
-packet in the send-queue. The sender thread waits for those packets and sends
-them over the wire, via the socket. The receiver does exactly the opposite of
-the sender. It waits on the socket, reads in packets an places them on the
-job-queue for further processing by a thread from the pool.
-There are even more threads, not drawn in the upper scheme. The stroke thread
-is responsible for reading and processessing commands from another process. The
-kernel interface thread handles communication from and to the kernel via a
-netlink socket. It waits for kernel events and processes them appropriately.
-
-
- configuration backends
-------------------------
-
-The configuration architecture for charon is complex, but is flexible and
-extensible. All configuration stuff is split up in multiple parts:
-
-connection      Defines a connection between two hosts. Proposals define with
-                wich algorithms a IKE SA should be set up.
-policy          Defines the rules to apply ontop of a connection. A policy is
-                defined between two IDs. Proposals and traffic selectors allow
-                fine grained configuration of the CHILD SAs (AH and ESP) to set
-                up.
-credential      A credential is something used for authentication, such as a
-                preshared key, a RSA private or public key, certificate, ...
-configuration   The configuration itself handles daemon related configuration
-                stuff, such as interface binding or logging settings.
-
-These configuration types are defined as interfaces, and are currently
-implemented only in the stroke class. Through the modular design, parts could be
-replaced with more powerful backends, such as a RADIUS server for the
-credentials, a SQL database for the connections, policy definitions on an LDAP
-server, and so on...
diff --git a/Source/charon/doc/Todo-list.txt b/Source/charon/doc/Todo-list.txt
deleted file mode 100644 (file)
index 404e45e..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
- TODO-List for charon
-======================
-
-+ = done, - = todo, ordered by priority
-
-+ private key loading: der, without passphrase
-+ load all private keys from ipsec.d/private/ in stroke.c
-+ handle leftcert and rightcert in starterstroke.c/stroke.c
-+ load specified certs in stroke.c
-+ extract public keys from certs
-+ public key authentication
-+ release for Andreas
-
-+ stroke loglevels
-+ stroke up
-+ ike_sa_manager checkout_by_hosts
-+ stroke down
-+ stroke output redirection
-+ stroke status
-
-- libx509
-  - new charon build - libstrong?
-    - transforms
-    - utils (plus host)
-  - integrate asn1 parser/oid (asn1/oid)
-  - integrate PEM loading (pem)
-  - ... (more to come, for sure)
-
-- ipsec.secrets parsing
-
-- certificate DN parsing
-- certificate subjectAltName parsing
-- certificate lookup via ID
-- certificate validation/chaining
-- certificate exchange
-
-- trapping
-
-- delete notify, when to send?
-- notifys on connection setup failure
-- create child sa message
\ No newline at end of file
index 2f5576a..ccdb42f 100644 (file)
 # for more details.
 #
 
-ENCODING_DIR= $(MAIN_DIR)encoding/
+ENCODING_DIR= $(CHARON_DIR)encoding/
 
-OBJS+= $(BUILD_DIR)generator.o
+CHARON_OBJS+= $(BUILD_DIR)generator.o
 $(BUILD_DIR)generator.o :              $(ENCODING_DIR)generator.c $(ENCODING_DIR)generator.h
                                                                $(CC) $(CFLAGS) -c -o $@ $<
 
-OBJS+= $(BUILD_DIR)parser.o
+CHARON_OBJS+= $(BUILD_DIR)parser.o
 $(BUILD_DIR)parser.o :                 $(ENCODING_DIR)parser.c $(ENCODING_DIR)parser.h
                                                                $(CC) $(CFLAGS) -c -o $@ $<
 
-OBJS+= $(BUILD_DIR)message.o
+CHARON_OBJS+= $(BUILD_DIR)message.o
 $(BUILD_DIR)message.o :                        $(ENCODING_DIR)message.c $(ENCODING_DIR)message.h
                                                                $(CC) $(CFLAGS) -c -o $@ $<
 
index ef4491c..e3a72f4 100644 (file)
@@ -29,8 +29,8 @@
 #include <encoding/payloads/ike_header.h>
 #include <encoding/payloads/notify_payload.h>
 #include <utils/linked_list.h>
-#include <transforms/crypters/crypter.h>
-#include <transforms/signers/signer.h>
+#include <crypto/crypters/crypter.h>
+#include <crypto/signers/signer.h>
 
 
 typedef struct message_t message_t;
index 19b9a3b..61d9209 100644 (file)
 
 PAYLOADS_DIR= $(ENCODING_DIR)payloads/
 
-OBJS+= $(BUILD_DIR)encodings.o
+CHARON_OBJS+= $(BUILD_DIR)encodings.o
 $(BUILD_DIR)encodings.o :                              $(PAYLOADS_DIR)encodings.c $(PAYLOADS_DIR)encodings.h
                                                                                $(CC) $(CFLAGS) -c -o $@ $<
 
-OBJS+= $(BUILD_DIR)ike_header.o
+CHARON_OBJS+= $(BUILD_DIR)ike_header.o
 $(BUILD_DIR)ike_header.o :                             $(PAYLOADS_DIR)ike_header.c $(PAYLOADS_DIR)ike_header.h
                                                                                $(CC) $(CFLAGS) -c -o $@ $<
 
-OBJS+= $(BUILD_DIR)ke_payload.o
+CHARON_OBJS+= $(BUILD_DIR)ke_payload.o
 $(BUILD_DIR)ke_payload.o :                             $(PAYLOADS_DIR)ke_payload.c $(PAYLOADS_DIR)ke_payload.h
                                                                                $(CC) $(CFLAGS) -c -o $@ $<
 
-OBJS+= $(BUILD_DIR)nonce_payload.o
+CHARON_OBJS+= $(BUILD_DIR)nonce_payload.o
 $(BUILD_DIR)nonce_payload.o :                  $(PAYLOADS_DIR)nonce_payload.c $(PAYLOADS_DIR)nonce_payload.h
                                                                                $(CC) $(CFLAGS) -c -o $@ $<
 
-OBJS+= $(BUILD_DIR)notify_payload.o
+CHARON_OBJS+= $(BUILD_DIR)notify_payload.o
 $(BUILD_DIR)notify_payload.o :                 $(PAYLOADS_DIR)notify_payload.c $(PAYLOADS_DIR)notify_payload.h
                                                                                $(CC) $(CFLAGS) -c -o $@ $<
 
-OBJS+= $(BUILD_DIR)id_payload.o
+CHARON_OBJS+= $(BUILD_DIR)id_payload.o
 $(BUILD_DIR)id_payload.o :                             $(PAYLOADS_DIR)id_payload.c $(PAYLOADS_DIR)id_payload.h
                                                                                $(CC) $(CFLAGS) -c -o $@ $<
                                                                                
-OBJS+= $(BUILD_DIR)auth_payload.o
+CHARON_OBJS+= $(BUILD_DIR)auth_payload.o
 $(BUILD_DIR)auth_payload.o :                           $(PAYLOADS_DIR)auth_payload.c $(PAYLOADS_DIR)auth_payload.h
                                                                                $(CC) $(CFLAGS) -c -o $@ $<
                                                                                
-OBJS+= $(BUILD_DIR)cert_payload.o
+CHARON_OBJS+= $(BUILD_DIR)cert_payload.o
 $(BUILD_DIR)cert_payload.o :                   $(PAYLOADS_DIR)cert_payload.c $(PAYLOADS_DIR)cert_payload.h
                                                                                $(CC) $(CFLAGS) -c -o $@ $<
 
-OBJS+= $(BUILD_DIR)certreq_payload.o
+CHARON_OBJS+= $(BUILD_DIR)certreq_payload.o
 $(BUILD_DIR)certreq_payload.o :                        $(PAYLOADS_DIR)certreq_payload.c $(PAYLOADS_DIR)certreq_payload.h
                                                                                $(CC) $(CFLAGS) -c -o $@ $<
 
-OBJS+= $(BUILD_DIR)delete_payload.o
+CHARON_OBJS+= $(BUILD_DIR)delete_payload.o
 $(BUILD_DIR)delete_payload.o :                 $(PAYLOADS_DIR)delete_payload.c $(PAYLOADS_DIR)delete_payload.h
                                                                                $(CC) $(CFLAGS) -c -o $@ $<
 
-OBJS+= $(BUILD_DIR)vendor_id_payload.o
+CHARON_OBJS+= $(BUILD_DIR)vendor_id_payload.o
 $(BUILD_DIR)vendor_id_payload.o :              $(PAYLOADS_DIR)vendor_id_payload.c $(PAYLOADS_DIR)vendor_id_payload.h
                                                                                $(CC) $(CFLAGS) -c -o $@ $<
                                                                                
-OBJS+= $(BUILD_DIR)cp_payload.o
+CHARON_OBJS+= $(BUILD_DIR)cp_payload.o
 $(BUILD_DIR)cp_payload.o :                             $(PAYLOADS_DIR)cp_payload.c $(PAYLOADS_DIR)cp_payload.h
                                                                                $(CC) $(CFLAGS) -c -o $@ $<
                                                                                
-OBJS+= $(BUILD_DIR)configuration_attribute.o
+CHARON_OBJS+= $(BUILD_DIR)configuration_attribute.o
 $(BUILD_DIR)configuration_attribute.o :        $(PAYLOADS_DIR)configuration_attribute.c $(PAYLOADS_DIR)configuration_attribute.h
                                                                                $(CC) $(CFLAGS) -c -o $@ $<
 
-OBJS+= $(BUILD_DIR)eap_payload.o
+CHARON_OBJS+= $(BUILD_DIR)eap_payload.o
 $(BUILD_DIR)eap_payload.o :                            $(PAYLOADS_DIR)eap_payload.c $(PAYLOADS_DIR)eap_payload.h
                                                                                $(CC) $(CFLAGS) -c -o $@ $<
                                                                                
-OBJS+= $(BUILD_DIR)unknown_payload.o
+CHARON_OBJS+= $(BUILD_DIR)unknown_payload.o
 $(BUILD_DIR)unknown_payload.o :                        $(PAYLOADS_DIR)unknown_payload.c $(PAYLOADS_DIR)unknown_payload.h
                                                                                $(CC) $(CFLAGS) -c -o $@ $<
 
-OBJS+= $(BUILD_DIR)ts_payload.o
+CHARON_OBJS+= $(BUILD_DIR)ts_payload.o
 $(BUILD_DIR)ts_payload.o :                             $(PAYLOADS_DIR)ts_payload.c $(PAYLOADS_DIR)ts_payload.h
                                                                                $(CC) $(CFLAGS) -c -o $@ $<
 
-OBJS+= $(BUILD_DIR)traffic_selector_substructure.o
+CHARON_OBJS+= $(BUILD_DIR)traffic_selector_substructure.o
 $(BUILD_DIR)traffic_selector_substructure.o :  $(PAYLOADS_DIR)traffic_selector_substructure.c $(PAYLOADS_DIR)traffic_selector_substructure.h
                                                                                                $(CC) $(CFLAGS) -c -o $@ $<
 
-OBJS+= $(BUILD_DIR)payload.o
+CHARON_OBJS+= $(BUILD_DIR)payload.o
 $(BUILD_DIR)payload.o :                                        $(PAYLOADS_DIR)payload.c $(PAYLOADS_DIR)payload.h
                                                                                $(CC) $(CFLAGS) -c -o $@ $<
 
-OBJS+= $(BUILD_DIR)proposal_substructure.o
+CHARON_OBJS+= $(BUILD_DIR)proposal_substructure.o
 $(BUILD_DIR)proposal_substructure.o :  $(PAYLOADS_DIR)proposal_substructure.c $(PAYLOADS_DIR)proposal_substructure.h
                                                                                $(CC) $(CFLAGS) -c -o $@ $<
 
-OBJS+= $(BUILD_DIR)sa_payload.o
+CHARON_OBJS+= $(BUILD_DIR)sa_payload.o
 $(BUILD_DIR)sa_payload.o :                             $(PAYLOADS_DIR)sa_payload.c $(PAYLOADS_DIR)sa_payload.h
                                                                                $(CC) $(CFLAGS) -c -o $@ $<
 
-OBJS+= $(BUILD_DIR)transform_attribute.o
+CHARON_OBJS+= $(BUILD_DIR)transform_attribute.o
 $(BUILD_DIR)transform_attribute.o :            $(PAYLOADS_DIR)transform_attribute.c $(PAYLOADS_DIR)transform_attribute.h
                                                                                $(CC) $(CFLAGS) -c -o $@ $<
 
-OBJS+= $(BUILD_DIR)transform_substructure.o
+CHARON_OBJS+= $(BUILD_DIR)transform_substructure.o
 $(BUILD_DIR)transform_substructure.o : $(PAYLOADS_DIR)transform_substructure.c $(PAYLOADS_DIR)transform_substructure.h
                                                                                $(CC) $(CFLAGS) -c -o $@ $<
 
-OBJS+= $(BUILD_DIR)encryption_payload.o
+CHARON_OBJS+= $(BUILD_DIR)encryption_payload.o
 $(BUILD_DIR)encryption_payload.o :             $(PAYLOADS_DIR)encryption_payload.c $(PAYLOADS_DIR)encryption_payload.h
                                                                                $(CC) $(CFLAGS) -c -o $@ $<
                                                                
index da48c83..70bbe97 100644 (file)
@@ -34,7 +34,7 @@
 #include <encoding/parser.h>
 #include <utils/iterator.h>
 #include <utils/randomizer.h>
-#include <transforms/signers/signer.h>
+#include <crypto/signers/signer.h>
 
 
 
@@ -294,7 +294,12 @@ static status_t encrypt(private_encryption_payload_t *this)
        /* build padding */
        block_size = this->crypter->get_block_size(this->crypter);
        padding.len = block_size - ((this->decrypted.len + 1) %  block_size);
-       randomizer->allocate_pseudo_random_bytes(randomizer, padding.len, &padding);
+       status = randomizer->allocate_pseudo_random_bytes(randomizer, padding.len, &padding);
+       if (status != SUCCESS)
+       {
+               randomizer->destroy(randomizer);
+               return status;
+       }
        
        /* concatenate payload data, padding, padding len */
        to_crypt.len = this->decrypted.len + padding.len + 1;
@@ -306,8 +311,14 @@ static status_t encrypt(private_encryption_payload_t *this)
                
        /* build iv */
        iv.len = block_size;
-       randomizer->allocate_pseudo_random_bytes(randomizer, iv.len, &iv);
+       status = randomizer->allocate_pseudo_random_bytes(randomizer, iv.len, &iv);
        randomizer->destroy(randomizer);
+       if (status != SUCCESS)
+       {
+               allocator_free_chunk(&to_crypt);
+               allocator_free_chunk(&padding);
+               return status;
+       }
        
        this->logger->log_chunk(this->logger, RAW|LEVEL2, "data before encryption with padding", to_crypt);
                
index 7119a72..77be246 100644 (file)
@@ -23,8 +23,8 @@
 #define ENCRYPTION_PAYLOAD_H_
 
 #include <types.h>
-#include <transforms/crypters/crypter.h>
-#include <transforms/signers/signer.h>
+#include <crypto/crypters/crypter.h>
+#include <crypto/signers/signer.h>
 #include <encoding/payloads/payload.h>
 #include <utils/linked_list.h>
 
index 1129ac8..7559170 100644 (file)
@@ -26,7 +26,7 @@
 
 #include <types.h>
 #include <encoding/payloads/payload.h>
-#include <network/host.h>
+#include <utils/host.h>
 #include <config/traffic_selector.h>
 
 /**
index 62def33..f6af3ee 100644 (file)
 #include <encoding/payloads/payload.h>
 #include <encoding/payloads/transform_attribute.h>
 #include <utils/linked_list.h>
-#include <transforms/diffie_hellman.h>
-#include <transforms/signers/signer.h>
-#include <transforms/prfs/prf.h>
-#include <transforms/crypters/crypter.h>
+#include <crypto/diffie_hellman.h>
+#include <crypto/signers/signer.h>
+#include <crypto/prfs/prf.h>
+#include <crypto/crypters/crypter.h>
 #include <config/proposal.h>
 
 
index 0344683..fd99bd0 100644 (file)
 # for more details.
 #
 
-NETWORK_DIR= $(MAIN_DIR)network/
+NETWORK_DIR= $(CHARON_DIR)network/
 
 
-OBJS+= $(BUILD_DIR)packet.o
+CHARON_OBJS+= $(BUILD_DIR)packet.o
 $(BUILD_DIR)packet.o :         $(NETWORK_DIR)packet.c $(NETWORK_DIR)packet.h
                                                        $(CC) $(CFLAGS) -c -o $@ $<
 
-OBJS+= $(BUILD_DIR)socket.o
+CHARON_OBJS+= $(BUILD_DIR)socket.o
 $(BUILD_DIR)socket.o :         $(NETWORK_DIR)socket.c $(NETWORK_DIR)socket.h
-                                                       $(CC) $(CFLAGS) -c -o $@ $<
-
-OBJS+= $(BUILD_DIR)host.o
-$(BUILD_DIR)host.o :           $(NETWORK_DIR)host.c $(NETWORK_DIR)host.h
                                                        $(CC) $(CFLAGS) -c -o $@ $<
\ No newline at end of file
diff --git a/Source/charon/network/host.c b/Source/charon/network/host.c
deleted file mode 100644 (file)
index 245df8b..0000000
+++ /dev/null
@@ -1,365 +0,0 @@
-/**
- * @file host.c
- * 
- * @brief Implementation of host_t.
- * 
- */
-
-/*
- * Copyright (C) 2005 Jan Hutter, Martin Willi
- * Hochschule fuer Technik Rapperswil
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * for more details.
- */
-
-#include "host.h"
-
-#include <utils/allocator.h>
-
-
-typedef struct private_host_t private_host_t;
-
-/**
- * @brief Private Data of a host object.
- */
-struct private_host_t {        
-       /**
-        * Public data
-        */
-       host_t public;
-       
-       /**
-        * Address family to use, such as AF_INET or AF_INET6
-        */
-       int family;
-       
-       /**
-        * string representation of host
-        */
-       char *string;
-       
-       /**
-        * low-lewel structure, wich stores the address
-        */
-       union {
-               struct sockaddr address;
-               struct sockaddr_in address4;
-       };
-       /**
-        * length of address structure
-        */
-       socklen_t socklen;
-};
-
-
-/**
- * implements host_t.get_sockaddr
- */
-static sockaddr_t *get_sockaddr(private_host_t *this)
-{
-       return &(this->address);
-}
-
-/**
- * implements host_t.get_sockaddr_len
- */
-static socklen_t *get_sockaddr_len(private_host_t *this)
-{
-       return &(this->socklen);
-}
-
-/**
- * Implementation of host_t.is_default_route.
- */
-static bool is_default_route (private_host_t *this)
-{
-       switch (this->family) 
-       {
-               case AF_INET: 
-               {
-                       static u_int8_t default_route[4] = {0x00,0x00,0x00,0x00};
-                       
-                       if (memcmp(default_route,&(this->address4.sin_addr.s_addr),4) == 0)
-                       {
-                               return TRUE;
-                       }
-                       return FALSE;
-               }
-               default:
-               {
-                       /* empty chunk is returned */
-                       return FALSE;
-               }       
-       }
-}
-
-/**
- * implements host_t.get_address
- */
-static char *get_address(private_host_t *this)
-{
-       switch (this->family) 
-       {
-               case AF_INET: 
-               {
-                       char *string;
-                       /* we need to clone it, since inet_ntoa overwrites 
-                        * internal buffer on subsequent calls
-                        */
-                       allocator_free(this->string);
-                       string = inet_ntoa(this->address4.sin_addr);
-                       this->string = allocator_alloc(strlen(string)+1);
-                       strcpy(this->string, string);
-                       return this->string;
-               }
-               default:
-               {
-                       return "(family not supported)";
-               }
-       }
-}
-
-/**
- * Implementation of host_t.get_address_as_chunk.
- */
-static chunk_t get_address_as_chunk(private_host_t *this)
-{
-       chunk_t address = CHUNK_INITIALIZER;
-       
-       switch (this->family) 
-       {
-               case AF_INET: 
-               {
-                       /* allocate 4 bytes for IPV4 address*/
-                       address.ptr = allocator_alloc(4);
-                       address.len = 4;
-                       memcpy(address.ptr,&(this->address4.sin_addr.s_addr),4);
-               }
-               default:
-               {
-                       /* empty chunk is returned */
-                       return address;
-               }
-       }
-}
-
-static xfrm_address_t get_xfrm_addr(private_host_t *this)
-{
-       switch (this->family) 
-       {
-               case AF_INET: 
-               {
-                       return (xfrm_address_t)(this->address4.sin_addr.s_addr);
-               }
-               default:
-               {
-                       /* todo */
-                       return (xfrm_address_t)(this->address4.sin_addr.s_addr);
-               }
-       }
-}
-
-static int get_family(private_host_t *this)
-{
-       return this->family;    
-}
-
-/**
- * implements host_t.get_port
- */
-static u_int16_t get_port(private_host_t *this)
-{
-       switch (this->family) 
-       {
-               case AF_INET: 
-               {
-                       return ntohs(this->address4.sin_port);
-               }
-               default:
-               {
-                       return 0;
-               }
-       }
-}
-
-
-/**
- * Implements host_t.clone.
- */
-static private_host_t *clone(private_host_t *this)
-{
-       private_host_t *new = allocator_alloc_thing(private_host_t);
-       
-               
-       memcpy(new, this, sizeof(private_host_t));
-       if (this->string)
-       {
-               new->string = allocator_alloc(strlen(this->string)+1);
-               strcpy(new->string, this->string);
-       }
-       return new;
-}
-
-/**
- * Impelements host_t.ip_equals
- */
-static bool ip_equals(private_host_t *this, private_host_t *other)
-{
-       switch (this->family)
-       {
-               /* IPv4 */
-               case AF_INET:
-               {
-                       if ((this->address4.sin_family == other->address4.sin_family) &&
-                               (this->address4.sin_addr.s_addr == other->address4.sin_addr.s_addr))
-                       {
-                               return TRUE;    
-                       }
-               }
-       }
-       return FALSE;
-}
-
-/**
- * Impelements host_t.equals
- */
-static bool equals(private_host_t *this, private_host_t *other)
-{
-       switch (this->family)
-       {
-               /* IPv4 */
-               case AF_INET:
-               {
-                       if ((this->address4.sin_family == other->address4.sin_family) &&
-                               (this->address4.sin_addr.s_addr == other->address4.sin_addr.s_addr) &&
-                               (this->address4.sin_port == other->address4.sin_port))
-                       {
-                               return TRUE;    
-                       }
-               }
-       }
-       return FALSE;
-}
-
-/**
- * Implements host_t.destroy
- */
-static void destroy(private_host_t *this)
-{
-       allocator_free(this->string);
-       allocator_free(this);
-}
-
-/**
- * Creates an empty host_t object 
- */
-static private_host_t *host_create_empty()
-{
-       private_host_t *this = allocator_alloc_thing(private_host_t);
-       
-       this->public.get_sockaddr = (sockaddr_t* (*) (host_t*))get_sockaddr;
-       this->public.get_sockaddr_len = (socklen_t*(*) (host_t*))get_sockaddr_len;
-       this->public.clone = (host_t* (*) (host_t*))clone;
-       this->public.get_family = (int (*) (host_t*))get_family;
-       this->public.get_xfrm_addr = (xfrm_address_t (*) (host_t *))get_xfrm_addr;
-       this->public.get_address = (char* (*) (host_t *))get_address;
-       this->public.get_address_as_chunk = (chunk_t (*) (host_t *)) get_address_as_chunk;
-       this->public.get_port = (u_int16_t (*) (host_t *))get_port;
-       this->public.ip_equals = (bool (*) (host_t *,host_t *)) ip_equals;
-       this->public.equals = (bool (*) (host_t *,host_t *)) equals;
-       this->public.is_default_route = (bool (*) (host_t *)) is_default_route;
-       this->public.destroy = (void (*) (host_t*))destroy;
-       
-       this->string = NULL;
-       
-       return this;
-}
-
-/*
- * Described in header.
- */
-host_t *host_create(int family, char *address, u_int16_t port)
-{
-       private_host_t *this = host_create_empty();
-       
-       this->family = family;
-
-       switch (family)
-       {
-               /* IPv4 */
-               case AF_INET:
-               {
-                       this->address4.sin_family = AF_INET;
-                       this->address4.sin_addr.s_addr = inet_addr(address);
-                       this->address4.sin_port = htons(port);
-                       this->socklen = sizeof(struct sockaddr_in);
-                       return &(this->public);
-               }
-               default:
-               {
-                       allocator_free(this);
-                       return NULL;
-
-               }
-       }
-       
-}
-
-/*
- * Described in header.
- */
-host_t *host_create_from_chunk(int family, chunk_t address, u_int16_t port)
-{
-       private_host_t *this = host_create_empty();
-       
-       this->family = family;
-       switch (family)
-       {
-               /* IPv4 */
-               case AF_INET:
-               {
-                       if (address.len != 4)
-                       {
-                               break;  
-                       }
-                       this->address4.sin_family = AF_INET;
-                       memcpy(&(this->address4.sin_addr.s_addr),address.ptr,4);
-                       this->address4.sin_port = htons(port);
-                       this->socklen = sizeof(struct sockaddr_in);
-                       return &(this->public);
-               }
-       }
-       allocator_free(this);
-       return NULL;
-}
-
-/*
- * Described in header.
- */
-host_t *host_create_from_sockaddr(sockaddr_t *sockaddr)
-{
-       chunk_t address;
-       
-       switch (sockaddr->sa_family)
-       {
-               /* IPv4 */
-               case AF_INET:
-               {
-                       struct sockaddr_in *sin = (struct sockaddr_in *)sockaddr;
-                       address.ptr = (void*)&(sin->sin_addr.s_addr);
-                       address.len = 4;
-                       return host_create_from_chunk(AF_INET, address, ntohs(sin->sin_port));
-               }
-               default:
-                       return NULL;
-       }
-}
-
diff --git a/Source/charon/network/host.h b/Source/charon/network/host.h
deleted file mode 100644 (file)
index d81efff..0000000
+++ /dev/null
@@ -1,225 +0,0 @@
-/**
- * @file host.h
- *
- * @brief Interface of host_t.
- *
- */
-
-/*
- * Copyright (C) 2005 Jan Hutter, Martin Willi
- * Hochschule fuer Technik Rapperswil
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * for more details.
- */
-
-#ifndef HOST_H_
-#define HOST_H_
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <linux/xfrm.h>
-
-#include <types.h>
-
-
-typedef struct host_t host_t;
-
-/**
- * @brief Representates a Host
- * 
- * Host object, identifies a address:port pair and defines some 
- * useful functions on it.
- * 
- * @b Constructors:
- * - host_create()
- * - host_create_from_chunk()
- * - host_create_from_sockaddr()
- * 
- * @todo Add IPv6 support
- * 
- * @ingroup network
- */
-struct host_t {
-       
-       /** 
-        * @brief Build a clone of this host object.
-        * 
-        * @param this                  object to clone
-        * @return                              cloned host
-        */
-       host_t *(*clone) (host_t *this);
-       
-       /** 
-        * @brief Get a pointer to the internal sockaddr struct.
-        * 
-        * This is used for sending and receiving via sockets.
-        * 
-        * @param this                  object to clone
-        * @return                              pointer to the internal sockaddr structure
-        */
-       sockaddr_t  *(*get_sockaddr) (host_t *this);
-       
-       /** 
-        * @brief Get the length of the sockaddr struct.
-        * 
-        * Sepending on the family, the length of the sockaddr struct
-        * is different. Use this function to get the length of the sockaddr
-        * struct returned by get_sock_addr.
-        * 
-        * This is used for sending and receiving via sockets.
-        * 
-        * @param this                  object to clone
-        * @return                              length of the sockaddr struct
-        */
-       socklen_t *(*get_sockaddr_len) (host_t *this);
-       
-       /**
-        * @brief Gets the address as xfrm_address_t.
-        * 
-        * This function allows the conversion to an
-        * xfrm_address_t, used for netlink communication
-        * with the kernel.
-        * 
-        * @see kernel_interface_t.
-        * 
-        * @param this                  calling object
-        * @return                              address in xfrm_address_t format
-        */
-       xfrm_address_t (*get_xfrm_addr) (host_t *this);
-       
-       /**
-        * @brief Gets the family of the address
-        * 
-        * @param this                  calling object
-        * @return                              family
-        */
-       int (*get_family) (host_t *this);
-       
-       /** 
-        * @brief get the address of this host
-        * 
-        * Mostly used for debugging purposes. 
-        * @warning string must NOT be freed
-        * 
-        * @param this                  object
-        * @return                              address string, 
-        */
-       char* (*get_address) (host_t *this);
-       
-       /** 
-        * @brief Checks if the ip address of host is set to default route.
-        * 
-        * @param this                  calling object
-        * @return                              
-        *                                              - TRUE if host has IP 0.0.0.0 for default route 
-        *                                              - FALSE otherwise
-        */
-       bool (*is_default_route) (host_t *this);
-       
-       /** 
-        * @brief get the address of this host as chunk_t
-        * 
-        * @warning returned chunk has to get destroyed by caller.
-        * 
-        * @param this                  object
-        * @return                              address string, 
-        */
-       chunk_t (*get_address_as_chunk) (host_t *this);
-               
-       /** 
-        * @brief get the port of this host
-        * 
-        * Mostly used for debugging purposes. 
-        * 
-        * @param this                  object to clone
-        * @return                              port number
-        */
-       u_int16_t (*get_port) (host_t *this);
-               
-       /** 
-        * @brief Compare the ips of two hosts hosts.
-        * 
-        * @param this                  object to compare
-        * @param other                 the other to compare
-        * @return                              TRUE if addresses are equal.
-        */
-       bool (*ip_equals) (host_t *this, host_t *other);
-               
-       /** 
-        * @brief Compare two hosts, with port.
-        * 
-        * @param this                  object to compare
-        * @param other                 the other to compare
-        * @return                              TRUE if addresses and ports are equal.
-        */
-       bool (*equals) (host_t *this, host_t *other);
-       
-       /** 
-        * @brief Destroy this host object
-        * 
-        * @param this                  calling
-        * @return                              SUCCESS in any case
-        */
-       void (*destroy) (host_t *this);
-};
-
-/**
- * @brief Constructor to create a host_t object from an address string
- * 
- * Currently supports only IPv4!
- *
- * @param family               Address family to use for this object, such as AF_INET or AF_INET6
- * @param address              string of an address, such as "152.96.193.130"
- * @param port                 port number
- * @return                             
- *                                             - host_t object 
- *                                             - NULL, if family not supported.
- * 
- * @ingroup network
- */
-host_t *host_create(int family, char *address, u_int16_t port);
-
-/**
- * @brief Constructor to create a host_t object from an address chunk
- * 
- * Currently supports only IPv4!
- *
- * @param family               Address family to use for this object, such as AF_INET or AF_INET6
- * @param address              address as 4 byte chunk_t in networ order
- * @param port                 port number
- * @return                             
- *                                             - host_t object 
- *                                             - NULL, if family not supported or chunk_t length not 4 bytes.
- * 
- * @ingroup network
- */
-host_t *host_create_from_chunk(int family, chunk_t address, u_int16_t port);
-
-/**
- * @brief Constructor to create a host_t object from a sockaddr struct
- * 
- * Currently supports only IPv4!
- *
- * @param sockaddr             sockaddr struct which contains family, address and port
- * @return                             
- *                                             - host_t object 
- *                                             - NULL, if family not supported.
- * 
- * @ingroup network
- */
-host_t *host_create_from_sockaddr(sockaddr_t *sockaddr);
-
-
-#endif /*HOST_H_*/
index ddebf5f..a2620d3 100644 (file)
@@ -25,7 +25,7 @@
 
 
 #include <types.h>
-#include <network/host.h>
+#include <utils/host.h>
 
 
 typedef struct packet_t packet_t;
index 8f671d8..eeb012d 100644 (file)
 # for more details.
 #
 
-QUEUES_DIR= $(MAIN_DIR)queues/
+QUEUES_DIR= $(CHARON_DIR)queues/
 
-OBJS+= $(BUILD_DIR)event_queue.o
+CHARON_OBJS+= $(BUILD_DIR)event_queue.o
 $(BUILD_DIR)event_queue.o :            $(QUEUES_DIR)event_queue.c $(QUEUES_DIR)event_queue.h
                                                                $(CC) $(CFLAGS) -c -o $@ $<
 
-OBJS+= $(BUILD_DIR)job_queue.o
+CHARON_OBJS+= $(BUILD_DIR)job_queue.o
 $(BUILD_DIR)job_queue.o :              $(QUEUES_DIR)job_queue.c $(QUEUES_DIR)job_queue.h
                                                                $(CC) $(CFLAGS) -c -o $@ $<
 
-OBJS+= $(BUILD_DIR)send_queue.o
+CHARON_OBJS+= $(BUILD_DIR)send_queue.o
 $(BUILD_DIR)send_queue.o :             $(QUEUES_DIR)send_queue.c $(QUEUES_DIR)send_queue.h
                                                                $(CC) $(CFLAGS) -c -o $@ $<
 
index 658dd12..db89987 100644 (file)
 
 JOBS_DIR= $(QUEUES_DIR)jobs/
 
-OBJS+= $(BUILD_DIR)delete_half_open_ike_sa_job.o
+CHARON_OBJS+= $(BUILD_DIR)delete_half_open_ike_sa_job.o
 $(BUILD_DIR)delete_half_open_ike_sa_job.o :    $(JOBS_DIR)delete_half_open_ike_sa_job.c $(JOBS_DIR)delete_half_open_ike_sa_job.h
                                                                                $(CC) $(CFLAGS) -c -o $@ $<
 
-OBJS+= $(BUILD_DIR)delete_established_ike_sa_job.o
+CHARON_OBJS+= $(BUILD_DIR)delete_established_ike_sa_job.o
 $(BUILD_DIR)delete_established_ike_sa_job.o :  $(JOBS_DIR)delete_established_ike_sa_job.c $(JOBS_DIR)delete_established_ike_sa_job.h
                                                                                $(CC) $(CFLAGS) -c -o $@ $<
 
-OBJS+= $(BUILD_DIR)incoming_packet_job.o
+CHARON_OBJS+= $(BUILD_DIR)incoming_packet_job.o
 $(BUILD_DIR)incoming_packet_job.o :            $(JOBS_DIR)incoming_packet_job.c $(JOBS_DIR)incoming_packet_job.h
                                                                                $(CC) $(CFLAGS) -c -o $@ $<
 
-OBJS+= $(BUILD_DIR)initiate_ike_sa_job.o
+CHARON_OBJS+= $(BUILD_DIR)initiate_ike_sa_job.o
 $(BUILD_DIR)initiate_ike_sa_job.o :            $(JOBS_DIR)initiate_ike_sa_job.c $(JOBS_DIR)initiate_ike_sa_job.h
                                                                                $(CC) $(CFLAGS) -c -o $@ $<
 
-OBJS+= $(BUILD_DIR)retransmit_request_job.o
+CHARON_OBJS+= $(BUILD_DIR)retransmit_request_job.o
 $(BUILD_DIR)retransmit_request_job.o : $(JOBS_DIR)retransmit_request_job.c $(JOBS_DIR)retransmit_request_job.h
                                                                                $(CC) $(CFLAGS) -c -o $@ $<
 
-OBJS+= $(BUILD_DIR)job.o
+CHARON_OBJS+= $(BUILD_DIR)job.o
 $(BUILD_DIR)job.o :                                            $(JOBS_DIR)job.c $(JOBS_DIR)job.h
                                                                                $(CC) $(CFLAGS) -c -o $@ $<
                                                                
\ No newline at end of file
index 4c3e11b..825c199 100644 (file)
 # for more details.
 #
 
-SA_DIR= $(MAIN_DIR)sa/
+SA_DIR= $(CHARON_DIR)sa/
 
-OBJS+= $(BUILD_DIR)ike_sa_id.o
+CHARON_OBJS+= $(BUILD_DIR)ike_sa_id.o
 $(BUILD_DIR)ike_sa_id.o :              $(SA_DIR)ike_sa_id.c $(SA_DIR)ike_sa_id.h
                                                                $(CC) $(CFLAGS) -c -o $@ $<
 
-OBJS+= $(BUILD_DIR)ike_sa_manager.o
+CHARON_OBJS+= $(BUILD_DIR)ike_sa_manager.o
 $(BUILD_DIR)ike_sa_manager.o : $(SA_DIR)ike_sa_manager.c $(SA_DIR)ike_sa_manager.h
                                                                $(CC) $(CFLAGS) -c -o $@ $<
 
-OBJS+= $(BUILD_DIR)ike_sa.o
+CHARON_OBJS+= $(BUILD_DIR)ike_sa.o
 $(BUILD_DIR)ike_sa.o :                 $(SA_DIR)ike_sa.c $(SA_DIR)ike_sa.h
                                                                $(CC) $(CFLAGS) -c -o $@ $<
                                                                
-OBJS+= $(BUILD_DIR)authenticator.o
+CHARON_OBJS+= $(BUILD_DIR)authenticator.o
 $(BUILD_DIR)authenticator.o :  $(SA_DIR)authenticator.c $(SA_DIR)authenticator.h
                                                                $(CC) $(CFLAGS) -c -o $@ $<
                                                                
-OBJS+= $(BUILD_DIR)child_sa.o
+CHARON_OBJS+= $(BUILD_DIR)child_sa.o
 $(BUILD_DIR)child_sa.o :               $(SA_DIR)child_sa.c $(SA_DIR)child_sa.h
                                                                $(CC) $(CFLAGS) -c -o $@ $<
 
index 3454227..96978da 100644 (file)
@@ -25,7 +25,7 @@
 #define CHILD_SA_H_
 
 #include <types.h>
-#include <transforms/prf_plus.h>
+#include <crypto/prf_plus.h>
 #include <encoding/payloads/proposal_substructure.h>
 
 typedef struct child_sa_t child_sa_t;
index 89f3fff..43de291 100644 (file)
@@ -29,9 +29,9 @@
 #include <utils/linked_list.h>
 #include <utils/logger_manager.h>
 #include <utils/randomizer.h>
-#include <transforms/diffie_hellman.h>
-#include <transforms/prf_plus.h>
-#include <transforms/crypters/crypter.h>
+#include <crypto/diffie_hellman.h>
+#include <crypto/prf_plus.h>
+#include <crypto/crypters/crypter.h>
 #include <encoding/payloads/sa_payload.h>
 #include <encoding/payloads/nonce_payload.h>
 #include <encoding/payloads/ke_payload.h>
index 16c0111..92c7339 100644 (file)
@@ -32,9 +32,9 @@
 #include <config/configuration.h>
 #include <utils/logger.h>
 #include <utils/randomizer.h>
-#include <transforms/prfs/prf.h>
-#include <transforms/crypters/crypter.h>
-#include <transforms/signers/signer.h>
+#include <crypto/prfs/prf.h>
+#include <crypto/crypters/crypter.h>
+#include <crypto/signers/signer.h>
 #include <config/connection.h>
 #include <config/policy.h>
 
index 69517ea..a258ebe 100644 (file)
 
 STATES_DIR= $(SA_DIR)states/
 
-OBJS+= $(BUILD_DIR)ike_auth_requested.o
+CHARON_OBJS+= $(BUILD_DIR)ike_auth_requested.o
 $(BUILD_DIR)ike_auth_requested.o :             $(STATES_DIR)ike_auth_requested.c $(STATES_DIR)ike_auth_requested.h
                                                                                $(CC) $(CFLAGS) -c -o $@ $<
 
-OBJS+= $(BUILD_DIR)ike_sa_established.o
+CHARON_OBJS+= $(BUILD_DIR)ike_sa_established.o
 $(BUILD_DIR)ike_sa_established.o :             $(STATES_DIR)ike_sa_established.c $(STATES_DIR)ike_sa_established.h
                                                                                $(CC) $(CFLAGS) -c -o $@ $<
 
-OBJS+= $(BUILD_DIR)ike_sa_init_requested.o
+CHARON_OBJS+= $(BUILD_DIR)ike_sa_init_requested.o
 $(BUILD_DIR)ike_sa_init_requested.o :  $(STATES_DIR)ike_sa_init_requested.c $(STATES_DIR)ike_sa_init_requested.h
                                                                                $(CC) $(CFLAGS) -c -o $@ $<
 
-OBJS+= $(BUILD_DIR)ike_sa_init_responded.o
+CHARON_OBJS+= $(BUILD_DIR)ike_sa_init_responded.o
 $(BUILD_DIR)ike_sa_init_responded.o :  $(STATES_DIR)ike_sa_init_responded.c $(STATES_DIR)ike_sa_init_responded.h
                                                                                $(CC) $(CFLAGS) -c -o $@ $<
 
-OBJS+= $(BUILD_DIR)initiator_init.o
+CHARON_OBJS+= $(BUILD_DIR)initiator_init.o
 $(BUILD_DIR)initiator_init.o :                 $(STATES_DIR)initiator_init.c $(STATES_DIR)initiator_init.h
                                                                                $(CC) $(CFLAGS) -c -o $@ $<
                                                                                
-OBJS+= $(BUILD_DIR)responder_init.o
+CHARON_OBJS+= $(BUILD_DIR)responder_init.o
 $(BUILD_DIR)responder_init.o :                 $(STATES_DIR)responder_init.c $(STATES_DIR)responder_init.h
                                                                                $(CC) $(CFLAGS) -c -o $@ $<
                                                                                
-OBJS+= $(BUILD_DIR)state.o
+CHARON_OBJS+= $(BUILD_DIR)state.o
 $(BUILD_DIR)state.o :                                  $(STATES_DIR)state.c $(STATES_DIR)state.h
                                                                                $(CC) $(CFLAGS) -c -o $@ $<
\ No newline at end of file
index 16eea7b..b037cfc 100644 (file)
@@ -29,8 +29,8 @@
 #include <encoding/payloads/id_payload.h>
 #include <encoding/payloads/auth_payload.h>
 #include <encoding/payloads/notify_payload.h>
-#include <transforms/signers/signer.h>
-#include <transforms/crypters/crypter.h>
+#include <crypto/signers/signer.h>
+#include <crypto/crypters/crypter.h>
 #include <sa/states/ike_sa_established.h>
 #include <sa/authenticator.h>
 #include <sa/child_sa.h>
index a5b7fbc..8d3ae55 100644 (file)
@@ -31,7 +31,7 @@
 #include <encoding/payloads/id_payload.h>
 #include <encoding/payloads/auth_payload.h>
 #include <encoding/payloads/ts_payload.h>
-#include <transforms/diffie_hellman.h>
+#include <crypto/diffie_hellman.h>
 #include <sa/states/ike_auth_requested.h>
 #include <sa/states/initiator_init.h>
 #include <sa/authenticator.h>
index 1fe0a6d..0a43afa 100644 (file)
@@ -27,7 +27,7 @@
 #include <types.h>
 #include <sa/ike_sa.h>
 #include <sa/states/state.h>
-#include <transforms/diffie_hellman.h>
+#include <crypto/diffie_hellman.h>
 
 typedef struct ike_sa_init_requested_t ike_sa_init_requested_t;
 
index eef8ea3..5254874 100644 (file)
@@ -31,8 +31,8 @@
 #include <encoding/payloads/id_payload.h>
 #include <encoding/payloads/auth_payload.h>
 #include <encoding/payloads/notify_payload.h>
-#include <transforms/signers/signer.h>
-#include <transforms/crypters/crypter.h>
+#include <crypto/signers/signer.h>
+#include <crypto/crypters/crypter.h>
 #include <sa/states/ike_sa_established.h>
 
 
index 18ffe0e..8588513 100644 (file)
@@ -28,7 +28,7 @@
 #include <sa/states/ike_sa_init_requested.h>
 #include <utils/allocator.h>
 #include <queues/jobs/retransmit_request_job.h>
-#include <transforms/diffie_hellman.h>
+#include <crypto/diffie_hellman.h>
 #include <encoding/payloads/sa_payload.h>
 #include <encoding/payloads/ke_payload.h>
 #include <encoding/payloads/nonce_payload.h>
@@ -92,7 +92,7 @@ struct private_initiator_init_t {
         * @param this          calling object
         * @param request       message_t object to add the NONCE payload
         */
-       void (*build_nonce_payload) (private_initiator_init_t *this,message_t *request);        
+       status_t (*build_nonce_payload) (private_initiator_init_t *this,message_t *request);    
        
        /**
         * Destroy function called internally of this class after state change to state 
@@ -177,9 +177,14 @@ status_t retry_initiate_connection (private_initiator_init_t *this, diffie_hellm
        this->build_ke_payload(this, message);
        
        /* build Nonce payload */
-       this->build_nonce_payload(this,message);
-
-
+       status = this->build_nonce_payload(this, message);
+       if (status != SUCCESS)
+       {
+               this->logger->log(this->logger, ERROR, "Building nonce payload failed. Aborting");
+               message->destroy(message);
+               return DELETE_ME;
+       }
+       
        /* message can now be sent (must not be destroyed) */
        status = this->ike_sa->send_request(this->ike_sa, message);
        if (status != SUCCESS)
@@ -251,17 +256,22 @@ static void build_ke_payload(private_initiator_init_t *this, message_t *request)
 /**
  * Implementation of private_initiator_init_t.build_nonce_payload.
  */
-static void build_nonce_payload(private_initiator_init_t *this, message_t *request)
+static status_t build_nonce_payload(private_initiator_init_t *this, message_t *request)
 {
        nonce_payload_t *nonce_payload;
        randomizer_t *randomizer;
+       status_t status;
        
        this->logger->log(this->logger, CONTROL|LEVEL1, "Building NONCE payload");
        
        this->logger->log(this->logger, CONTROL|LEVEL2, "Get pseudo random bytes for NONCE");
        randomizer = this->ike_sa->get_randomizer(this->ike_sa);
        
-       randomizer->allocate_pseudo_random_bytes(randomizer, NONCE_SIZE, &(this->sent_nonce));
+       status = randomizer->allocate_pseudo_random_bytes(randomizer, NONCE_SIZE, &(this->sent_nonce));
+       if (status != SUCCESS)
+       {
+               return status;
+       }
 
        this->logger->log(this->logger, RAW|LEVEL2, "Initiator NONCE",&(this->sent_nonce));
        
@@ -271,6 +281,7 @@ static void build_nonce_payload(private_initiator_init_t *this, message_t *reque
        
        this->logger->log(this->logger, CONTROL|LEVEL2, "Add NONCE payload to message");
        request->add_payload(request, (payload_t *) nonce_payload);
+       return SUCCESS;
 }
 
 /**
index 2710080..32aa6db 100644 (file)
@@ -30,7 +30,7 @@
 #include <encoding/payloads/ke_payload.h>
 #include <encoding/payloads/nonce_payload.h>
 #include <encoding/payloads/notify_payload.h>
-#include <transforms/diffie_hellman.h>
+#include <crypto/diffie_hellman.h>
 
 
 typedef struct private_responder_init_t private_responder_init_t;
@@ -428,6 +428,7 @@ static status_t build_nonce_payload(private_responder_init_t *this,nonce_payload
 {
        nonce_payload_t *nonce_payload;
        randomizer_t *randomizer;
+       status_t status;
 
        this->logger->log(this->logger, CONTROL | LEVEL2, "Process received NONCE payload");
        allocator_free(this->received_nonce.ptr);
@@ -439,7 +440,11 @@ static status_t build_nonce_payload(private_responder_init_t *this,nonce_payload
        this->logger->log(this->logger, CONTROL | LEVEL2, "Create new NONCE value.");   
        
        randomizer = this->ike_sa->get_randomizer(this->ike_sa);
-       randomizer->allocate_pseudo_random_bytes(randomizer, NONCE_SIZE, &(this->sent_nonce));
+       status = randomizer->allocate_pseudo_random_bytes(randomizer, NONCE_SIZE, &(this->sent_nonce));
+       if (status != SUCCESS)
+       {
+               return status;
+       }
        
        this->logger->log(this->logger, CONTROL|LEVEL2, "Building NONCE payload");
        nonce_payload = nonce_payload_create();
diff --git a/Source/charon/stroke.c b/Source/charon/stroke.c
deleted file mode 100644 (file)
index 5062c26..0000000
+++ /dev/null
@@ -1,304 +0,0 @@
-/* Stroke for charon is the counterpart to whack from pluto
- * Copyright (C) 2006 Martin Willi - Hochschule fuer Technik Rapperswil
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * for more details.
- */
-
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <sys/fcntl.h>
-#include <unistd.h>
-#include <dirent.h>
-#include <errno.h>
-#include <stdio.h>
-#include <linux/stddef.h>
-
-#include "stroke.h"
-
-static char* push_string(stroke_msg_t **strm, char *string)
-{
-       stroke_msg_t *stroke_msg;
-       size_t string_length;
-       
-       if (string == NULL)
-       {
-               return NULL;
-       }
-       stroke_msg = *strm;
-       string_length = strlen(string) + 1;
-       stroke_msg->length += string_length;
-       
-       stroke_msg = realloc(stroke_msg, stroke_msg->length);
-       strcpy((char*)stroke_msg + stroke_msg->length - string_length, string);
-       
-       *strm = stroke_msg;
-       return (char*)(u_int)stroke_msg->length - string_length;
-}
-
-static int send_stroke_msg (stroke_msg_t *msg)
-{
-       struct sockaddr_un ctl_addr = { AF_UNIX, STROKE_SOCKET };
-       int sock;
-       char buffer[64];
-       int byte_count;
-       
-       sock = socket(AF_UNIX, SOCK_STREAM, 0);
-       if (sock < 0)
-       {
-               fprintf(stderr, "Opening unix socket %s: %s\n", STROKE_SOCKET, strerror(errno));
-               return -1;
-       }
-       if (connect(sock, (struct sockaddr *)&ctl_addr,
-                               offsetof(struct sockaddr_un, sun_path) + strlen(ctl_addr.sun_path)) < 0)
-       {
-               fprintf(stderr, "Connect to socket failed: %s\n", strerror(errno));
-               close(sock);
-               return -1;
-       }
-       
-       /* send message */
-       if (write(sock, msg, msg->length) != msg->length)
-       {
-               fprintf(stderr, "writing to socket failed: %s\n", strerror(errno));
-               close(sock);
-               return -1;
-       }
-       
-       while ((byte_count = read(sock, buffer, sizeof(buffer)-1)) > 0)
-       {
-               buffer[byte_count] = '\0';
-               printf("%s", buffer);
-       }
-       if (byte_count < 0)
-       {
-               fprintf(stderr, "reading from socket failed: %s\n", strerror(errno));
-       }
-       
-       close(sock);
-       return 0;
-}
-
-static int add_connection(char *name,
-                                                 char *my_id, char *other_id, 
-                                                 char *my_cert, char *other_cert,
-                                                 char *my_addr, char *other_addr,
-                                                 char *my_net, char *other_net,
-                                                 u_int my_netmask, u_int other_netmask)
-{
-       stroke_msg_t *msg = malloc(sizeof(stroke_msg_t));
-       int res;
-       
-       msg->length = sizeof(stroke_msg_t);
-       msg->type = STR_ADD_CONN;
-       
-       msg->add_conn.name = push_string(&msg, name);
-       
-       msg->add_conn.me.id = push_string(&msg, my_id);
-       msg->add_conn.me.cert = push_string(&msg, my_cert);
-       msg->add_conn.me.address = push_string(&msg, my_addr);
-       msg->add_conn.me.subnet = push_string(&msg, my_net);
-       msg->add_conn.me.subnet_mask = my_netmask;
-       
-       msg->add_conn.other.id = push_string(&msg, other_id);
-       msg->add_conn.other.cert = push_string(&msg, other_cert);
-       msg->add_conn.other.address = push_string(&msg, other_addr);
-       msg->add_conn.other.subnet = push_string(&msg, other_net);
-       msg->add_conn.other.subnet_mask = other_netmask;
-       
-       res = send_stroke_msg(msg);
-       free(msg);
-       return res;
-}
-
-static int initiate_connection(char *name)
-{
-       stroke_msg_t *msg = malloc(sizeof(stroke_msg_t));
-       int res;
-       
-       msg->length = sizeof(stroke_msg_t);
-       msg->type = STR_INITIATE;
-       msg->initiate.name = push_string(&msg, name);
-       res = send_stroke_msg(msg);
-       free(msg);
-       return res;
-}
-
-static int terminate_connection(char *name)
-{
-       stroke_msg_t *msg = malloc(sizeof(stroke_msg_t));
-       int res;
-       
-       msg->length = sizeof(stroke_msg_t);
-       msg->type = STR_TERMINATE;
-       msg->initiate.name = push_string(&msg, name);
-       res = send_stroke_msg(msg);
-       free(msg);
-       return res;
-}
-
-static int show_status()
-{
-       stroke_msg_t *msg = malloc(sizeof(stroke_msg_t));
-       int res;
-       
-       msg->length = sizeof(stroke_msg_t);
-       msg->type = STR_STATUS;
-       res = send_stroke_msg(msg);
-       free(msg);
-       return res;
-}
-
-static int set_logtype(char *context, char *type, int enable)
-{
-       stroke_msg_t *msg = malloc(sizeof(stroke_msg_t));
-       int res;
-       
-       msg->length = sizeof(stroke_msg_t);
-       msg->type = STR_LOGTYPE;
-       msg->logtype.context = push_string(&msg, context);
-       msg->logtype.type = push_string(&msg, type);
-       msg->logtype.enable = enable;
-       res = send_stroke_msg(msg);
-       free(msg);
-       return res;
-}
-
-static int set_loglevel(char *context, u_int level)
-{
-       stroke_msg_t *msg = malloc(sizeof(stroke_msg_t));
-       int res;
-       
-       msg->length = sizeof(stroke_msg_t);
-       msg->type = STR_LOGLEVEL;
-       msg->loglevel.context = push_string(&msg, context);
-       msg->loglevel.level = level;
-       res = send_stroke_msg(msg);
-       free(msg);
-       return res;
-}
-
-static void exit_error(char *error)
-{
-       if (error)
-       {
-               fprintf(stderr, "%s\n", error);
-       }
-       exit(-1);
-}
-
-static void exit_usage(char *error)
-{
-       printf("Usage:\n");
-       printf("  Add a connection:\n");
-       printf("    stroke add NAME MY_ID OTHER_ID MY_CERT OTHER_CERT\\\n");
-       printf("           MY_ADDR OTHER_ADDR MY_NET OTHER_NET\\\n");
-       printf("           MY_NETBITS OTHER_NETBITS\n");
-       printf("    where: ID is any IKEv2 ID (currently only IPv4 adresses\n");
-       printf("           CERT is a certificate filename\n");
-       printf("           ADDR is a IPv4 address\n");
-       printf("           NET is a IPv4 address of the subnet to tunnel\n");
-       printf("           NETBITS is the size of the subnet, as the \"24\" in 192.168.0.0/24\n");
-       printf("  Initiate a connection:\n");
-       printf("    stroke up NAME\n");
-       printf("    where: NAME is a connection name added with \"stroke add\"\n");
-       printf("  Terminate a connection:\n");
-       printf("    stroke down NAME\n");
-       printf("    where: NAME is a connection name added with \"stroke add\"\n");
-       printf("  Set logtype for a logging context:\n");
-       printf("    stroke logtype CONTEXT TYPE ENABLE\n");
-       printf("    where: CONTEXT is PARSR|GNRAT|IKESA|SAMGR|CHDSA|MESSG|TPOOL|WORKR|SCHED|\n");
-       printf("                      SENDR|RECVR|SOCKT|TESTR|DAEMN|CONFG|ENCPL|PAYLD\n");
-       printf("           TYPE is CONTROL|ERROR|AUDIT|RAW|PRIVATE\n");
-       printf("           ENABLE is 0|1\n");
-       printf("  Set loglevel for a logging context:\n");
-       printf("    stroke loglevel CONTEXT LEVEL\n");
-       printf("    where: CONTEXT is PARSR|GNRAT|IKESA|SAMGR|CHDSA|MESSG|TPOOL|WORKR|SCHED|\n");
-       printf("                      SENDR|RECVR|SOCKT|TESTR|DAEMN|CONFG|ENCPL|PAYLD\n");
-       printf("           LEVEL is 0|1|2|3\n");
-       printf("  Show connection status:\n");
-       printf("    stroke status\n");
-       exit_error(error);
-}
-
-int main(int argc, char *argv[])
-{
-       int res;
-       
-       if (argc < 2)
-       {
-               exit_usage(NULL);
-       }
-       
-       if (strcmp(argv[1], "status") == 0 || 
-               strcmp(argv[1], "statusall") == 0)
-       {
-               res = show_status();
-       }
-       
-       else if (strcmp(argv[1], "up") == 0)
-       {
-               if (argc < 3)
-               {
-                       exit_usage("\"up\" needs a connection name");
-               }
-               res = initiate_connection(argv[2]);
-       }
-       else if (strcmp(argv[1], "down") == 0)
-       {
-               if (argc < 3)
-               {
-                       exit_usage("\"down\" needs a connection name");
-               }
-               res = terminate_connection(argv[2]);
-       }
-       else if (strcmp(argv[1], "add") == 0)
-       {
-               if (argc < 13)
-               {
-                       exit_usage("\"add\" needs more parameters...");
-               }
-               res = add_connection(argv[2],
-                                                        argv[3], argv[4], 
-                                                        argv[5], argv[6], 
-                                                        argv[7], argv[8], 
-                                                        argv[9], argv[10], 
-                                                        atoi(argv[11]), atoi(argv[12])); 
-       }
-       else if (strcmp(argv[1], "logtype") == 0)
-       {
-               if (argc < 5)
-               {
-                       exit_usage("\"logtype\" needs more parameters...");
-               }
-               res = set_logtype(argv[2], argv[3], atoi(argv[4])); 
-       }
-       else if (strcmp(argv[1], "loglevel") == 0)
-       {
-               if (argc < 4)
-               {
-                       exit_usage("\"logtype\" needs more parameters...");
-               }
-               res = set_loglevel(argv[2], atoi(argv[3])); 
-       }
-       else
-       {
-               exit_usage(NULL);
-       }
-       
-       if (res)
-       {
-               exit_error("communication with charon failed!\n");
-       }
-       return 0;
-}
diff --git a/Source/charon/stroke.h b/Source/charon/stroke.h
deleted file mode 100644 (file)
index 2f75679..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/**
- * @file stroke.h
- *
- * @brief Definition of stroke_msg_t.
- *
- */
-
-/*
- * Copyright (C) 2006 Martin Willi
- * Hochschule fuer Technik Rapperswil
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * for more details.
- */
-
-#ifndef STROKE_H_
-#define STROKE_H_
-
-#define STROKE_SOCKET "/var/run/charon.ctl"
-
-/**
- * @brief A stroke message sent over the unix socket.
- * 
- */
-typedef struct stroke_msg_t stroke_msg_t;
-
-struct stroke_msg_t {
-       /* length of this message with all strings */
-       u_int16_t length;
-       /* type of the message */
-       enum {
-               /* initiate a connection */
-               STR_INITIATE,
-               /* install SPD entries for a connection */
-               STR_INSTALL,
-               /* add a connection */
-               STR_ADD_CONN,
-               /* delete a connection */
-               STR_DEL_CONN,
-               /* terminate connection */
-               STR_TERMINATE,
-               /* show connection status */
-               STR_STATUS,
-               /* set a log type to log/not log */
-               STR_LOGTYPE,
-               /* set the verbosity of a logging context */
-               STR_LOGLEVEL,
-               /* more to come */
-       } type;
-       union {
-               /* data for STR_INITIATE, STR_INSTALL, STR_UP, STR_DOWN */
-               struct {
-                       char *name;
-               } initiate, install, terminate;
-               /* data for STR_ADD_CONN */
-               struct {
-                       char *name;
-                       struct {
-                               char *id;
-                               char *cert;
-                               char *address;
-                               char *subnet;
-                               u_int8_t subnet_mask;
-                       } me, other;
-               } add_conn;
-               struct {
-                       char *context;
-                       char *type;
-                       int enable;
-               } logtype;
-               struct {
-                       char *context;
-                       u_int level;
-               } loglevel;
-       };
-       u_int8_t buffer[];
-};
-
-#endif /* STROKE_H_ */
diff --git a/Source/charon/testcases/Makefile.testcases b/Source/charon/testcases/Makefile.testcases
deleted file mode 100644 (file)
index b6113fa..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-# Copyright (C) 2005 Jan Hutter, Martin Willi
-# Hochschule fuer Technik Rapperswil
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2 of the License, or (at your
-# option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# for more details.
-#
-
-TESTCASES_DIR= $(MAIN_DIR)testcases/
-
-
-TEST_OBJS+= $(BUILD_DIR)aes_cbc_crypter_test.o
-$(BUILD_DIR)aes_cbc_crypter_test.o :   $(TESTCASES_DIR)aes_cbc_crypter_test.c $(TESTCASES_DIR)aes_cbc_crypter_test.h
-                                                                       $(CC) $(CFLAGS) -c -o $@ $<
-
-
-TEST_OBJS+= $(BUILD_DIR)diffie_hellman_test.o
-$(BUILD_DIR)diffie_hellman_test.o :    $(TESTCASES_DIR)diffie_hellman_test.c $(TESTCASES_DIR)diffie_hellman_test.h
-                                                                       $(CC) $(CFLAGS) -c -o $@ $<
-
-TEST_OBJS+= $(BUILD_DIR)event_queue_test.o
-$(BUILD_DIR)event_queue_test.o :       $(TESTCASES_DIR)event_queue_test.c $(TESTCASES_DIR)event_queue_test.h
-                                                                       $(CC) $(CFLAGS) -c -o $@ $<
-
-TEST_OBJS+= $(BUILD_DIR)generator_test.o
-$(BUILD_DIR)generator_test.o :         $(TESTCASES_DIR)generator_test.c $(TESTCASES_DIR)generator_test.h
-                                                                       $(CC) $(CFLAGS) -c -o $@ $<
-
-TEST_OBJS+= $(BUILD_DIR)ike_sa_id_test.o
-$(BUILD_DIR)ike_sa_id_test.o :         $(TESTCASES_DIR)ike_sa_id_test.c $(TESTCASES_DIR)ike_sa_id_test.h
-                                                                       $(CC) $(CFLAGS) -c -o $@ $<
-
-TEST_OBJS+= $(BUILD_DIR)job_queue_test.o
-$(BUILD_DIR)job_queue_test.o :         $(TESTCASES_DIR)job_queue_test.c $(TESTCASES_DIR)job_queue_test.h
-                                                                       $(CC) $(CFLAGS) -c -o $@ $<
-
-TEST_OBJS+= $(BUILD_DIR)parser_test.o
-$(BUILD_DIR)parser_test.o :                    $(TESTCASES_DIR)parser_test.c $(TESTCASES_DIR)parser_test.h
-                                                                       $(CC) $(CFLAGS) -c -o $@ $<
-
-TEST_OBJS+= $(BUILD_DIR)hasher_test.o
-$(BUILD_DIR)hasher_test.o :                    $(TESTCASES_DIR)hasher_test.c $(TESTCASES_DIR)hasher_test.h
-                                                                       $(CC) $(CFLAGS) -c -o $@ $<
-
-TEST_OBJS+= $(BUILD_DIR)ike_sa_manager_test.o
-$(BUILD_DIR)ike_sa_manager_test.o :    $(TESTCASES_DIR)ike_sa_manager_test.c $(TESTCASES_DIR)ike_sa_manager_test.h
-                                                                       $(CC) $(CFLAGS) -c -o $@ $<
-
-TEST_OBJS+= $(BUILD_DIR)linked_list_test.o
-$(BUILD_DIR)linked_list_test.o :       $(TESTCASES_DIR)linked_list_test.c $(TESTCASES_DIR)linked_list_test.h
-                                                                       $(CC) $(CFLAGS) -c -o $@ $<
-
-TEST_OBJS+= $(BUILD_DIR)hmac_test.o
-$(BUILD_DIR)hmac_test.o :                      $(TESTCASES_DIR)hmac_test.c $(TESTCASES_DIR)hmac_test.h
-                                                                       $(CC) $(CFLAGS) -c -o $@ $<
-
-TEST_OBJS+= $(BUILD_DIR)hmac_signer_test.o
-$(BUILD_DIR)hmac_signer_test.o :               $(TESTCASES_DIR)hmac_signer_test.c $(TESTCASES_DIR)hmac_signer_test.h
-                                                                       $(CC) $(CFLAGS) -c -o $@ $<
-                                                                                       
-TEST_OBJS+= $(BUILD_DIR)scheduler_test.o
-$(BUILD_DIR)scheduler_test.o :         $(TESTCASES_DIR)scheduler_test.c $(TESTCASES_DIR)scheduler_test.h
-                                                                       $(CC) $(CFLAGS) -c -o $@ $<
-                                                                       
-TEST_OBJS+= $(BUILD_DIR)prf_plus_test.o
-$(BUILD_DIR)prf_plus_test.o :          $(TESTCASES_DIR)prf_plus_test.c $(TESTCASES_DIR)prf_plus_test.h
-                                                                       $(CC) $(CFLAGS) -c -o $@ $<
-                                                                       
-TEST_OBJS+= $(BUILD_DIR)send_queue_test.o
-$(BUILD_DIR)send_queue_test.o :                $(TESTCASES_DIR)send_queue_test.c $(TESTCASES_DIR)send_queue_test.h
-                                                                       $(CC) $(CFLAGS) -c -o $@ $<
-                                                                       
-TEST_OBJS+= $(BUILD_DIR)socket_test.o
-$(BUILD_DIR)socket_test.o :                    $(TESTCASES_DIR)socket_test.c $(TESTCASES_DIR)socket_test.h
-                                                                       $(CC) $(CFLAGS) -c -o $@ $<
-                                                                       
-TEST_OBJS+= $(BUILD_DIR)packet_test.o
-$(BUILD_DIR)packet_test.o :                    $(TESTCASES_DIR)packet_test.c $(TESTCASES_DIR)packet_test.h
-                                                                       $(CC) $(CFLAGS) -c -o $@ $<
-                                                                       
-TEST_OBJS+= $(BUILD_DIR)testcases.o
-$(BUILD_DIR)testcases.o :                      $(TESTCASES_DIR)testcases.c
-                                                                       $(CC) $(CFLAGS) -c -o $@ $<
-                                                                       
-TEST_OBJS+= $(BUILD_DIR)receiver_test.o
-$(BUILD_DIR)receiver_test.o :          $(TESTCASES_DIR)receiver_test.c $(TESTCASES_DIR)receiver_test.h
-                                                                       $(CC) $(CFLAGS) -c -o $@ $<
-                                                                       
-TEST_OBJS+= $(BUILD_DIR)ike_sa_test.o
-$(BUILD_DIR)ike_sa_test.o :                    $(TESTCASES_DIR)ike_sa_test.c $(TESTCASES_DIR)ike_sa_test.h
-                                                                       $(CC) $(CFLAGS) -c -o $@ $<
-                                                                       
-TEST_OBJS+= $(BUILD_DIR)sender_test.o
-$(BUILD_DIR)sender_test.o :                    $(TESTCASES_DIR)sender_test.c $(TESTCASES_DIR)sender_test.h
-                                                                       $(CC) $(CFLAGS) -c -o $@ $<
-                                                                       
-TEST_OBJS+= $(BUILD_DIR)thread_pool_test.o
-$(BUILD_DIR)thread_pool_test.o :       $(TESTCASES_DIR)thread_pool_test.c $(TESTCASES_DIR)thread_pool_test.h
-                                                                       $(CC) $(CFLAGS) -c -o $@ $<
-                                                                       
-TEST_OBJS+= $(BUILD_DIR)encryption_payload_test.o
-$(BUILD_DIR)encryption_payload_test.o :        $(TESTCASES_DIR)encryption_payload_test.c $(TESTCASES_DIR)encryption_payload_test.h
-                                                                       $(CC) $(CFLAGS) -c -o $@ $<
-
-TEST_OBJS+= $(BUILD_DIR)connection_test.o
-$(BUILD_DIR)connection_test.o :                $(TESTCASES_DIR)connection_test.c $(TESTCASES_DIR)connection_test.h
-                                                                       $(CC) $(CFLAGS) -c -o $@ $<
-
-TEST_OBJS+= $(BUILD_DIR)policy_test.o
-$(BUILD_DIR)policy_test.o :                    $(TESTCASES_DIR)policy_test.c $(TESTCASES_DIR)policy_test.h
-                                                                       $(CC) $(CFLAGS) -c -o $@ $<
-
-TEST_OBJS+= $(BUILD_DIR)proposal_test.o
-$(BUILD_DIR)proposal_test.o :          $(TESTCASES_DIR)proposal_test.c $(TESTCASES_DIR)proposal_test.h
-                                                                       $(CC) $(CFLAGS) -c -o $@ $<
-
-TEST_OBJS+= $(BUILD_DIR)rsa_test.o
-$(BUILD_DIR)rsa_test.o :                       $(TESTCASES_DIR)rsa_test.c $(TESTCASES_DIR)rsa_test.h
-                                                                       $(CC) $(CFLAGS) -c -o $@ $<
-
-TEST_OBJS+= $(BUILD_DIR)kernel_interface_test.o
-$(BUILD_DIR)kernel_interface_test.o :  $(TESTCASES_DIR)kernel_interface_test.c $(TESTCASES_DIR)kernel_interface_test.h
-                                                                       $(CC) $(CFLAGS) -c -o $@ $<
-
-TEST_OBJS+= $(BUILD_DIR)child_sa_test.o
-$(BUILD_DIR)child_sa_test.o :          $(TESTCASES_DIR)child_sa_test.c $(TESTCASES_DIR)child_sa_test.h
-                                                                       $(CC) $(CFLAGS) -c -o $@ $<
-
-TEST_OBJS+= $(BUILD_DIR)der_decoder_test.o
-$(BUILD_DIR)der_decoder_test.o :       $(TESTCASES_DIR)der_decoder_test.c $(TESTCASES_DIR)der_decoder_test.h
-                                                                       $(CC) $(CFLAGS) -c -o $@ $<
-
-TEST_OBJS+= $(BUILD_DIR)certificate_test.o
-$(BUILD_DIR)certificate_test.o :       $(TESTCASES_DIR)certificate_test.c $(TESTCASES_DIR)certificate_test.h
-                                                                       $(CC) $(CFLAGS) -c -o $@ $<
-                                                                       
\ No newline at end of file
diff --git a/Source/charon/testcases/aes_cbc_crypter_test.c b/Source/charon/testcases/aes_cbc_crypter_test.c
deleted file mode 100644 (file)
index 1ea2983..0000000
+++ /dev/null
@@ -1,202 +0,0 @@
-/**
- * @file aes_cbc_crypter_test.c
- * 
- * @brief Tests for the aes_cbc_crypter_t class.
- * 
- */
-
-/*
- * Copyright (C) 2005 Jan Hutter, Martin Willi
- * Hochschule fuer Technik Rapperswil
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * for more details.
- */
-
-#include <string.h>
-#include "aes_cbc_crypter_test.h"
-
-#include <utils/allocator.h>
-#include <daemon.h>
-
-void test_aes_cbc_crypter(protected_tester_t *tester)
-{
-       /*
-        * Test 1 of RFC3602
-        * Key       : 0x06a9214036b8a15b512e03d534120006
-        * IV        : 0x3dafba429d9eb430b422da802c9fac41
-        * Plaintext : "Single block msg"
-        * Ciphertext: 0xe353779c1079aeb82708942dbe77181a       
-        */
-       crypter_t *crypter;
-       u_int8_t key1[] = {0x06,0xa9,0x21,0x40,0x36,0xb8,0xa1,0x5b,
-                                         0x51,0x2e,0x03,0xd5,0x34,0x12,0x00,0x06};
-       chunk_t key1_chunk = {ptr: key1, len : 16};
-       u_int8_t iv1[] = {0x3d,0xaf,0xba,0x42,0x9d,0x9e,0xb4,0x30,
-                                        0xb4,0x22,0xda,0x80,0x2c,0x9f,0xac,0x41};
-       chunk_t iv1_chunk = {ptr: iv1, len : 16};
-       u_int8_t ciphertext1[] = { 0xe3,0x53,0x77,0x9c,0x10,0x79,0xae,0xb8,
-                                                         0x27,0x08,0x94,0x2d,0xbe,0x77,0x18,0x1a};
-       
-       chunk_t expected_encrypted1 = {ptr: ciphertext1, len : 16};
-       char * plaintext1 = "Single block msg";
-       chunk_t data1 = {ptr: plaintext1, len : 16};
-       chunk_t encrypted1;
-       chunk_t decrypted1;
-       logger_t *logger;
-       
-       logger = charon->logger_manager->get_logger(charon->logger_manager,TESTER);
-                
-       crypter = (crypter_t *) aes_cbc_crypter_create(16);
-       tester->assert_true(tester, (crypter != NULL), "create call test");
-       
-       tester->assert_true(tester, (crypter->set_key(crypter,key1_chunk) == SUCCESS), "set_key call test"); 
-       
-       tester->assert_true(tester, (crypter->encrypt(crypter,data1,iv1_chunk,&encrypted1) == SUCCESS), "encrypt call test");
-       
-       tester->assert_true(tester, (memcmp(encrypted1.ptr, expected_encrypted1.ptr, 16) == 0), "Encrypted value");
-       
-       logger->log_chunk(logger,RAW,"exptected encrypted :", expected_encrypted1);
-       logger->log_chunk(logger,RAW,"encrypted :", encrypted1);
-       
-       tester->assert_true(tester, (crypter->decrypt(crypter,encrypted1,iv1_chunk,&decrypted1) == SUCCESS), "decrypt call test");
-       allocator_free_chunk(&encrypted1);
-
-       tester->assert_true(tester, (memcmp(decrypted1.ptr, plaintext1, 16) == 0), "decrypted value");
-       
-       logger->log_chunk(logger,RAW,"expected decrypted :", data1);
-       logger->log_chunk(logger,RAW,"decrypted :", decrypted1);
-       
-       allocator_free_chunk(&decrypted1);
-        
-       crypter->destroy(crypter);
-       
-       
-       /*
-        * Test 2 of RFC3602
-        * Key       : 0xc286696d887c9aa0611bbb3e2025a45a
-        * IV        : 0x562e17996d093d28ddb3ba695a2e6f58
-        * Plaintext : 0x000102030405060708090a0b0c0d0e0f
-        *              101112131415161718191a1b1c1d1e1f
-        * Ciphertext: 0xd296cd94c2cccf8a3a863028b5e1dc0a
-     *                 7586602d253cfff91b8266bea6d61ab1        
-        */
-       u_int8_t key2[] = {0xc2,0x86,0x69,0x6d,0x88,0x7c,0x9a,0xa0,
-                                          0x61,0x1b,0xbb,0x3e,0x20,0x25,0xa4,0x5a};
-       chunk_t key2_chunk = {ptr: key2, len : 16};
-       u_int8_t iv2[] = {0x56,0x2e,0x17,0x99,0x6d,0x09,0x3d,0x28,
-                                         0xdd,0xb3,0xba,0x69,0x5a,0x2e,0x6f,0x58};
-       chunk_t iv2_chunk = {ptr: iv2, len : 16};
-       u_int8_t ciphertext2[] = { 0xd2,0x96,0xcd,0x94,0xc2,0xcc,0xcf,0x8a,
-                                                          0x3a,0x86,0x30,0x28,0xb5,0xe1,0xdc,0x0a,
-                                                          0x75,0x86,0x60,0x2d,0x25,0x3c,0xff,0xf9,
-                                                          0x1b,0x82,0x66,0xbe,0xa6,0xd6,0x1a,0xb1};
-       
-       chunk_t expected_encrypted2 = {ptr: ciphertext2, len : 32};
-       u_int8_t plaintext2[] = {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
-                                                        0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,
-                                                        0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
-                                                        0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f};
-       chunk_t data2 = {ptr: plaintext2, len : 32};
-       chunk_t encrypted2;
-       chunk_t decrypted2;
-       
-
-       crypter = (crypter_t *) aes_cbc_crypter_create(16);
-       tester->assert_true(tester, (crypter != NULL), "create call test");
-       
-       tester->assert_true(tester, (crypter->set_key(crypter,key2_chunk) == SUCCESS), "set_key call test"); 
-       
-       tester->assert_true(tester, (crypter->encrypt(crypter,data2,iv2_chunk,&encrypted2) == SUCCESS), "encrypt call test");
-       
-       tester->assert_true(tester, (memcmp(encrypted2.ptr, expected_encrypted2.ptr, 32) == 0), "Encrypted value");
-       
-       logger->log_chunk(logger,RAW,"exptected encrypted :", expected_encrypted2);
-       logger->log_chunk(logger,RAW,"encrypted :", encrypted2);
-       
-       tester->assert_true(tester, (crypter->decrypt(crypter,encrypted2,iv2_chunk,&decrypted2) == SUCCESS), "decrypt call test");
-       allocator_free_chunk(&encrypted2);
-
-       tester->assert_true(tester, (memcmp(decrypted2.ptr, plaintext2, 32) == 0), "decrypted value");
-       
-       logger->log_chunk(logger,RAW,"expected decrypted :", data2);
-       logger->log_chunk(logger,RAW,"decrypted :", decrypted2);
-       
-       allocator_free_chunk(&decrypted2);
-
-       crypter->destroy(crypter);
-        
-       /*
-        * Test 3 of RFC3603
-        * Key       : 0x56e47a38c5598974bc46903dba290349
-        * IV        : 0x8ce82eefbea0da3c44699ed7db51b7d9
-        * Plaintext : 0xa0a1a2a3a4a5a6a7a8a9aaabacadaeaf
-     *                b0b1b2b3b4b5b6b7b8b9babbbcbdbebf
-     *             c0c1c2c3c4c5c6c7c8c9cacbcccdcecf
-     *             d0d1d2d3d4d5d6d7d8d9dadbdcdddedf
-        * Ciphertext: 0xc30e32ffedc0774e6aff6af0869f71aa
-     *             0f3af07a9a31a9c684db207eb0ef8e4e
-     *             35907aa632c3ffdf868bb7b29d3d46ad
-     *             83ce9f9a102ee99d49a53e87f4c3da55    
-        */
-       u_int8_t key3[] = {0x56,0xe4,0x7a,0x38,0xc5,0x59,0x89,0x74,
-                                          0xbc,0x46,0x90,0x3d,0xba,0x29,0x03,0x49};
-       chunk_t key3_chunk = {ptr: key3, len : 16};
-       u_int8_t iv3[] = {0x8c,0xe8,0x2e,0xef,0xbe,0xa0,0xda,0x3c,
-                                         0x44,0x69,0x9e,0xd7,0xdb,0x51,0xb7,0xd9};
-       chunk_t iv3_chunk = {ptr: iv3, len : 16};
-       u_int8_t ciphertext3[] = { 0xc3,0x0e,0x32,0xff,0xed,0xc0,0x77,0x4e,
-                                                          0x6a,0xff,0x6a,0xf0,0x86,0x9f,0x71,0xaa,
-                                                          0x0f,0x3a,0xf0,0x7a,0x9a,0x31,0xa9,0xc6,
-                                                          0x84,0xdb,0x20,0x7e,0xb0,0xef,0x8e,0x4e,
-                                                          0x35,0x90,0x7a,0xa6,0x32,0xc3,0xff,0xdf,
-                                                          0x86,0x8b,0xb7,0xb2,0x9d,0x3d,0x46,0xad,
-                                                          0x83,0xce,0x9f,0x9a,0x10,0x2e,0xe9,0x9d,
-                                                          0x49,0xa5,0x3e,0x87,0xf4,0xc3,0xda,0x55};
-       
-       chunk_t expected_encrypted3 = {ptr: ciphertext3, len : 64};
-       u_int8_t plaintext3[] = {0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,
-                                                        0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,
-                                                        0xb0,0xb1,0xb2,0xb3,0xb4,0xb5,0xb6,0xb7,
-                                                        0xb8,0xb9,0xba,0xbb,0xbc,0xbd,0xbe,0xbf,
-                                                        0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,
-                                                        0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,
-                                                        0xd0,0xd1,0xd2,0xd3,0xd4,0xd5,0xd6,0xd7,
-                                                        0xd8,0xd9,0xda,0xdb,0xdc,0xdd,0xde,0xdf};
-       chunk_t data3 = {ptr: plaintext3, len : 64};
-       chunk_t encrypted3;
-       chunk_t decrypted3;
-
-       crypter = (crypter_t *) aes_cbc_crypter_create(16);
-       tester->assert_true(tester, (crypter != NULL), "create call test");
-       
-       tester->assert_true(tester, (crypter->set_key(crypter,key3_chunk) == SUCCESS), "set_key call test"); 
-       
-       tester->assert_true(tester, (crypter->encrypt(crypter,data3,iv3_chunk,&encrypted3) == SUCCESS), "encrypt call test");
-       
-       tester->assert_true(tester, (memcmp(encrypted3.ptr, expected_encrypted3.ptr, 64) == 0), "Encrypted value");
-       
-       logger->log_chunk(logger,RAW,"exptected encrypted :", expected_encrypted3);
-       logger->log_chunk(logger,RAW,"encrypted :", encrypted3);
-       
-       tester->assert_true(tester, (crypter->decrypt(crypter,encrypted3,iv3_chunk,&decrypted3) == SUCCESS), "decrypt call test");
-       allocator_free_chunk(&encrypted3);
-
-       tester->assert_true(tester, (memcmp(decrypted3.ptr, plaintext3, 64) == 0), "decrypted value");
-       
-       logger->log_chunk(logger,RAW,"expected decrypted :", data3);
-       logger->log_chunk(logger,RAW,"decrypted :", decrypted3);
-       
-       allocator_free_chunk(&decrypted3);
-       
-       crypter->destroy(crypter);
-}
-
diff --git a/Source/charon/testcases/aes_cbc_crypter_test.h b/Source/charon/testcases/aes_cbc_crypter_test.h
deleted file mode 100644 (file)
index 6118636..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * @file aes_cbc_crypter_test.h
- * 
- * @brief Tests for the aes_cbc_crypter_t class.
- * 
- */
-
-/*
- * Copyright (C) 2005 Jan Hutter, Martin Willi
- * Hochschule fuer Technik Rapperswil
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * for more details.
- */
-
-#ifndef AES_CBC_CRYPTER_TEST_H_
-#define AES_CBC_CRYPTER_TEST_H_
-
-#include <transforms/crypters/aes_cbc_crypter.h>
-#include <utils/tester.h>
-
-/**
- * @brief Test function used to test the aes_cbc_crypter_t class.
- *
- * @param tester associated tester object
- * 
- * @ingroup testcases
- */
-void test_aes_cbc_crypter(protected_tester_t *tester);
-
-#endif /* AES_CBC_CRYPTER_TEST_H_ */
diff --git a/Source/charon/testcases/certificate_test.c b/Source/charon/testcases/certificate_test.c
deleted file mode 100644 (file)
index c950e00..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-/**
- * @file certificate_test.c
- *
- * @brief Tests for the certificate_t class.
- *
- */
-
-/*
- * Copyright (C) 2006 Martin Willi
- * Hochschule fuer Technik Rapperswil
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * for more details.
- */
-
-#include "certificate_test.h"
-
-#include <daemon.h>
-#include <transforms/certificate.h>
-#include <utils/allocator.h>
-#include <utils/logger.h>
-
-
-
-static char certificate_buffer[] = {
-       0x30,0x82,0x02,0xf9,0x30,0x82,0x01,0xe1,0xa0,0x03,0x02,0x01,0x02,0x02,0x11,0x00,
-       0xfe,0xae,0xe3,0xcf,0x00,0x27,0x8d,0xa0,0xe1,0xfa,0xb2,0x07,0xd4,0x15,0x40,0x93,
-       0x30,0x0d,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x01,0x05,0x05,0x00,0x30,
-       0x38,0x31,0x0b,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x43,0x48,0x31,0x19,
-       0x30,0x17,0x06,0x03,0x55,0x04,0x0a,0x13,0x10,0x4c,0x69,0x6e,0x75,0x78,0x20,0x73,
-       0x74,0x72,0x6f,0x6e,0x67,0x53,0x77,0x61,0x6e,0x31,0x0e,0x30,0x0c,0x06,0x03,0x55,
-       0x04,0x03,0x13,0x05,0x6d,0x61,0x65,0x6e,0x6f,0x30,0x1e,0x17,0x0d,0x30,0x36,0x30,
-       0x33,0x32,0x37,0x30,0x36,0x35,0x32,0x33,0x38,0x5a,0x17,0x0d,0x31,0x31,0x30,0x33,
-       0x32,0x36,0x30,0x36,0x35,0x32,0x33,0x38,0x5a,0x30,0x38,0x31,0x0b,0x30,0x09,0x06,
-       0x03,0x55,0x04,0x06,0x13,0x02,0x43,0x48,0x31,0x19,0x30,0x17,0x06,0x03,0x55,0x04,
-       0x0a,0x13,0x10,0x4c,0x69,0x6e,0x75,0x78,0x20,0x73,0x74,0x72,0x6f,0x6e,0x67,0x53,
-       0x77,0x61,0x6e,0x31,0x0e,0x30,0x0c,0x06,0x03,0x55,0x04,0x03,0x13,0x05,0x6d,0x61,
-       0x65,0x6e,0x6f,0x30,0x82,0x01,0x22,0x30,0x0d,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,
-       0x0d,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0f,0x00,0x30,0x82,0x01,0x0a,0x02,
-       0x82,0x01,0x01,0x00,0xe3,0x75,0x56,0xb9,0x68,0x46,0xa6,0x3e,0x6c,0x19,0x36,0xfb,
-       0x9a,0xb4,0xbc,0xc1,0x22,0x47,0xc0,0x00,0x8a,0x44,0x1c,0xa7,0x44,0x2e,0x73,0x50,
-       0xfc,0xd2,0x91,0x9c,0xaa,0xc3,0xa3,0x88,0x8c,0x4b,0x33,0xef,0x9a,0x52,0x89,0x9c,
-       0x8e,0x01,0x62,0x21,0x7a,0x75,0x5e,0xa3,0x3b,0xc0,0xb0,0x58,0xc0,0xc0,0xce,0x77,
-       0xe0,0x84,0x9a,0x9e,0xc1,0x51,0x71,0xc7,0xc4,0xa0,0x1e,0xf0,0x8e,0xb3,0x90,0x3e,
-       0xcd,0xe3,0x7d,0x8e,0x11,0x7b,0x92,0x5d,0x4a,0x37,0x3b,0x4b,0xb3,0x3d,0x58,0x9a,
-       0x8b,0x51,0x39,0x15,0xcd,0x27,0xd4,0x5b,0xad,0x5e,0xa5,0x07,0x94,0x29,0x0f,0x02,
-       0x0c,0x61,0x85,0x97,0x3b,0xc4,0xcf,0x5d,0x17,0x86,0x4d,0x96,0x5e,0x42,0xe9,0xf2,
-       0x72,0x2f,0xd4,0x58,0x4d,0x02,0xf8,0x0f,0xbd,0xe7,0x37,0xc8,0xa9,0x87,0xfe,0xab,
-       0x26,0x37,0x13,0x90,0x65,0x2d,0x51,0x41,0x18,0x18,0xdf,0x48,0x21,0x87,0x70,0x61,
-       0xcb,0x1b,0x62,0xad,0xaf,0x65,0xd2,0x29,0x27,0x93,0x58,0x7b,0xea,0x89,0xdd,0x58,
-       0x01,0x6d,0xeb,0x60,0xd8,0xc3,0x82,0x07,0x2c,0x67,0x39,0xc3,0x68,0xfc,0xcd,0xeb,
-       0xe9,0x7c,0x67,0xe3,0x1b,0x7a,0x50,0xf9,0x36,0x68,0xea,0xe2,0x15,0x01,0xee,0x99,
-       0xf2,0x52,0xe0,0x0a,0x8e,0x5f,0x63,0xb1,0x61,0x7a,0x38,0x88,0x07,0xae,0xb0,0x8d,
-       0x44,0x26,0xe8,0xce,0x1b,0x6f,0xcd,0x05,0x4b,0x94,0x9d,0xee,0xb5,0xeb,0x28,0xc4,
-       0x93,0x47,0xfd,0x47,0x40,0x45,0x58,0xc0,0x3e,0x44,0x74,0x7b,0x78,0x8d,0xc8,0x25,
-       0xc1,0xe1,0x0a,0x43,0x02,0x03,0x01,0x00,0x01,0x30,0x0d,0x06,0x09,0x2a,0x86,0x48,
-       0x86,0xf7,0x0d,0x01,0x01,0x05,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0x77,0xfd,0xd2,
-       0x68,0x7e,0xb9,0xc2,0x40,0xb4,0xa3,0xea,0xe8,0x15,0x55,0x18,0xfe,0xe3,0x80,0xe0,
-       0x73,0xf9,0xe1,0xe5,0xe2,0x91,0xf5,0xa7,0xcb,0xdf,0xfb,0xc1,0x36,0xa6,0x55,0x6a,
-       0xd9,0x27,0xcd,0xef,0x64,0x30,0x70,0xd8,0x4b,0x72,0x7c,0xd1,0x9c,0x32,0xf8,0xb4,
-       0x15,0x7f,0xd7,0x79,0x0c,0x9f,0x24,0xf8,0x50,0xea,0xc7,0xd9,0xef,0x1f,0xf1,0x76,
-       0x3c,0x19,0xdb,0x61,0xb7,0x35,0x97,0xf9,0x03,0x87,0x42,0x77,0x23,0xd8,0xfe,0xd1,
-       0x74,0xf2,0x1e,0x95,0x87,0x5f,0x42,0x80,0x8e,0xee,0x6c,0x19,0x7b,0x2c,0x25,0xe6,
-       0xf9,0xdb,0x24,0x35,0x94,0x65,0x44,0xa0,0x56,0x6f,0x7f,0x57,0x2e,0x1a,0xcd,0xa6,
-       0xed,0x7f,0x42,0xf2,0x64,0xd4,0xf9,0x3f,0xc1,0x46,0xf6,0xc8,0xb1,0xb2,0x80,0x75,
-       0x3e,0xd1,0xa8,0x5e,0x07,0xd0,0x3b,0x35,0x81,0x49,0x93,0x77,0xd2,0xcf,0xf7,0xb6,
-       0xd0,0xeb,0xe5,0xf3,0x2c,0x03,0x52,0xc7,0x6d,0x02,0x26,0xa6,0xdc,0x39,0xcd,0x4d,
-       0x9e,0xca,0x99,0x01,0x01,0x73,0xd6,0x55,0x89,0x93,0x12,0xa0,0xc5,0xe6,0xa7,0x9a,
-       0xdc,0x5f,0x9f,0x5c,0x2c,0x2b,0xdb,0x23,0xa5,0xee,0x69,0x15,0x1f,0x3a,0xf1,0x76,
-       0x36,0xb5,0x77,0x18,0x57,0xff,0xff,0xf7,0x45,0x59,0xce,0x1b,0x0b,0x56,0xcb,0x09,
-       0x00,0x12,0x17,0xb8,0xa2,0x81,0x86,0x70,0x29,0x63,0x99,0x76,0xff,0x18,0x80,0x2b,
-       0x9b,0x5e,0x04,0xb1,0xcc,0xe4,0x15,0x90,0x29,0xa6,0x40,0xdd,0x85,0x38,0xd7,0xfe,
-       0x10,0xb5,0x97,0x6e,0x62,0x60,0xb9,0x02,0x67,0xef,0xf1,0xab,0xb3,
-};
-
-/**
- * Described in header.
- */
-void test_certificate(protected_tester_t *tester)
-{
-       chunk_t certificate = {certificate_buffer, sizeof(certificate_buffer)};
-       
-       certificate_t *cert = certificate_create_from_chunk(certificate);
-       
-       //certificate_t *cert = certificate_create_from_file("myCert.der");
-       
-       cert->destroy(cert);
-}
diff --git a/Source/charon/testcases/certificate_test.h b/Source/charon/testcases/certificate_test.h
deleted file mode 100644 (file)
index 8dcbd0f..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * @file certificate_test.h
- *
- * @brief Tests for the certificate_t class.
- *
- */
-
-/*
- * Copyright (C) 2006 Martin Willi
- * Hochschule fuer Technik Rapperswil
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * for more details.
- */
-
-
-#ifndef CERTIFICATE_TEST_H_
-#define CERTIFICATE_TEST_H_
-
-#include <utils/tester.h>
-
-/**
- * @brief Test function used to test the certificate_t functionality.
- *
- * @param tester associated protected_tester_t object
- * 
- * @ingroup testcases
- */
-void test_certificate(protected_tester_t *tester);
-
-#endif /* CERTIFICATE_TEST_H_ */
-
-
-
-
diff --git a/Source/charon/testcases/child_sa_test.c b/Source/charon/testcases/child_sa_test.c
deleted file mode 100644 (file)
index 0a3aec9..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-/**
- * @file child_sa_test.c
- *
- * @brief Tests for the child_sa_t class.
- *
- */
-
-/*
- * Copyright (C) 2005 Jan Hutter, Martin Willi
- * Hochschule fuer Technik Rapperswil
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * for more details.
- */
-
-#include "child_sa_test.h"
-
-#include <daemon.h>
-#include <sa/child_sa.h>
-#include <utils/allocator.h>
-#include <utils/logger.h>
-
-
-/**
- * Described in header.
- */
-void test_child_sa(protected_tester_t *tester)
-{
-       proposal_t *proposal1, *proposal2;
-       linked_list_t *list;
-       host_t *local_me, *remote_me;
-       host_t *local_other, *remote_other;
-       child_sa_t *local_sa, *remote_sa;
-       prf_plus_t *local_prf_plus, *remote_prf_plus;
-       prf_t *local_prf, *remote_prf;
-       u_int8_t key_buffer[] = {0x01,0x02,0x03,0x04};
-       chunk_t key = {key_buffer, sizeof(key_buffer)};
-       status_t status;
-       
-       /* setup test data */
-       local_me = host_create(AF_INET, "192.168.0.1", 0);
-       local_other = host_create(AF_INET, "192.168.0.2", 0);
-       remote_me = host_create(AF_INET, "192.168.0.3", 0);
-       remote_other = host_create(AF_INET, "192.168.0.4", 0);
-       
-       local_sa = child_sa_create(local_me, local_other);
-       remote_sa = child_sa_create(remote_me, remote_other);
-       
-       proposal1 = proposal_create(1);
-       proposal1->add_algorithm(proposal1, PROTO_ESP, ENCRYPTION_ALGORITHM, ENCR_AES_CBC, 16);
-       
-       proposal2 = proposal_create(2);
-       proposal2->add_algorithm(proposal2, PROTO_AH, INTEGRITY_ALGORITHM, AUTH_HMAC_SHA1_96, 0);
-       
-       list = linked_list_create();
-       list->insert_last(list, proposal1);
-       list->insert_last(list, proposal2);
-       
-       local_prf = prf_create(PRF_HMAC_SHA1);
-       remote_prf = prf_create(PRF_HMAC_SHA1);
-       local_prf->set_key(local_prf, key);
-       remote_prf->set_key(remote_prf, key);
-       local_prf_plus = prf_plus_create(local_prf, key);
-       remote_prf_plus = prf_plus_create(remote_prf, key);
-       
-       /* 
-        * local plays initiator 
-        ***********************
-       */
-       status = local_sa->alloc(local_sa, list);
-       tester->assert_true(tester, status == SUCCESS, "spi allocation");
-       
-       status = remote_sa->add(remote_sa, proposal1, remote_prf_plus);
-       tester->assert_true(tester, status == SUCCESS, "sa add");
-       
-       status = local_sa->update(local_sa, proposal1, local_prf_plus);
-       tester->assert_true(tester, status == SUCCESS, "sa update");
-       
-       /* cleanup */
-       proposal1->destroy(proposal1);
-       proposal2->destroy(proposal2);
-       list->destroy(list);
-       local_prf->destroy(local_prf);
-       local_prf_plus->destroy(local_prf_plus);
-       remote_prf->destroy(remote_prf);
-       remote_prf_plus->destroy(remote_prf_plus);
-       local_sa->destroy(local_sa);
-       remote_sa->destroy(remote_sa);
-       local_me->destroy(local_me);
-       local_other->destroy(local_other);
-       remote_me->destroy(remote_me);
-       remote_other->destroy(remote_other);
-       
-       
-}
diff --git a/Source/charon/testcases/child_sa_test.h b/Source/charon/testcases/child_sa_test.h
deleted file mode 100644 (file)
index ef92499..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * @file child_sa_test.h
- *
- * @brief Tests for the child_sa_t class.
- *
- */
-
-/*
- * Copyright (C) 2005 Jan Hutter, Martin Willi
- * Hochschule fuer Technik Rapperswil
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * for more details.
- */
-
-
-#ifndef CHILD_SA_TEST_H_
-#define CHILD_SA_TEST_H_
-
-#include <utils/tester.h>
-
-/**
- * @brief Test function used to test the child_sa_t functionality.
- *
- * @param tester associated protected_tester_t object
- * 
- * @ingroup testcases
- */
-void test_child_sa(protected_tester_t *tester);
-
-#endif /* CHILD_SA_TEST_H_ */
-
-
-
-
diff --git a/Source/charon/testcases/connection_test.c b/Source/charon/testcases/connection_test.c
deleted file mode 100644 (file)
index ae8ed3c..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/**
- * @file connection_test.c
- *
- * @brief Tests for the connection_t class.
- *
- */
-
-/*
- * Copyright (C) 2005 Jan Hutter, Martin Willi
- * Hochschule fuer Technik Rapperswil
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * for more details.
- */
-
-#include "connection_test.h"
-
-#include <config/connection.h>
-#include <utils/allocator.h>
-#include <transforms/prfs/prf.h>
-
-
-/**
- * Described in header.
- */
-void test_connection(protected_tester_t *tester)
-{
-       host_t *alice = host_create(AF_INET, "192.168.0.1", 500);
-       host_t *bob = host_create(AF_INET, "192.168.0.2", 500);
-       identification_t *alice_id = identification_create_from_string(AF_INET, "192.168.0.1");
-       identification_t *bob_id = identification_create_from_string(AF_INET, "192.168.0.2");
-       connection_t *connection = connection_create(alice, bob, alice_id, bob_id, RSA_DIGITAL_SIGNATURE);
-       proposal_t *prop1, *prop2, *prop3, *prop4;
-       linked_list_t *list;
-
-       prop1 = proposal_create(1);
-       prop1->add_algorithm(prop1, PROTO_IKE, ENCRYPTION_ALGORITHM, ENCR_AES_CBC, 20);
-       prop1->add_algorithm(prop1, PROTO_IKE, INTEGRITY_ALGORITHM, AUTH_HMAC_SHA1_96, 20);
-       prop1->add_algorithm(prop1, PROTO_IKE, PSEUDO_RANDOM_FUNCTION, PRF_HMAC_SHA1, 20);
-       prop1->add_algorithm(prop1, PROTO_IKE, DIFFIE_HELLMAN_GROUP, MODP_2048_BIT, 0);
-       
-       prop2 = proposal_create(2);
-       prop2->add_algorithm(prop2, PROTO_IKE, ENCRYPTION_ALGORITHM, ENCR_AES_CBC, 20);
-       prop2->add_algorithm(prop2, PROTO_IKE, INTEGRITY_ALGORITHM, AUTH_HMAC_SHA1_96, 20);
-       prop2->add_algorithm(prop2, PROTO_IKE, PSEUDO_RANDOM_FUNCTION, PRF_HMAC_MD5, 20);
-       prop2->add_algorithm(prop2, PROTO_IKE, DIFFIE_HELLMAN_GROUP, MODP_1024_BIT, 0);
-       
-       prop3 = proposal_create(3);
-       prop3->add_algorithm(prop3, PROTO_IKE, ENCRYPTION_ALGORITHM, ENCR_DES, 20);
-       prop3->add_algorithm(prop3, PROTO_IKE, INTEGRITY_ALGORITHM, AUTH_HMAC_SHA1_96, 20);
-       prop3->add_algorithm(prop3, PROTO_IKE, PSEUDO_RANDOM_FUNCTION, PRF_HMAC_MD5, 20);
-       prop3->add_algorithm(prop3, PROTO_IKE, DIFFIE_HELLMAN_GROUP, MODP_768_BIT, 0);
-       
-       prop4 = proposal_create(4);
-       prop4->add_algorithm(prop4, PROTO_IKE, ENCRYPTION_ALGORITHM, ENCR_3DES, 20);
-       prop4->add_algorithm(prop4, PROTO_IKE, INTEGRITY_ALGORITHM, AUTH_HMAC_SHA1_96, 20);
-       prop4->add_algorithm(prop4, PROTO_IKE, PSEUDO_RANDOM_FUNCTION, PRF_HMAC_TIGER, 20);
-       prop4->add_algorithm(prop4, PROTO_IKE, DIFFIE_HELLMAN_GROUP, MODP_768_BIT, 0);
-       
-       connection->add_proposal(connection, prop1);
-       connection->add_proposal(connection, prop2);
-       connection->add_proposal(connection, prop3);
-       connection->add_proposal(connection, prop4);
-       
-       list = connection->get_proposals(connection);
-       
-       tester->assert_true(tester,(list->get_count(list) == 4), "proposal count check ");
-
-       
-       /* going to check proposals */
-       /* TODO test?*/
-       
-       list->destroy(list);
-       
-       connection->destroy(connection);
-}
diff --git a/Source/charon/testcases/connection_test.h b/Source/charon/testcases/connection_test.h
deleted file mode 100644 (file)
index 4d2a1d8..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * @file connection_test.h
- *
- * @brief Tests for the connection_t class.
- *
- */
-
-/*
- * Copyright (C) 2005 Jan Hutter, Martin Willi
- * Hochschule fuer Technik Rapperswil
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * for more details.
- */
-
-
-#ifndef INIT_CONFIG_TEST_H_
-#define INIT_CONFIG_TEST_H_
-
-#include <utils/tester.h>
-
-/**
- * @brief Test function used to test the connection_t functionality.
- *
- * @param tester associated protected_tester_t object
- * 
- * @ingroup testcases
- */
-void test_connection(protected_tester_t *tester);
-
-#endif /* INIT_CONFIG_TEST_H_ */
diff --git a/Source/charon/testcases/der_decoder_test.c b/Source/charon/testcases/der_decoder_test.c
deleted file mode 100644 (file)
index c5683fa..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-/**
- * @file der_decoder_test.c
- *
- * @brief Tests for the der_decoder_t class.
- *
- */
-
-/*
- * Copyright (C) 2006 Martin Willi
- * Hochschule fuer Technik Rapperswil
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * for more details.
- */
-
-#include "der_decoder_test.h"
-
-#include <daemon.h>
-#include <asn1/der_decoder.h>
-#include <utils/allocator.h>
-#include <utils/logger.h>
-
-
-
-static char private_key_buffer[] = {
-       0x30,0x82,0x04,0xa2,0x02,0x00,0x02,0x82,0x01,0x01,0x00,0x9b,0x28,0x10,0x02,0xd2,
-       0x43,0x5b,0x2b,0x7c,0x81,0xce,0x2b,0x77,0xb4,0xbf,0x5f,0x2a,0x9a,0x96,0xc9,0xa4,
-       0xd7,0xbb,0xb3,0xfb,0xc1,0x8a,0xad,0xbe,0x21,0x4e,0xd7,0x15,0xc4,0x8c,0x0a,0x88,
-       0x5b,0x02,0xa9,0xcd,0x2e,0xee,0xd3,0x5e,0xb9,0xfd,0x27,0x0b,0xdb,0xf6,0xe7,0xb7,
-       0x39,0xc1,0xfa,0x34,0x3f,0xa7,0xe4,0x04,0xaf,0xa8,0xc2,0x36,0x4e,0xf5,0x0c,0xf1,
-       0x9b,0x92,0x26,0x32,0x20,0xdb,0x04,0xf5,0xb8,0x2e,0xf5,0xfc,0x47,0xd3,0x2a,0xa1,
-       0x2d,0x5b,0x68,0x2c,0x5e,0xc6,0xc9,0x35,0x57,0x7b,0x65,0x17,0xd7,0x5d,0x10,0x5c,
-       0x51,0xfb,0xcb,0x95,0xd1,0x17,0x42,0xa9,0xfd,0xd1,0xc4,0x32,0x1f,0x13,0xf2,0xeb,
-       0x6b,0x91,0x01,0xe9,0x89,0x19,0x3a,0x2b,0x6d,0xae,0x91,0x27,0xe2,0x5e,0x06,0x5b,
-       0x99,0xfb,0x20,0x3c,0xc4,0x92,0x20,0xc4,0x68,0x24,0x6b,0x74,0xdc,0x6d,0xf7,0xa8,
-       0x10,0x1b,0xdf,0x20,0xed,0x4e,0x90,0x0e,0x3d,0xf6,0xef,0x3a,0x94,0x8b,0x12,0x61,
-       0xac,0xed,0x95,0xbc,0xe2,0xed,0xb9,0x22,0xc2,0xdd,0xc7,0x19,0x68,0x09,0x14,0x71,
-       0xb0,0x37,0xf7,0xbd,0x65,0x11,0x31,0x9d,0x89,0x6e,0x21,0xcf,0x60,0xc1,0x8d,0xbe,
-       0x31,0x96,0xd2,0xdd,0x0e,0x20,0x38,0x07,0xd5,0xea,0xda,0xc8,0x9a,0x47,0x5b,0x05,
-       0xce,0x7d,0xf7,0x4e,0xcd,0xbb,0x89,0xdd,0x46,0x16,0x8f,0x39,0x9d,0x32,0x19,0xaf,
-       0x6e,0xc4,0xb3,0x6c,0x79,0x5a,0x70,0x11,0x8f,0xe2,0x75,0x33,0x09,0xc8,0xf6,0xd7,
-       0x40,0x25,0xe7,0xa3,0xf0,0x6f,0x9a,0xdb,0x35,0x74,0xc1,0x02,0x03,0x01,0x00,0x01,
-       0x02,0x82,0x01,0x00,0x12,0x42,0x38,0x58,0x21,0xfc,0x51,0x34,0xa0,0x8b,0x4f,0x58,
-       0x28,0x2c,0x7a,0x14,0xd8,0x98,0xfb,0xee,0x5b,0x85,0x69,0x0e,0x63,0x83,0x16,0xd9,
-       0xc9,0x5f,0xcc,0x12,0x5d,0xa5,0x15,0x41,0xd6,0xb8,0x0c,0x6b,0xda,0x67,0x3a,0x83,
-       0x09,0xf3,0xb8,0x89,0xd4,0x1d,0xc7,0x99,0x8f,0x23,0x59,0xe3,0x78,0x2b,0x41,0x8b,
-       0xab,0x78,0x2c,0x7e,0x3b,0xbb,0xe0,0xf4,0x96,0xa8,0xd3,0x1d,0xc6,0xea,0x67,0x91,
-       0x2c,0x30,0x1c,0xe9,0x4f,0xb8,0xa2,0xc3,0x5d,0x2c,0xf9,0x99,0x1c,0x6c,0xee,0xd7,
-       0x16,0x28,0x3c,0x5a,0x32,0x35,0xb8,0x3a,0xf3,0xa7,0xa6,0x35,0x02,0xba,0xbf,0x67,
-       0xab,0x44,0xe1,0x09,0x9b,0x48,0x5d,0xa5,0x9e,0xf4,0xb7,0xf4,0xd1,0xfc,0x68,0x9e,
-       0x98,0x26,0x69,0x28,0xcc,0x19,0x75,0xf2,0x61,0x0e,0x23,0xeb,0xf9,0x6d,0x2c,0x2b,
-       0x01,0x3f,0x4d,0x18,0x41,0xc5,0x31,0x9d,0x1c,0x20,0x81,0x4e,0x38,0x92,0xd5,0xbb,
-       0xd7,0xe7,0x49,0x0c,0x3a,0xf3,0x8f,0x9e,0xf0,0xb3,0x32,0x1e,0xa7,0x77,0xe8,0x9c,
-       0xf3,0xce,0x88,0x66,0xcc,0xe8,0x16,0xbb,0xfd,0xbc,0x62,0xc7,0xc3,0xeb,0x0a,0xf5,
-       0xd8,0x53,0x02,0x6c,0x45,0xcb,0x1d,0xa3,0x96,0xfb,0xa5,0x26,0x18,0x7f,0x04,0x9f,
-       0x80,0x4a,0xdb,0x3b,0x74,0xcf,0x0d,0x45,0xf4,0xd5,0x49,0xe9,0x27,0x54,0x9c,0x57,
-       0x92,0x48,0x78,0x52,0xb6,0x40,0x89,0x3f,0xf3,0x95,0x06,0x3d,0x90,0xab,0xa0,0x8a,
-       0xc7,0x54,0xf1,0x63,0xcf,0xa6,0xd2,0x83,0x1e,0x69,0x54,0xe0,0x77,0x2c,0x9e,0x3a,
-       0x4f,0xdd,0x14,0x6d,0x02,0x81,0x81,0x00,0xd9,0x40,0x76,0x90,0x7c,0xe7,0x3b,0xa3,
-       0x59,0x23,0x14,0x6b,0xf3,0x5f,0x6e,0x6b,0x82,0x34,0xf6,0xbd,0x3e,0xfb,0x65,0xac,
-       0x2f,0x46,0xd5,0x6e,0x9b,0xb8,0x62,0x80,0xc3,0x0c,0xa9,0xa6,0x00,0xd6,0xb8,0x1c,
-       0x12,0x8d,0x4d,0xd0,0x64,0x29,0x4c,0xac,0x38,0xe8,0x6c,0xe4,0x82,0x02,0x4e,0x10,
-       0xd5,0x39,0x19,0x29,0x0c,0x58,0x3f,0x68,0xa0,0x11,0x0e,0x11,0x74,0x22,0x2b,0x7e,
-       0xc2,0xa7,0x88,0xe3,0x33,0xe8,0xb4,0x50,0x6e,0x0c,0x54,0xc5,0x3f,0xb7,0x16,0xcb,
-       0x39,0xed,0x23,0xd0,0x66,0x26,0x57,0xf9,0xcb,0xc9,0xac,0xe2,0xa4,0xb8,0xba,0xd8,
-       0xd2,0x1f,0x4a,0xed,0x73,0x89,0xda,0x42,0x27,0x5a,0x26,0x30,0x33,0xc8,0x42,0x2a,
-       0x3d,0xc5,0xf3,0xc2,0x29,0x3d,0x58,0x67,0x02,0x81,0x81,0x00,0xb6,0xd4,0x61,0x05,
-       0x49,0xcb,0xf4,0x29,0x8a,0x22,0xd3,0xa3,0x7c,0x9c,0xd2,0x07,0xa4,0x66,0xe4,0x36,
-       0xfa,0x5e,0xf6,0x64,0xb7,0x59,0x74,0x2f,0x36,0x6d,0x12,0xd0,0xc9,0x4d,0xf8,0xd1,
-       0xba,0xd1,0xee,0xd2,0x78,0xcd,0x51,0x69,0x33,0x6a,0x03,0xff,0xc2,0x35,0x1d,0x0d,
-       0x9c,0x0a,0x87,0x5e,0x09,0xa3,0x23,0x4c,0xab,0xc3,0x4c,0x4a,0x1c,0xa4,0xc5,0xe2,
-       0x70,0x42,0x1c,0xcf,0xea,0x79,0xfb,0xb9,0x87,0x67,0x4d,0xc3,0xfc,0xcc,0x86,0x9d,
-       0xfa,0xea,0x99,0xa5,0x1b,0xc1,0x96,0xf4,0x79,0x4d,0x66,0x12,0x8f,0x90,0x98,0xb4,
-       0xa1,0x3b,0xd6,0x2f,0x64,0xb4,0x5f,0x8f,0x47,0x7f,0x43,0xa5,0x6d,0xeb,0x06,0x58,
-       0xfb,0x04,0x9e,0xef,0xaf,0x88,0x35,0x88,0xa1,0x15,0x30,0x97,0x02,0x81,0x80,0x59,
-       0xbe,0xe0,0x7b,0xc5,0xad,0x3c,0x1c,0xb9,0x98,0xdd,0x39,0xce,0xfa,0xd0,0x41,0x87,
-       0x33,0x5b,0xee,0x47,0x93,0x50,0xa7,0xf5,0x8b,0xbc,0x65,0x89,0xdc,0x7c,0x8c,0x96,
-       0x86,0xa7,0x9a,0x54,0xe4,0x5e,0x7f,0xf2,0x45,0xff,0x2c,0x24,0x04,0x4f,0x91,0x21,
-       0x9d,0x1a,0x46,0xb7,0x52,0x3e,0x6f,0x83,0xb5,0xa7,0xa8,0x26,0x5a,0x5a,0x2f,0x5d,
-       0x58,0x4e,0x48,0x75,0x82,0x1c,0x17,0xac,0x4f,0xcb,0x23,0x98,0x70,0xfb,0xf3,0xf1,
-       0xd2,0x14,0x3e,0xbb,0x98,0x65,0xc9,0x24,0x2f,0xcb,0x48,0xae,0xba,0x0e,0x43,0xb9,
-       0xa4,0xa1,0x4f,0xab,0x1e,0x48,0xc9,0x82,0xdb,0xbc,0x77,0x24,0xf0,0x80,0x82,0x2d,
-       0x81,0x77,0x1f,0x18,0x75,0x14,0xa8,0x20,0x86,0xa2,0xb0,0xc5,0x9a,0x7a,0xe7,0x02,
-       0x81,0x80,0x1b,0x6d,0xb1,0x40,0x81,0xd9,0xbf,0x3f,0x9c,0x21,0xad,0x6e,0x91,0x7b,
-       0x55,0x67,0x20,0x1a,0xef,0x91,0xef,0xed,0xdf,0x39,0x2c,0xe8,0x96,0xad,0x9e,0x94,
-       0xae,0x85,0xf4,0x2d,0x66,0x6e,0xd0,0x80,0x3e,0x3c,0x05,0x33,0x88,0x4b,0x28,0x13,
-       0x77,0x96,0x1f,0x24,0xa8,0xbf,0x29,0xf1,0xca,0x6d,0x29,0x34,0xf8,0x4e,0xc0,0x56,
-       0x04,0x53,0xfa,0x08,0x1e,0x47,0xe2,0x5f,0x88,0xc3,0x08,0x82,0x54,0x69,0x79,0x0e,
-       0xde,0x73,0xd0,0xb1,0x3e,0x60,0xe5,0x0b,0xdd,0x11,0x10,0x20,0xf2,0xec,0xaa,0x66,
-       0x1a,0x32,0x1e,0xa7,0xaa,0xc1,0x2e,0x8f,0x33,0x8a,0xd8,0xa8,0xd6,0xcd,0x40,0x04,
-       0xaf,0xb9,0x59,0xcc,0x30,0x9f,0x98,0xc9,0x10,0xaf,0x14,0xbe,0x72,0x89,0x94,0xe1,
-       0x00,0xf1,0x02,0x81,0x81,0x00,0xd6,0xac,0x26,0xd2,0x42,0x5b,0x16,0xa9,0x39,0x02,
-       0x63,0x76,0xa4,0xf5,0x40,0x3a,0xde,0xfa,0xea,0xd8,0xd3,0x12,0xee,0x44,0x00,0xfe,
-       0xcb,0xa1,0x78,0x18,0xaa,0xa7,0x08,0xea,0x5e,0x36,0x52,0x28,0x0d,0x02,0x5a,0x9e,
-       0x2d,0xc1,0x22,0x29,0x08,0x4f,0xed,0xff,0xa9,0xa6,0x08,0x8d,0x77,0xa4,0x5c,0xae,
-       0xa7,0x8a,0x19,0x90,0xc2,0x12,0xc8,0x0f,0xb8,0x24,0xb5,0xba,0x45,0x2f,0xa6,0xc2,
-       0x10,0x4c,0x0d,0x7e,0xf2,0xfd,0x11,0x26,0x16,0x34,0xbe,0x08,0x25,0x41,0x8b,0xcc,
-       0x60,0xe7,0x02,0x3e,0x6a,0x54,0x05,0x80,0x66,0x2d,0x55,0x06,0xe6,0xbe,0x9b,0x15,
-       0x9d,0xd3,0x5d,0xc4,0x6b,0x3f,0x74,0xa6,0x24,0xbc,0x7f,0x13,0xdf,0xe3,0x51,0x86,
-       0x64,0x0f,0x1d,0x1f,0xf2,0x1e,
-};
-
-asn1_rule_t private_key_rules[] = {
-       {ASN1_SEQUENCE, 0, 0, 0},
-       {       ASN1_INTEGER, 0,                0, 0},
-       {       ASN1_INTEGER, ASN1_MPZ, 0, 0},
-       {       ASN1_INTEGER, ASN1_MPZ, 0, 0},
-       {       ASN1_INTEGER, ASN1_MPZ, 0, 0},
-       {       ASN1_INTEGER, ASN1_MPZ, 0, 0},
-       {       ASN1_INTEGER, ASN1_MPZ, 0, 0},
-       {       ASN1_INTEGER, ASN1_MPZ, 0, 0},
-       {       ASN1_INTEGER, ASN1_MPZ, 0, 0},
-       {       ASN1_INTEGER, ASN1_MPZ, 0, 0},
-       {ASN1_END, 0, 0, 0},
-};
-
-/**
- * Described in header.
- */
-void test_der_decoder(protected_tester_t *tester)
-{
-       chunk_t private_key = {private_key_buffer, sizeof(private_key_buffer)};
-       
-       der_decoder_t *dd = der_decoder_create(private_key_rules);
-       
-       dd->decode(dd, private_key, NULL);
-       
-       dd->destroy(dd);
-       
-}
-
-
-
diff --git a/Source/charon/testcases/der_decoder_test.h b/Source/charon/testcases/der_decoder_test.h
deleted file mode 100644 (file)
index e7a7b7b..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * @file der_decoder_test.h
- *
- * @brief Tests for the der_decoder_t class.
- *
- */
-
-/*
- * Copyright (C) 2006 Martin Willi
- * Hochschule fuer Technik Rapperswil
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * for more details.
- */
-
-
-#ifndef DER_DECODER_TEST_H_
-#define DER_DECODER_TEST_H_
-
-#include <utils/tester.h>
-
-/**
- * @brief Test function used to test the der_decoder_t functionality.
- *
- * @param tester associated protected_tester_t object
- * 
- * @ingroup testcases
- */
-void test_der_decoder(protected_tester_t *tester);
-
-#endif /* DER_DECODER_TEST_H_ */
-
-
-
-
diff --git a/Source/charon/testcases/diffie_hellman_test.c b/Source/charon/testcases/diffie_hellman_test.c
deleted file mode 100644 (file)
index 7a74622..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/**
- * @file diffie_hellman_test.c
- * 
- * @brief Tests for the diffie_hellman_t class.
- * 
- */
-
-/*
- * Copyright (C) 2005 Jan Hutter, Martin Willi
- * Hochschule fuer Technik Rapperswil
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * for more details.
- */
-#include "diffie_hellman_test.h"
-
-#include "../transforms/diffie_hellman.h"
-
-#include <daemon.h>
-#include <utils/logger_manager.h>
-#include <utils/allocator.h>
-#include <encoding/payloads/transform_substructure.h>
-
-/* 
- * described in Header-File
- */
-void test_diffie_hellman(protected_tester_t *tester)
-{
-       diffie_hellman_t *my_diffie_hellman, *other_diffie_hellman;
-       logger_t *logger;
-       chunk_t my_public_value, other_public_value;
-       chunk_t my_secret, other_secret;
-
-       logger = charon->logger_manager->get_logger(charon->logger_manager,TESTER);
-
-
-       my_diffie_hellman = diffie_hellman_create(MODP_1024_BIT);
-       tester->assert_true(tester,(my_diffie_hellman != NULL), "create call check");   
-       
-       other_diffie_hellman = diffie_hellman_create(MODP_1024_BIT);
-       tester->assert_true(tester,(other_diffie_hellman != NULL), "create call check");        
-
-       my_diffie_hellman->get_my_public_value(my_diffie_hellman,&my_public_value);
-       logger->log_chunk(logger,RAW,"My public value",my_public_value);
-
-       other_diffie_hellman->get_my_public_value(other_diffie_hellman,&other_public_value);
-       logger->log_chunk(logger,RAW,"Other public value",other_public_value);
-
-       my_diffie_hellman->set_other_public_value(my_diffie_hellman,other_public_value);
-       other_diffie_hellman->set_other_public_value(other_diffie_hellman,my_public_value);
-
-       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");
-       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");
-       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");
-       
-       allocator_free(my_secret.ptr);
-       allocator_free(other_secret.ptr);       
-               
-       my_diffie_hellman->destroy(my_diffie_hellman);
-       other_diffie_hellman->destroy(other_diffie_hellman);
-}
diff --git a/Source/charon/testcases/diffie_hellman_test.h b/Source/charon/testcases/diffie_hellman_test.h
deleted file mode 100644 (file)
index e6e3ff6..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * @file diffie_hellman_test.h
- * 
- * @brief Tests for the diffie_hellman_t class.
- * 
- */
-
-/*
- * Copyright (C) 2005 Jan Hutter, Martin Willi
- * Hochschule fuer Technik Rapperswil
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * for more details.
- */
-
-#ifndef DIFFIE_HELLMAN_TEST_H_
-#define DIFFIE_HELLMAN_TEST_H_
-
-#include <utils/tester.h>
-
-/**
- * @brief Test function used to test the diffie_hellman_t functionality.
- *
- * @param tester associated tester object
- * 
- * @ingroup testcases
- */
-void test_diffie_hellman(protected_tester_t *tester);
-
-#endif /*DIFFIE_HELLMAN_TEST_H_*/
diff --git a/Source/charon/testcases/encryption_payload_test.c b/Source/charon/testcases/encryption_payload_test.c
deleted file mode 100644 (file)
index 4557237..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-/**
- * @file encryption_payload_test.c
- * 
- * @brief Tests for the encryption_payload_t class.
- * 
- */
-
-/*
- * Copyright (C) 2005 Jan Hutter, Martin Willi
- * Hochschule fuer Technik Rapperswil
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * for more details.
- */
-#include "encryption_payload_test.h"
-
-#include <daemon.h>
-#include <utils/logger_manager.h>
-#include <utils/allocator.h>
-#include <encoding/generator.h>
-#include <encoding/parser.h>
-#include <encoding/payloads/encryption_payload.h>
-#include <encoding/payloads/nonce_payload.h>
-#include <transforms/crypters/crypter.h>
-#include <transforms/signers/signer.h>
-
-/* 
- * described in Header-File
- */
-void test_encryption_payload(protected_tester_t *tester)
-{
-       encryption_payload_t *encryption_payload;
-       nonce_payload_t *nonce_payload; 
-       crypter_t *crypter;
-       signer_t *signer;
-       chunk_t nonce, got_nonce;
-       chunk_t data;
-       chunk_t key;
-       generator_t *generator;
-       parser_t *parser;
-       status_t status;
-       logger_t *logger;
-       iterator_t *iterator;
-       
-       
-       u_int8_t key_bytes[]  = {
-               0x01,0x01,0x01,0x01,
-               0x01,0x01,0x01,0x01,
-               0x01,0x01,0x01,0x01,
-               0x01,0x01,0x01,0x01
-       };
-       key.ptr = key_bytes;
-       key.len = sizeof(key_bytes);
-       
-       logger = charon->logger_manager->get_logger(charon->logger_manager, TESTER);
-       
-       nonce.ptr = "test text und so...";
-       nonce.len = strlen(nonce.ptr) +1;
-       
-       logger->log_chunk(logger, RAW, "nonce", nonce);
-       
-       encryption_payload = encryption_payload_create();
-       nonce_payload = nonce_payload_create();
-       nonce_payload->set_nonce(nonce_payload, nonce);
-       
-       encryption_payload->add_payload(encryption_payload, (payload_t*)nonce_payload);
-       signer = signer_create(AUTH_HMAC_SHA1_96);
-       crypter = crypter_create(ENCR_AES_CBC, 16);
-       
-       signer->set_key(signer, key);
-       crypter->set_key(crypter, key);
-       
-       
-       
-       /* generating */
-               
-       encryption_payload->set_transforms(encryption_payload, crypter, signer);
-       
-       logger->log(logger, RAW, "encrypt");
-       status = encryption_payload->encrypt(encryption_payload);
-       tester->assert_true(tester, (status == SUCCESS), "encryption");
-       
-       generator = generator_create();
-       generator->generate_payload(generator, (payload_t*)encryption_payload);
-       
-       generator->write_to_chunk(generator, &data);
-       logger->log_chunk(logger, RAW, "generated data", data);
-       
-       encryption_payload->build_signature(encryption_payload, data);
-       logger->log_chunk(logger, RAW, "generated data", data);
-       
-       encryption_payload->destroy(encryption_payload);
-       
-       
-       /* parsing */
-       
-       parser = parser_create(data);
-       status = parser->parse_payload(parser, ENCRYPTED, (payload_t**)&encryption_payload);
-       tester->assert_true(tester, (status == SUCCESS), "parsing");
-       
-       encryption_payload->set_transforms(encryption_payload, crypter, signer);
-       status = encryption_payload->verify_signature(encryption_payload, data);
-       tester->assert_true(tester, (status == SUCCESS), "signature verification");
-       
-       status = encryption_payload->decrypt(encryption_payload);
-       tester->assert_true(tester, (status == SUCCESS), "decryption");
-       
-       
-       iterator = encryption_payload->create_payload_iterator(encryption_payload, TRUE);
-       while (iterator->has_next(iterator))
-       {
-               iterator->current(iterator, (void**)&nonce_payload);
-               got_nonce = nonce_payload->get_nonce(nonce_payload);
-       }
-       iterator->destroy(iterator);
-       
-       
-       tester->assert_true(tester, (got_nonce.len == nonce.len), "decrypted nonce");
-       tester->assert_false(tester, memcmp(nonce.ptr, got_nonce.ptr, nonce.len), "decrypted nonce");
-       
-       logger->log_chunk(logger, RAW, "nonce", got_nonce);
-       
-       allocator_free(data.ptr);
-       allocator_free(got_nonce.ptr);
-       encryption_payload->destroy(encryption_payload);
-       crypter->destroy(crypter);
-       signer->destroy(signer);
-       generator->destroy(generator);
-       parser->destroy(parser);
-}
diff --git a/Source/charon/testcases/encryption_payload_test.h b/Source/charon/testcases/encryption_payload_test.h
deleted file mode 100644 (file)
index 5e6353b..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * @file encryption_payload_test.h
- * 
- * @brief Tests for the encryption_payload_t class.
- * 
- */
-
-/*
- * Copyright (C) 2005 Jan Hutter, Martin Willi
- * Hochschule fuer Technik Rapperswil
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * for more details.
- */
-
-#ifndef ENCRYPTION_PAYLOAD_TEST_H_
-#define ENCRYPTION_PAYLOAD_TEST_H_
-
-#include <utils/tester.h>
-
-/**
- * @brief Test function used to test the encryption_payload_t functionality.
- *
- * @param tester associated tester object
- * 
- * @ingroup testcases
- */
-void test_encryption_payload(protected_tester_t *tester);
-
-#endif /*ENCRYPTION_PAYLOAD_TEST_H_*/
diff --git a/Source/charon/testcases/event_queue_test.c b/Source/charon/testcases/event_queue_test.c
deleted file mode 100644 (file)
index 5366dca..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-/**
- * @file event_queue_test.h
- *
- * @brief Tests for the event_queue_t class.
- *
- */
-
-/*
- * Copyright (C) 2005 Jan Hutter, Martin Willi
- * Hochschule fuer Technik Rapperswil
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * for more details.
- */
-
-#include <stdlib.h>
-#include <pthread.h>
-
-#include "event_queue_test.h"
-
-#include <utils/allocator.h>
-#include <queues/event_queue.h>
-#include <queues/jobs/initiate_ike_sa_job.h>
-
-/**
- * Number of different times to insert per thread
- */
-#define EVENT_QUEUE_TIMES 5
-/**
- * Number of entries per time per thread
- */
-#define EVENT_QUEUE_ENTRY_PER_TIME 20
-
-/**
- * Number of test-thread
- */
-#define EVENT_QUEUE_INSERT_THREADS 1
-
-/**
- * @brief Informations for the involved test-thread used in this test
- *
- */
-typedef struct event_queue_test_s event_queue_test_t;
-
-struct event_queue_test_s{
-       protected_tester_t *tester;
-       event_queue_t *event_queue;
-
-       /**
-        * number of different event times to be inserted in the event-queue by each thread
-        */
-       int insert_times_count;
-
-       /**
-        * number of event to insert at one time
-        */
-       int entries_per_time;
-};
-
-
-static void event_queue_insert_thread(event_queue_test_t * testinfos)
-{
-       timeval_t current_time;
-       timeval_t time;
-       job_t * job;
-       int i,j;
-       connection_t *connection;
-
-       gettimeofday(&current_time,NULL);
-       for (i = 0; i < testinfos->insert_times_count;i++)
-       {
-
-               for (j = 0; j < testinfos->entries_per_time;j++)
-               {
-                       job = (job_t *) initiate_ike_sa_job_create(connection);
-                       time.tv_usec = 0;
-                       time.tv_sec = current_time.tv_sec + i;
-
-                       testinfos->event_queue->add_absolute(testinfos->event_queue,job,time);
-               }
-       }
-}
-
-
-void test_event_queue(protected_tester_t *tester)
-{
-       event_queue_t * event_queue = event_queue_create();
-       event_queue_test_t testinfos;
-       pthread_t threads[EVENT_QUEUE_INSERT_THREADS];
-       int i,j, number_of_total_events;
-       timeval_t current_time, start_time;
-
-       testinfos.tester = tester;
-       testinfos.event_queue = event_queue;
-       testinfos.insert_times_count = EVENT_QUEUE_TIMES;
-       testinfos.entries_per_time = EVENT_QUEUE_ENTRY_PER_TIME;
-
-       number_of_total_events = EVENT_QUEUE_ENTRY_PER_TIME * EVENT_QUEUE_TIMES * EVENT_QUEUE_INSERT_THREADS;
-
-       gettimeofday(&start_time,NULL);
-
-       for (i = 0; i < EVENT_QUEUE_INSERT_THREADS; i++)
-       {
-               int retval;
-               retval = pthread_create( &(threads[i]), NULL,(void*(*)(void*)) &event_queue_insert_thread, (void*) &testinfos);
-               tester->assert_true(tester,(retval== 0), "thread creation call check");
-       }
-
-
-       /* wait for all threads */
-       for (i = 0; i < EVENT_QUEUE_INSERT_THREADS; i++)
-       {
-               int retval;
-               retval = pthread_join(threads[i], NULL);
-               tester->assert_true(tester,(retval== 0), "thread creation call check");
-
-       }               
-
-       tester->assert_true(tester,(event_queue->get_count(event_queue) == number_of_total_events), "event count check");
-
-       for (i = 0; i < EVENT_QUEUE_TIMES;i++)
-       {
-               for (j = 0; j < (EVENT_QUEUE_ENTRY_PER_TIME * EVENT_QUEUE_INSERT_THREADS);j++)
-               {
-                       job_t *job;
-               
-                       job = event_queue->get(event_queue);
-                       gettimeofday(&current_time,NULL);
-                       tester->assert_true(tester,((current_time.tv_sec - start_time.tv_sec) == i), "value of entry check");
-                       job->destroy(job);
-               }
-       }
-
-
-       event_queue->destroy(event_queue);
-       return;
-}
diff --git a/Source/charon/testcases/event_queue_test.h b/Source/charon/testcases/event_queue_test.h
deleted file mode 100644 (file)
index 5f8c47f..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * @file event_queue_test.h
- * 
- * @brief Tests to test the Event-Queue type event_queue_t
- * 
- */
-
-/*
- * Copyright (C) 2005 Jan Hutter, Martin Willi
- * Hochschule fuer Technik Rapperswil
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * for more details.
- */
-#ifndef EVENT_QUEUE_TEST_H_
-#define EVENT_QUEUE_TEST_H_
-
-#include <utils/tester.h>
-
-/**
- * @brief Test function used to test the event_queue functionality.
- * 
- * Tests are performed using one thread.
- *
- * @param tester associated tester object
- * 
- * @ingroup testcases
- */
-void test_event_queue(protected_tester_t *tester);
-
-#endif /*EVENT_QUEUE_TEST_H_*/
diff --git a/Source/charon/testcases/generator_test.c b/Source/charon/testcases/generator_test.c
deleted file mode 100644 (file)
index c611a3e..0000000
+++ /dev/null
@@ -1,1411 +0,0 @@
-/**
- * @file generator_test.c
- * 
- * @brief Tests for the generator_t class.
- * 
- */
-
-/*
- * Copyright (C) 2005 Jan Hutter, Martin Willi
- * Hochschule fuer Technik Rapperswil
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * for more details.
- */
-#include <string.h>
-
-#include "generator_test.h"
-
-#include <daemon.h>
-#include <encoding/generator.h>
-#include <utils/allocator.h>
-#include <utils/logger_manager.h>
-#include <utils/logger.h>
-#include <encoding/payloads/encodings.h>
-#include <encoding/payloads/ike_header.h>
-#include <encoding/payloads/transform_attribute.h>
-#include <encoding/payloads/transform_substructure.h>
-#include <encoding/payloads/proposal_substructure.h>
-#include <encoding/payloads/sa_payload.h>
-#include <encoding/payloads/ke_payload.h>
-#include <encoding/payloads/notify_payload.h>
-#include <encoding/payloads/nonce_payload.h>
-#include <encoding/payloads/id_payload.h>
-#include <encoding/payloads/auth_payload.h>
-#include <encoding/payloads/cert_payload.h>
-#include <encoding/payloads/certreq_payload.h>
-#include <encoding/payloads/ts_payload.h>
-#include <encoding/payloads/delete_payload.h>
-#include <encoding/payloads/vendor_id_payload.h>
-#include <encoding/payloads/cp_payload.h>
-#include <encoding/payloads/eap_payload.h>
-
-/*
- * Described in Header 
- */
-void test_generator_with_header_payload(protected_tester_t *tester)
-{
-       generator_t *generator;
-       ike_header_t *header_data;
-       chunk_t generated_data;
-       logger_t *logger;
-       
-       logger = charon->logger_manager->get_logger(charon->logger_manager, TESTER);
-       
-       header_data = ike_header_create();
-       header_data->set_initiator_spi(header_data,1);
-       header_data->set_responder_spi(header_data,2);
-       ((payload_t *) header_data)->set_next_type((payload_t *) header_data, 3);
-       header_data->set_exchange_type(header_data, 6);
-       header_data->set_initiator_flag(header_data, TRUE);
-       header_data->set_response_flag(header_data, TRUE);
-       header_data->set_message_id(header_data,7);
-
-       generator = generator_create();
-       tester->assert_true(tester,(generator != NULL), "generator create check");
-       
-       generator->generate_payload(generator,(payload_t *) header_data);
-
-       generator->write_to_chunk(generator,&generated_data);
-
-       u_int8_t expected_generation[] = {
-               0x01,0x00,0x00,0x00,
-               0x00,0x00,0x00,0x00,
-               0x02,0x00,0x00,0x00,
-               0x00,0x00,0x00,0x00,
-               0x03,0x20,0x06,0x28,
-               0x00,0x00,0x00,0x07,
-               0x00,0x00,0x00,0x1C,
-       };
-
-       logger->log_bytes(logger,RAW,"expected header",expected_generation,sizeof(expected_generation));
-       tester->assert_true(tester,(generated_data.len == sizeof(expected_generation)), "compare generated data length");
-       logger->log_chunk(logger,RAW,"generated header",generated_data);                
-       tester->assert_true(tester,(memcmp(expected_generation,generated_data.ptr,sizeof(expected_generation)) == 0), "compare generated data 1");
-       allocator_free_chunk(&generated_data);
-       
-       generator->destroy(generator);
-
-       header_data->set_initiator_spi(header_data,0x22000054231234LL);
-       header_data->set_responder_spi(header_data,0x122398);
-       ((payload_t *) header_data)->set_next_type((payload_t *) header_data,0xF3);
-       header_data->set_exchange_type(header_data, 0x12);
-       header_data->set_initiator_flag(header_data, TRUE);
-       header_data->set_response_flag(header_data, TRUE);
-       header_data->set_message_id(header_data,0x33AFF3);
-
-       generator = generator_create();
-       tester->assert_true(tester,(generator != NULL), "generator create check");
-       
-       generator->generate_payload(generator,(payload_t *)header_data);
-       
-       generator->write_to_chunk(generator,&generated_data);
-
-       u_int8_t expected_generation2[] = {
-               0x34,0x12,0x23,0x54,
-               0x00,0x00,0x22,0x00,
-               0x98,0x23,0x12,0x00,
-               0x00,0x00,0x00,0x00,
-               0xF3,0x20,0x12,0x28,
-               0x00,0x33,0xAF,0xF3,
-               0x00,0x00,0x00,0x1C,
-       };
-
-       
-       logger->log_bytes(logger,RAW,"expected header",expected_generation2,sizeof(expected_generation2));
-       
-       logger->log_chunk(logger,RAW,"generated header",generated_data);
-
-       tester->assert_true(tester,(memcmp(expected_generation2,generated_data.ptr,sizeof(expected_generation2)) == 0), "compare generated data 2");
-       allocator_free_chunk(&generated_data);
-
-       header_data->destroy(header_data);
-       
-       generator->destroy(generator);
-}
-
-/*
- * Described in header
- */ 
-void test_generator_with_transform_attribute(protected_tester_t *tester)
-{
-       generator_t *generator;
-       transform_attribute_t *attribute;
-       chunk_t generated_data;
-       logger_t *logger;
-       
-       logger = charon->logger_manager->get_logger(charon->logger_manager, TESTER);
-       
-       
-       /* test empty attribute */
-       generator = generator_create();
-       tester->assert_true(tester,(generator != NULL), "generator create check");
-       attribute = transform_attribute_create();
-       generator->generate_payload(generator,(payload_t *)attribute);
-       generator->write_to_chunk(generator,&generated_data);
-       logger->log_chunk(logger,RAW,"generated attribute",generated_data);     
-
-       u_int8_t expected_generation[] = {
-               0x80,0x00,0x00,0x00,
-       };
-       tester->assert_true(tester,(memcmp(expected_generation,generated_data.ptr,sizeof(expected_generation)) == 0), "compare generated data");
-       allocator_free_chunk(&generated_data);
-       attribute->destroy(attribute);
-       generator->destroy(generator);
-       
-       /* test attribute with 2 byte data */   
-       generator = generator_create();
-       tester->assert_true(tester,(generator != NULL), "generator create check");
-       
-       attribute = transform_attribute_create();
-       u_int16_t dataval = 5768;
-       chunk_t data;
-       data.ptr = (void *) &dataval;
-       data.len = 2;
-               
-       attribute->set_value_chunk(attribute,data);
-       
-       generator->generate_payload(generator,(payload_t *)attribute);
-       generator->write_to_chunk(generator,&generated_data);
-       logger->log_chunk(logger,RAW,"generated attribute",generated_data);     
-
-       u_int8_t expected_generation2[] = {
-               0x80,0x00,0x16,0x88,
-       };
-       tester->assert_true(tester,(memcmp(expected_generation2,generated_data.ptr,sizeof(expected_generation2)) == 0), "compare generated data");
-
-       allocator_free_chunk(&generated_data);
-       attribute->destroy(attribute);
-       generator->destroy(generator);
-
-
-
-       /* test attribute with 25 byte data */
-               generator = generator_create();
-       tester->assert_true(tester,(generator != NULL), "generator create check");
-       
-       attribute = transform_attribute_create();
-       char *stringval = "ddddddddddeeeeeeeeeefffff";
-       data.ptr = (void *) stringval;
-       data.len = 25;
-               
-       attribute->set_value_chunk(attribute,data);
-       
-       attribute->set_attribute_type(attribute,456);
-
-
-       generator->generate_payload(generator,(payload_t *)attribute);
-       generator->write_to_chunk(generator,&generated_data);
-       logger->log_chunk(logger,RAW,"generated attribute",generated_data);     
-
-       u_int8_t expected_generation3[] = {
-               0x01,0xC8,0x00,0x19,
-               0x64,0x64,0x64,0x64,
-               0x64,0x64,0x64,0x64,
-               0x64,0x64,0x65,0x65,
-               0x65,0x65,0x65,0x65,
-               0x65,0x65,0x65,0x65,
-               0x66,0x66,0x66,0x66,
-               0x66
-       };
-       tester->assert_true(tester,(memcmp(expected_generation3,generated_data.ptr,sizeof(expected_generation3)) == 0), "compare generated data");
-
-       allocator_free_chunk(&generated_data);
-      &