removed trailing spaces ([[:space:]]+$)
authorMartin Willi <martin@strongswan.org>
Fri, 4 Sep 2009 11:46:09 +0000 (13:46 +0200)
committerMartin Willi <martin@strongswan.org>
Fri, 4 Sep 2009 11:46:09 +0000 (13:46 +0200)
703 files changed:
scripts/bin2array.c
scripts/bin2sql.c
scripts/dh_speed.c
scripts/id2sql.c
scripts/key2keyid.c
scripts/keyid2sql.c
scripts/pubkey_speed.c
scripts/thread_analysis.c
src/_copyright/_copyright.c
src/charon/bus/bus.c
src/charon/bus/bus.h
src/charon/bus/listeners/file_logger.c
src/charon/bus/listeners/file_logger.h
src/charon/bus/listeners/listener.h
src/charon/bus/listeners/sys_logger.c
src/charon/bus/listeners/sys_logger.h
src/charon/config/attributes/attribute_handler.h
src/charon/config/attributes/attribute_manager.c
src/charon/config/attributes/attribute_manager.h
src/charon/config/attributes/attribute_provider.h
src/charon/config/auth_cfg.c
src/charon/config/auth_cfg.h
src/charon/config/backend_manager.c
src/charon/config/backend_manager.h
src/charon/config/child_cfg.c
src/charon/config/child_cfg.h
src/charon/config/ike_cfg.c
src/charon/config/ike_cfg.h
src/charon/config/peer_cfg.c
src/charon/config/peer_cfg.h
src/charon/config/proposal.c
src/charon/config/proposal.h
src/charon/config/traffic_selector.c
src/charon/config/traffic_selector.h
src/charon/control/controller.c
src/charon/control/controller.h
src/charon/credentials/credential_manager.c
src/charon/credentials/credential_manager.h
src/charon/credentials/credential_set.h
src/charon/credentials/sets/auth_cfg_wrapper.c
src/charon/credentials/sets/auth_cfg_wrapper.h
src/charon/credentials/sets/cert_cache.c
src/charon/credentials/sets/cert_cache.h
src/charon/credentials/sets/ocsp_response_wrapper.c
src/charon/credentials/sets/ocsp_response_wrapper.h
src/charon/daemon.c
src/charon/daemon.h
src/charon/encoding/generator.c
src/charon/encoding/generator.h
src/charon/encoding/message.c
src/charon/encoding/message.h
src/charon/encoding/parser.c
src/charon/encoding/parser.h
src/charon/encoding/payloads/auth_payload.c
src/charon/encoding/payloads/auth_payload.h
src/charon/encoding/payloads/cert_payload.c
src/charon/encoding/payloads/cert_payload.h
src/charon/encoding/payloads/certreq_payload.c
src/charon/encoding/payloads/certreq_payload.h
src/charon/encoding/payloads/configuration_attribute.c
src/charon/encoding/payloads/configuration_attribute.h
src/charon/encoding/payloads/cp_payload.c
src/charon/encoding/payloads/cp_payload.h
src/charon/encoding/payloads/delete_payload.c
src/charon/encoding/payloads/delete_payload.h
src/charon/encoding/payloads/eap_payload.c
src/charon/encoding/payloads/eap_payload.h
src/charon/encoding/payloads/encodings.h
src/charon/encoding/payloads/encryption_payload.c
src/charon/encoding/payloads/encryption_payload.h
src/charon/encoding/payloads/endpoint_notify.c
src/charon/encoding/payloads/endpoint_notify.h
src/charon/encoding/payloads/id_payload.c
src/charon/encoding/payloads/id_payload.h
src/charon/encoding/payloads/ike_header.c
src/charon/encoding/payloads/ike_header.h
src/charon/encoding/payloads/ke_payload.c
src/charon/encoding/payloads/ke_payload.h
src/charon/encoding/payloads/nonce_payload.c
src/charon/encoding/payloads/nonce_payload.h
src/charon/encoding/payloads/notify_payload.c
src/charon/encoding/payloads/notify_payload.h
src/charon/encoding/payloads/payload.h
src/charon/encoding/payloads/proposal_substructure.c
src/charon/encoding/payloads/proposal_substructure.h
src/charon/encoding/payloads/sa_payload.c
src/charon/encoding/payloads/sa_payload.h
src/charon/encoding/payloads/traffic_selector_substructure.c
src/charon/encoding/payloads/traffic_selector_substructure.h
src/charon/encoding/payloads/transform_attribute.c
src/charon/encoding/payloads/transform_attribute.h
src/charon/encoding/payloads/transform_substructure.c
src/charon/encoding/payloads/transform_substructure.h
src/charon/encoding/payloads/ts_payload.c
src/charon/encoding/payloads/ts_payload.h
src/charon/encoding/payloads/unknown_payload.c
src/charon/encoding/payloads/unknown_payload.h
src/charon/encoding/payloads/vendor_id_payload.c
src/charon/encoding/payloads/vendor_id_payload.h
src/charon/kernel/kernel_interface.c
src/charon/kernel/kernel_interface.h
src/charon/kernel/kernel_ipsec.h
src/charon/kernel/kernel_net.h
src/charon/network/packet.c
src/charon/network/packet.h
src/charon/network/receiver.c
src/charon/network/receiver.h
src/charon/network/sender.c
src/charon/network/sender.h
src/charon/network/socket-raw.c
src/charon/network/socket.c
src/charon/network/socket.h
src/charon/plugins/attr/attr_plugin.c
src/charon/plugins/attr/attr_plugin.h
src/charon/plugins/attr/attr_provider.c
src/charon/plugins/attr/attr_provider.h
src/charon/plugins/eap_aka/eap_aka.c
src/charon/plugins/eap_aka/eap_aka_plugin.c
src/charon/plugins/eap_gtc/eap_gtc.c
src/charon/plugins/eap_gtc/eap_gtc_plugin.c
src/charon/plugins/eap_identity/eap_identity.c
src/charon/plugins/eap_identity/eap_identity_plugin.c
src/charon/plugins/eap_md5/eap_md5.c
src/charon/plugins/eap_md5/eap_md5_plugin.c
src/charon/plugins/eap_mschapv2/eap_mschapv2.c
src/charon/plugins/eap_mschapv2/eap_mschapv2_plugin.c
src/charon/plugins/eap_radius/eap_radius.c
src/charon/plugins/eap_radius/eap_radius_plugin.c
src/charon/plugins/eap_radius/radius_client.c
src/charon/plugins/eap_radius/radius_client.h
src/charon/plugins/eap_radius/radius_message.c
src/charon/plugins/eap_radius/radius_message.h
src/charon/plugins/eap_sim/eap_sim.c
src/charon/plugins/eap_sim/eap_sim_plugin.c
src/charon/plugins/eap_sim_file/eap_sim_file_card.c
src/charon/plugins/eap_sim_file/eap_sim_file_card.h
src/charon/plugins/eap_sim_file/eap_sim_file_plugin.c
src/charon/plugins/eap_sim_file/eap_sim_file_provider.c
src/charon/plugins/eap_sim_file/eap_sim_file_provider.h
src/charon/plugins/eap_sim_file/eap_sim_file_triplets.c
src/charon/plugins/kernel_klips/kernel_klips_ipsec.c
src/charon/plugins/kernel_klips/kernel_klips_plugin.c
src/charon/plugins/kernel_klips/pfkeyv2.h
src/charon/plugins/kernel_netlink/kernel_netlink_ipsec.c
src/charon/plugins/kernel_netlink/kernel_netlink_net.c
src/charon/plugins/kernel_netlink/kernel_netlink_plugin.c
src/charon/plugins/kernel_netlink/kernel_netlink_shared.c
src/charon/plugins/kernel_netlink/kernel_netlink_shared.h
src/charon/plugins/kernel_pfkey/kernel_pfkey_ipsec.c
src/charon/plugins/kernel_pfkey/kernel_pfkey_plugin.c
src/charon/plugins/kernel_pfroute/kernel_pfroute_net.c
src/charon/plugins/kernel_pfroute/kernel_pfroute_plugin.c
src/charon/plugins/load_tester/load_tester_config.c
src/charon/plugins/load_tester/load_tester_config.h
src/charon/plugins/load_tester/load_tester_creds.c
src/charon/plugins/load_tester/load_tester_creds.h
src/charon/plugins/load_tester/load_tester_diffie_hellman.c
src/charon/plugins/load_tester/load_tester_diffie_hellman.h
src/charon/plugins/load_tester/load_tester_ipsec.c
src/charon/plugins/load_tester/load_tester_listener.c
src/charon/plugins/load_tester/load_tester_listener.h
src/charon/plugins/load_tester/load_tester_plugin.c
src/charon/plugins/load_tester/load_tester_plugin.h
src/charon/plugins/medcli/medcli_config.c
src/charon/plugins/medcli/medcli_config.h
src/charon/plugins/medcli/medcli_creds.c
src/charon/plugins/medcli/medcli_creds.h
src/charon/plugins/medcli/medcli_listener.c
src/charon/plugins/medcli/medcli_listener.h
src/charon/plugins/medcli/medcli_plugin.c
src/charon/plugins/medsrv/medsrv_config.c
src/charon/plugins/medsrv/medsrv_config.h
src/charon/plugins/medsrv/medsrv_creds.c
src/charon/plugins/medsrv/medsrv_creds.h
src/charon/plugins/medsrv/medsrv_plugin.c
src/charon/plugins/nm/gnome/auth-dialog/main.c
src/charon/plugins/nm/gnome/properties/nm-strongswan.c
src/charon/plugins/nm/gnome/properties/nm-strongswan.h
src/charon/plugins/nm/nm_creds.c
src/charon/plugins/nm/nm_creds.h
src/charon/plugins/nm/nm_handler.c
src/charon/plugins/nm/nm_handler.h
src/charon/plugins/nm/nm_plugin.c
src/charon/plugins/nm/nm_service.c
src/charon/plugins/resolv_conf/resolv_conf_handler.c
src/charon/plugins/resolv_conf/resolv_conf_handler.h
src/charon/plugins/resolv_conf/resolv_conf_plugin.c
src/charon/plugins/resolv_conf/resolv_conf_plugin.h
src/charon/plugins/smp/smp.c
src/charon/plugins/sql/pool.c
src/charon/plugins/sql/sql_attribute.c
src/charon/plugins/sql/sql_attribute.h
src/charon/plugins/sql/sql_config.c
src/charon/plugins/sql/sql_config.h
src/charon/plugins/sql/sql_cred.c
src/charon/plugins/sql/sql_cred.h
src/charon/plugins/sql/sql_logger.c
src/charon/plugins/sql/sql_logger.h
src/charon/plugins/sql/sql_plugin.c
src/charon/plugins/stroke/stroke_attribute.c
src/charon/plugins/stroke/stroke_attribute.h
src/charon/plugins/stroke/stroke_ca.c
src/charon/plugins/stroke/stroke_ca.h
src/charon/plugins/stroke/stroke_config.c
src/charon/plugins/stroke/stroke_config.h
src/charon/plugins/stroke/stroke_control.c
src/charon/plugins/stroke/stroke_control.h
src/charon/plugins/stroke/stroke_cred.c
src/charon/plugins/stroke/stroke_cred.h
src/charon/plugins/stroke/stroke_list.c
src/charon/plugins/stroke/stroke_list.h
src/charon/plugins/stroke/stroke_plugin.c
src/charon/plugins/stroke/stroke_plugin.h
src/charon/plugins/stroke/stroke_shared_key.c
src/charon/plugins/stroke/stroke_shared_key.h
src/charon/plugins/stroke/stroke_socket.c
src/charon/plugins/stroke/stroke_socket.h
src/charon/plugins/uci/uci_config.c
src/charon/plugins/uci/uci_config.h
src/charon/plugins/uci/uci_control.c
src/charon/plugins/uci/uci_control.h
src/charon/plugins/uci/uci_creds.c
src/charon/plugins/uci/uci_creds.h
src/charon/plugins/uci/uci_parser.c
src/charon/plugins/uci/uci_parser.h
src/charon/plugins/uci/uci_plugin.c
src/charon/plugins/unit_tester/tests.h
src/charon/plugins/unit_tester/tests/test_agent.c
src/charon/plugins/unit_tester/tests/test_auth_info.c
src/charon/plugins/unit_tester/tests/test_cert.c
src/charon/plugins/unit_tester/tests/test_chunk.c
src/charon/plugins/unit_tester/tests/test_curl.c
src/charon/plugins/unit_tester/tests/test_enumerator.c
src/charon/plugins/unit_tester/tests/test_id.c
src/charon/plugins/unit_tester/tests/test_med_db.c
src/charon/plugins/unit_tester/tests/test_mutex.c
src/charon/plugins/unit_tester/tests/test_mysql.c
src/charon/plugins/unit_tester/tests/test_pool.c
src/charon/plugins/unit_tester/tests/test_rsa_gen.c
src/charon/plugins/unit_tester/tests/test_sqlite.c
src/charon/plugins/unit_tester/unit_tester.c
src/charon/plugins/unit_tester/unit_tester.h
src/charon/plugins/updown/updown_listener.c
src/charon/plugins/updown/updown_listener.h
src/charon/plugins/updown/updown_plugin.c
src/charon/processing/jobs/acquire_job.c
src/charon/processing/jobs/acquire_job.h
src/charon/processing/jobs/callback_job.c
src/charon/processing/jobs/callback_job.h
src/charon/processing/jobs/delete_child_sa_job.c
src/charon/processing/jobs/delete_child_sa_job.h
src/charon/processing/jobs/delete_ike_sa_job.c
src/charon/processing/jobs/delete_ike_sa_job.h
src/charon/processing/jobs/initiate_mediation_job.c
src/charon/processing/jobs/initiate_mediation_job.h
src/charon/processing/jobs/job.h
src/charon/processing/jobs/mediation_job.c
src/charon/processing/jobs/mediation_job.h
src/charon/processing/jobs/migrate_job.c
src/charon/processing/jobs/migrate_job.h
src/charon/processing/jobs/process_message_job.c
src/charon/processing/jobs/process_message_job.h
src/charon/processing/jobs/rekey_child_sa_job.c
src/charon/processing/jobs/rekey_child_sa_job.h
src/charon/processing/jobs/rekey_ike_sa_job.c
src/charon/processing/jobs/rekey_ike_sa_job.h
src/charon/processing/jobs/retransmit_job.c
src/charon/processing/jobs/retransmit_job.h
src/charon/processing/jobs/roam_job.c
src/charon/processing/jobs/roam_job.h
src/charon/processing/jobs/send_dpd_job.c
src/charon/processing/jobs/send_dpd_job.h
src/charon/processing/jobs/send_keepalive_job.c
src/charon/processing/jobs/send_keepalive_job.h
src/charon/processing/jobs/update_sa_job.c
src/charon/processing/jobs/update_sa_job.h
src/charon/processing/processor.c
src/charon/processing/processor.h
src/charon/processing/scheduler.c
src/charon/processing/scheduler.h
src/charon/sa/authenticators/authenticator.c
src/charon/sa/authenticators/authenticator.h
src/charon/sa/authenticators/eap/eap_manager.c
src/charon/sa/authenticators/eap/eap_manager.h
src/charon/sa/authenticators/eap/eap_method.c
src/charon/sa/authenticators/eap/eap_method.h
src/charon/sa/authenticators/eap/sim_manager.c
src/charon/sa/authenticators/eap/sim_manager.h
src/charon/sa/authenticators/eap_authenticator.c
src/charon/sa/authenticators/eap_authenticator.h
src/charon/sa/authenticators/psk_authenticator.c
src/charon/sa/authenticators/psk_authenticator.h
src/charon/sa/authenticators/pubkey_authenticator.c
src/charon/sa/authenticators/pubkey_authenticator.h
src/charon/sa/child_sa.c
src/charon/sa/child_sa.h
src/charon/sa/connect_manager.c
src/charon/sa/connect_manager.h
src/charon/sa/ike_sa.c
src/charon/sa/ike_sa.h
src/charon/sa/ike_sa_id.h
src/charon/sa/ike_sa_manager.c
src/charon/sa/ike_sa_manager.h
src/charon/sa/keymat.c
src/charon/sa/keymat.h
src/charon/sa/mediation_manager.c
src/charon/sa/mediation_manager.h
src/charon/sa/task_manager.c
src/charon/sa/task_manager.h
src/charon/sa/tasks/child_create.c
src/charon/sa/tasks/child_create.h
src/charon/sa/tasks/child_delete.c
src/charon/sa/tasks/child_delete.h
src/charon/sa/tasks/child_rekey.c
src/charon/sa/tasks/child_rekey.h
src/charon/sa/tasks/ike_auth.c
src/charon/sa/tasks/ike_auth_lifetime.c
src/charon/sa/tasks/ike_auth_lifetime.h
src/charon/sa/tasks/ike_cert_post.c
src/charon/sa/tasks/ike_cert_pre.c
src/charon/sa/tasks/ike_config.c
src/charon/sa/tasks/ike_delete.c
src/charon/sa/tasks/ike_dpd.c
src/charon/sa/tasks/ike_init.c
src/charon/sa/tasks/ike_init.h
src/charon/sa/tasks/ike_me.c
src/charon/sa/tasks/ike_me.h
src/charon/sa/tasks/ike_mobike.c
src/charon/sa/tasks/ike_mobike.h
src/charon/sa/tasks/ike_natd.c
src/charon/sa/tasks/ike_natd.h
src/charon/sa/tasks/ike_reauth.c
src/charon/sa/tasks/ike_rekey.c
src/charon/sa/tasks/ike_rekey.h
src/charon/sa/tasks/task.h
src/charon/sa/trap_manager.c
src/charon/sa/trap_manager.h
src/checksum/checksum_builder.c
src/dumm/bridge.c
src/dumm/bridge.h
src/dumm/cowfs.c
src/dumm/cowfs.h
src/dumm/dumm.c
src/dumm/dumm.h
src/dumm/ext/dumm.c
src/dumm/guest.c
src/dumm/guest.h
src/dumm/iface.c
src/dumm/iface.h
src/dumm/irdumm.c
src/dumm/main.c
src/dumm/mconsole.c
src/dumm/mconsole.h
src/include/linux/netlink.h
src/include/linux/rtnetlink.h
src/libfast/context.h
src/libfast/controller.h
src/libfast/dispatcher.c
src/libfast/dispatcher.h
src/libfast/filter.h
src/libfast/request.c
src/libfast/request.h
src/libfast/session.c
src/libfast/session.h
src/libfreeswan/addrtoa.c
src/libfreeswan/addrtot.c
src/libfreeswan/addrtypeof.c
src/libfreeswan/anyaddr.c
src/libfreeswan/atoaddr.c
src/libfreeswan/atoasr.c
src/libfreeswan/atosa.c
src/libfreeswan/atosubnet.c
src/libfreeswan/atoul.c
src/libfreeswan/datatot.c
src/libfreeswan/freeswan.h
src/libfreeswan/goodmask.c
src/libfreeswan/initaddr.c
src/libfreeswan/initsaid.c
src/libfreeswan/initsubnet.c
src/libfreeswan/internal.h
src/libfreeswan/ipsec_param.h
src/libfreeswan/keyblobtoid.c
src/libfreeswan/pfkey.h
src/libfreeswan/pfkey_v2_build.c
src/libfreeswan/pfkey_v2_debug.c
src/libfreeswan/pfkey_v2_ext_bits.c
src/libfreeswan/pfkey_v2_parse.c
src/libfreeswan/pfkeyv2.h
src/libfreeswan/portof.c
src/libfreeswan/prng.c
src/libfreeswan/rangetoa.c
src/libfreeswan/rangetosubnet.c
src/libfreeswan/sameaddr.c
src/libfreeswan/satoa.c
src/libfreeswan/satot.c
src/libfreeswan/subnetof.c
src/libfreeswan/subnettoa.c
src/libfreeswan/subnettot.c
src/libfreeswan/subnettypeof.c
src/libfreeswan/ttoaddr.c
src/libfreeswan/ttodata.c
src/libfreeswan/ttoprotoport.c
src/libfreeswan/ttosa.c
src/libfreeswan/ttosubnet.c
src/libfreeswan/ttoul.c
src/libfreeswan/ultoa.c
src/libfreeswan/ultot.c
src/libstrongswan/asn1/asn1.c
src/libstrongswan/asn1/asn1.h
src/libstrongswan/asn1/asn1_parser.c
src/libstrongswan/asn1/asn1_parser.h
src/libstrongswan/chunk.c
src/libstrongswan/chunk.h
src/libstrongswan/credentials/builder.h
src/libstrongswan/credentials/certificates/ac.h
src/libstrongswan/credentials/certificates/certificate.h
src/libstrongswan/credentials/certificates/crl.h
src/libstrongswan/credentials/certificates/ocsp_response.h
src/libstrongswan/credentials/certificates/x509.h
src/libstrongswan/credentials/credential_factory.c
src/libstrongswan/credentials/credential_factory.h
src/libstrongswan/credentials/keys/key_encoding.c
src/libstrongswan/credentials/keys/key_encoding.h
src/libstrongswan/credentials/keys/private_key.c
src/libstrongswan/credentials/keys/private_key.h
src/libstrongswan/credentials/keys/public_key.c
src/libstrongswan/credentials/keys/public_key.h
src/libstrongswan/credentials/keys/shared_key.c
src/libstrongswan/credentials/keys/shared_key.h
src/libstrongswan/crypto/crypters/crypter.h
src/libstrongswan/crypto/crypto_factory.c
src/libstrongswan/crypto/crypto_factory.h
src/libstrongswan/crypto/crypto_tester.c
src/libstrongswan/crypto/crypto_tester.h
src/libstrongswan/crypto/diffie_hellman.h
src/libstrongswan/crypto/hashers/hasher.h
src/libstrongswan/crypto/pkcs7.c
src/libstrongswan/crypto/pkcs7.h
src/libstrongswan/crypto/pkcs9.c
src/libstrongswan/crypto/pkcs9.h
src/libstrongswan/crypto/prf_plus.c
src/libstrongswan/crypto/prf_plus.h
src/libstrongswan/crypto/prfs/prf.h
src/libstrongswan/crypto/proposal/proposal_keywords.h
src/libstrongswan/crypto/rngs/rng.h
src/libstrongswan/crypto/signers/signer.h
src/libstrongswan/database/database.h
src/libstrongswan/database/database_factory.c
src/libstrongswan/database/database_factory.h
src/libstrongswan/debug.c
src/libstrongswan/debug.h
src/libstrongswan/enum.h
src/libstrongswan/fetcher/fetcher.h
src/libstrongswan/fetcher/fetcher_manager.c
src/libstrongswan/fetcher/fetcher_manager.h
src/libstrongswan/integrity_checker.c
src/libstrongswan/integrity_checker.h
src/libstrongswan/library.c
src/libstrongswan/library.h
src/libstrongswan/plugins/aes/aes_crypter.c
src/libstrongswan/plugins/aes/aes_crypter.h
src/libstrongswan/plugins/aes/aes_plugin.c
src/libstrongswan/plugins/agent/agent_plugin.c
src/libstrongswan/plugins/agent/agent_plugin.h
src/libstrongswan/plugins/agent/agent_private_key.c
src/libstrongswan/plugins/blowfish/bf_enc.c
src/libstrongswan/plugins/blowfish/bf_locl.h
src/libstrongswan/plugins/blowfish/bf_pi.h
src/libstrongswan/plugins/blowfish/bf_skey.c
src/libstrongswan/plugins/blowfish/blowfish.h
src/libstrongswan/plugins/blowfish/blowfish_crypter.c
src/libstrongswan/plugins/blowfish/blowfish_crypter.h
src/libstrongswan/plugins/blowfish/blowfish_plugin.c
src/libstrongswan/plugins/curl/curl_fetcher.c
src/libstrongswan/plugins/curl/curl_fetcher.h
src/libstrongswan/plugins/curl/curl_plugin.c
src/libstrongswan/plugins/des/des_crypter.c
src/libstrongswan/plugins/des/des_crypter.h
src/libstrongswan/plugins/des/des_plugin.c
src/libstrongswan/plugins/dnskey/dnskey_builder.c
src/libstrongswan/plugins/dnskey/dnskey_plugin.c
src/libstrongswan/plugins/fips_prf/fips_prf.c
src/libstrongswan/plugins/fips_prf/fips_prf.h
src/libstrongswan/plugins/fips_prf/fips_prf_plugin.c
src/libstrongswan/plugins/gcrypt/gcrypt_crypter.c
src/libstrongswan/plugins/gcrypt/gcrypt_crypter.h
src/libstrongswan/plugins/gcrypt/gcrypt_dh.c
src/libstrongswan/plugins/gcrypt/gcrypt_dh.h
src/libstrongswan/plugins/gcrypt/gcrypt_hasher.c
src/libstrongswan/plugins/gcrypt/gcrypt_hasher.h
src/libstrongswan/plugins/gcrypt/gcrypt_plugin.c
src/libstrongswan/plugins/gcrypt/gcrypt_rng.c
src/libstrongswan/plugins/gcrypt/gcrypt_rng.h
src/libstrongswan/plugins/gcrypt/gcrypt_rsa_private_key.c
src/libstrongswan/plugins/gcrypt/gcrypt_rsa_private_key.h
src/libstrongswan/plugins/gcrypt/gcrypt_rsa_public_key.c
src/libstrongswan/plugins/gmp/gmp_diffie_hellman.c
src/libstrongswan/plugins/gmp/gmp_diffie_hellman.h
src/libstrongswan/plugins/gmp/gmp_plugin.c
src/libstrongswan/plugins/gmp/gmp_plugin.h
src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c
src/libstrongswan/plugins/gmp/gmp_rsa_public_key.c
src/libstrongswan/plugins/hmac/hmac.c
src/libstrongswan/plugins/hmac/hmac.h
src/libstrongswan/plugins/hmac/hmac_plugin.c
src/libstrongswan/plugins/hmac/hmac_prf.c
src/libstrongswan/plugins/hmac/hmac_prf.h
src/libstrongswan/plugins/hmac/hmac_signer.c
src/libstrongswan/plugins/hmac/hmac_signer.h
src/libstrongswan/plugins/ldap/ldap_fetcher.c
src/libstrongswan/plugins/ldap/ldap_plugin.c
src/libstrongswan/plugins/md4/md4_hasher.c
src/libstrongswan/plugins/md4/md4_hasher.h
src/libstrongswan/plugins/md4/md4_plugin.c
src/libstrongswan/plugins/md5/md5_hasher.c
src/libstrongswan/plugins/md5/md5_hasher.h
src/libstrongswan/plugins/md5/md5_plugin.c
src/libstrongswan/plugins/mysql/mysql_database.c
src/libstrongswan/plugins/mysql/mysql_plugin.c
src/libstrongswan/plugins/openssl/openssl_crypter.c
src/libstrongswan/plugins/openssl/openssl_crypter.h
src/libstrongswan/plugins/openssl/openssl_diffie_hellman.c
src/libstrongswan/plugins/openssl/openssl_diffie_hellman.h
src/libstrongswan/plugins/openssl/openssl_ec_diffie_hellman.c
src/libstrongswan/plugins/openssl/openssl_ec_diffie_hellman.h
src/libstrongswan/plugins/openssl/openssl_ec_private_key.c
src/libstrongswan/plugins/openssl/openssl_ec_public_key.c
src/libstrongswan/plugins/openssl/openssl_hasher.c
src/libstrongswan/plugins/openssl/openssl_hasher.h
src/libstrongswan/plugins/openssl/openssl_plugin.c
src/libstrongswan/plugins/openssl/openssl_rsa_private_key.c
src/libstrongswan/plugins/openssl/openssl_rsa_public_key.c
src/libstrongswan/plugins/openssl/openssl_util.c
src/libstrongswan/plugins/openssl/openssl_util.h
src/libstrongswan/plugins/padlock/padlock_aes_crypter.c
src/libstrongswan/plugins/padlock/padlock_aes_crypter.h
src/libstrongswan/plugins/padlock/padlock_plugin.c
src/libstrongswan/plugins/padlock/padlock_rng.c
src/libstrongswan/plugins/padlock/padlock_rng.h
src/libstrongswan/plugins/padlock/padlock_sha1_hasher.c
src/libstrongswan/plugins/padlock/padlock_sha1_hasher.h
src/libstrongswan/plugins/pem/pem_builder.c
src/libstrongswan/plugins/pem/pem_plugin.c
src/libstrongswan/plugins/pem/pem_plugin.h
src/libstrongswan/plugins/pgp/pgp_builder.c
src/libstrongswan/plugins/pgp/pgp_encoder.c
src/libstrongswan/plugins/pgp/pgp_plugin.c
src/libstrongswan/plugins/pkcs1/pkcs1_builder.c
src/libstrongswan/plugins/pkcs1/pkcs1_encoder.c
src/libstrongswan/plugins/pkcs1/pkcs1_plugin.c
src/libstrongswan/plugins/plugin.h
src/libstrongswan/plugins/plugin_loader.c
src/libstrongswan/plugins/plugin_loader.h
src/libstrongswan/plugins/pubkey/pubkey_cert.c
src/libstrongswan/plugins/pubkey/pubkey_plugin.c
src/libstrongswan/plugins/random/random_plugin.c
src/libstrongswan/plugins/random/random_plugin.h
src/libstrongswan/plugins/random/random_rng.c
src/libstrongswan/plugins/random/random_rng.h
src/libstrongswan/plugins/sha1/sha1_hasher.c
src/libstrongswan/plugins/sha1/sha1_hasher.h
src/libstrongswan/plugins/sha1/sha1_plugin.c
src/libstrongswan/plugins/sha1/sha1_prf.c
src/libstrongswan/plugins/sha1/sha1_prf.h
src/libstrongswan/plugins/sha2/sha2_hasher.c
src/libstrongswan/plugins/sha2/sha2_hasher.h
src/libstrongswan/plugins/sha2/sha2_plugin.c
src/libstrongswan/plugins/sqlite/sqlite_database.c
src/libstrongswan/plugins/sqlite/sqlite_plugin.c
src/libstrongswan/plugins/test_vectors/test_vectors/blowfish.c
src/libstrongswan/plugins/test_vectors/test_vectors/rng.c
src/libstrongswan/plugins/test_vectors/test_vectors_plugin.c
src/libstrongswan/plugins/x509/ietf_attr_list.c
src/libstrongswan/plugins/x509/ietf_attr_list.h
src/libstrongswan/plugins/x509/x509_ac.c
src/libstrongswan/plugins/x509/x509_cert.c
src/libstrongswan/plugins/x509/x509_crl.c
src/libstrongswan/plugins/x509/x509_ocsp_request.c
src/libstrongswan/plugins/x509/x509_ocsp_response.c
src/libstrongswan/plugins/x509/x509_plugin.c
src/libstrongswan/plugins/xcbc/xcbc.c
src/libstrongswan/plugins/xcbc/xcbc.h
src/libstrongswan/plugins/xcbc/xcbc_plugin.c
src/libstrongswan/plugins/xcbc/xcbc_prf.c
src/libstrongswan/plugins/xcbc/xcbc_prf.h
src/libstrongswan/plugins/xcbc/xcbc_signer.c
src/libstrongswan/plugins/xcbc/xcbc_signer.h
src/libstrongswan/printf_hook.c
src/libstrongswan/printf_hook.h
src/libstrongswan/settings.c
src/libstrongswan/settings.h
src/libstrongswan/utils.c
src/libstrongswan/utils.h
src/libstrongswan/utils/backtrace.c
src/libstrongswan/utils/backtrace.h
src/libstrongswan/utils/enumerator.c
src/libstrongswan/utils/enumerator.h
src/libstrongswan/utils/hashtable.c
src/libstrongswan/utils/hashtable.h
src/libstrongswan/utils/host.c
src/libstrongswan/utils/host.h
src/libstrongswan/utils/identification.c
src/libstrongswan/utils/identification.h
src/libstrongswan/utils/iterator.h
src/libstrongswan/utils/leak_detective.c
src/libstrongswan/utils/leak_detective.h
src/libstrongswan/utils/lexparser.c
src/libstrongswan/utils/lexparser.h
src/libstrongswan/utils/linked_list.c
src/libstrongswan/utils/linked_list.h
src/libstrongswan/utils/mutex.c
src/libstrongswan/utils/mutex.h
src/libstrongswan/utils/optionsfrom.c
src/libstrongswan/utils/optionsfrom.h
src/manager/controller/auth_controller.c
src/manager/controller/config_controller.c
src/manager/controller/control_controller.c
src/manager/controller/gateway_controller.c
src/manager/controller/ikesa_controller.c
src/manager/gateway.c
src/manager/gateway.h
src/manager/main.c
src/manager/manager.c
src/manager/manager.h
src/manager/storage.c
src/manager/storage.h
src/manager/xml.c
src/manager/xml.h
src/medsrv/controller/peer_controller.c
src/medsrv/controller/user_controller.c
src/medsrv/filter/auth_filter.c
src/medsrv/main.c
src/medsrv/user.h
src/openac/openac.c
src/pki/pki.c
src/pluto/ac.c
src/pluto/alg_info.c
src/pluto/alg_info.h
src/pluto/builder.c
src/pluto/ca.c
src/pluto/certs.c
src/pluto/connections.c
src/pluto/connections.h
src/pluto/constants.c
src/pluto/constants.h
src/pluto/crl.c
src/pluto/crl.h
src/pluto/crypto.c
src/pluto/db_ops.c
src/pluto/demux.c
src/pluto/dnskey.c
src/pluto/fetch.c
src/pluto/ike_alg.c
src/pluto/ipsec_doi.c
src/pluto/kernel.c
src/pluto/kernel_alg.c
src/pluto/kernel_netlink.c
src/pluto/kernel_noklips.c
src/pluto/kernel_pfkey.c
src/pluto/keys.c
src/pluto/log.c
src/pluto/modecfg.c
src/pluto/modecfg.h
src/pluto/nat_traversal.c
src/pluto/ocsp.c
src/pluto/packet.c
src/pluto/pgpcert.c
src/pluto/pkcs7.c
src/pluto/plutomain.c
src/pluto/rcv_whack.c
src/pluto/rsaref/pkcs11.h
src/pluto/rsaref/pkcs11f.h
src/pluto/smartcard.c
src/pluto/spdb.c
src/pluto/state.c
src/pluto/timer.c
src/pluto/vendor.c
src/pluto/virtual.c
src/pluto/x509.c
src/pluto/x509.h
src/pluto/xauth.c
src/pluto/xauth.h
src/scepclient/loglite.c
src/scepclient/pkcs10.c
src/scepclient/pkcs10.h
src/scepclient/scep.c
src/scepclient/scep.h
src/scepclient/scepclient.c
src/starter/args.c
src/starter/confread.c
src/starter/confread.h
src/starter/invokecharon.c
src/starter/invokepluto.c
src/starter/klips.c
src/starter/klips.h
src/starter/netkey.h
src/starter/starter.c
src/starter/starterstroke.c
src/starter/starterwhack.c
src/stroke/stroke.c
src/stroke/stroke_msg.h
src/whack/whack.c
src/whack/whack.h

index 4778b44..5e0ad7c 100644 (file)
@@ -27,7 +27,7 @@ int main(int argc, char *argv[])
                {
                        break;
                }
-       }       
+       }
        printf("};\n");
        return 0;
 }
index 4f83dd3..8bc72f8 100644 (file)
@@ -18,7 +18,7 @@ int main(int argc, char *argv[])
                        break;
                }
                printf("%02x", (unsigned int)byte);
-       }       
+       }
        printf("'\n");
        return 0;
 }
index 76dafe7..5a57bad 100644 (file)
@@ -38,7 +38,7 @@ static void start_timing(struct timespec *start)
 static double end_timing(struct timespec *start)
 {
        struct timespec end;
-       
+
        clock_gettime(CLOCK_THREAD_CPUTIME_ID, &end);
        return (end.tv_nsec - start->tv_nsec) / 1000000000.0 +
                        (end.tv_sec - start->tv_sec) * 1.0;
@@ -50,7 +50,7 @@ static void run_test(diffie_hellman_group_t group, int rounds)
        chunk_t chunk;
        struct timespec timing;
        int round;
-       
+
        r = lib->crypto->create_dh(lib->crypto, group);
        if (!r)
        {
@@ -58,24 +58,24 @@ static void run_test(diffie_hellman_group_t group, int rounds)
                                diffie_hellman_group_names, group);
                return;
        }
-       
+
        printf("%N:\t",
                        diffie_hellman_group_names, group);
-       
+
        start_timing(&timing);
        for (round = 0; round < rounds; round++)
        {
                l[round] = lib->crypto->create_dh(lib->crypto, group);
        }
        printf("A = g^a/s: %8.1f", rounds / end_timing(&timing));
-       
+
        for (round = 0; round < rounds; round++)
        {
                l[round]->get_my_public_value(l[round], &chunk);
                r->set_other_public_value(r, chunk);
                chunk_free(&chunk);
        }
-       
+
        r->get_my_public_value(r, &chunk);
        start_timing(&timing);
        for (round = 0; round < rounds; round++)
@@ -84,7 +84,7 @@ static void run_test(diffie_hellman_group_t group, int rounds)
        }
        printf(" | S = B^a/s: %8.1f\n", rounds / end_timing(&timing));
        chunk_free(&chunk);
-       
+
        for (round = 0; round < rounds; round++)
        {
                l[round]->destroy(l[round]);
@@ -95,22 +95,22 @@ static void run_test(diffie_hellman_group_t group, int rounds)
 int main(int argc, char *argv[])
 {
        int rounds, i, j;
-       
+
        if (argc < 4)
        {
                usage();
        }
-       
+
        library_init(STRONGSWAN_CONF);
        lib->plugins->load(lib->plugins, IPSEC_PLUGINDIR, argv[1]);
        atexit(library_deinit);
-       
+
        rounds = atoi(argv[2]);
-       
+
        for (i = 3; i < argc; i++)
        {
                bool found = FALSE;
-               
+
                for (j = 0; j < countof(groups); j++)
                {
                        if (streq(groups[j].name, argv[i]))
index 5b0bd1d..5bc94f5 100644 (file)
@@ -10,7 +10,7 @@ int main(int argc, char *argv[])
        identification_t *id;
        chunk_t enc;
        int i;
-       
+
        if (argc < 2)
        {
                return -1;
@@ -29,7 +29,7 @@ int main(int argc, char *argv[])
        for (i = 0; i < enc.len; i++)
        {
                printf("%02x", (unsigned int)enc.ptr[i]);
-       }       
+       }
        printf("'\n");
        return 0;
 }
index e32c2ba..cc3e0b1 100644 (file)
@@ -15,7 +15,7 @@ int main(int argc, char *argv[])
        chunk_t chunk;
        char buf[8096];
        int read;
-       
+
        library_init(NULL);
        lib->plugins->load(lib->plugins, IPSEC_PLUGINDIR, PLUGINS);
        atexit(library_deinit);
@@ -26,9 +26,9 @@ int main(int argc, char *argv[])
                fprintf(stderr, "reading key failed.\n");
                return -1;
        }
-       
+
        chunk = chunk_create(buf, read);
-       
+
        private = lib->creds->create(lib->creds, CRED_PRIVATE_KEY, KEY_RSA,
                                                                 BUILD_BLOB_PEM, chunk_clone(chunk),
                                                                 BUILD_END);
@@ -52,7 +52,7 @@ int main(int argc, char *argv[])
                private->destroy(private);
                return 0;
        }
-       
+
        public = lib->creds->create(lib->creds, CRED_PUBLIC_KEY, KEY_ANY,
                                                                BUILD_BLOB_PEM, chunk_clone(chunk),
                                                                BUILD_END);
@@ -82,7 +82,7 @@ int main(int argc, char *argv[])
                public->destroy(public);
                return 0;
        }
-       
+
        fprintf(stderr, "unable to parse input key.\n");
        return -1;
 }
index 2ec0119..bf95217 100644 (file)
@@ -15,7 +15,7 @@ int main(int argc, char *argv[])
        chunk_t chunk;
        char buf[8096];
        int read, n;
-       
+
        library_init(NULL);
        lib->plugins->load(lib->plugins, IPSEC_PLUGINDIR, PLUGINS);
        atexit(library_deinit);
@@ -26,9 +26,9 @@ int main(int argc, char *argv[])
                fprintf(stderr, "reading key failed.\n");
                return -1;
        }
-       
+
        chunk = chunk_create(buf, read);
-       
+
        private = lib->creds->create(lib->creds, CRED_PRIVATE_KEY, KEY_RSA,
                                                                 BUILD_BLOB_PEM, chunk_clone(chunk),
                                                                 BUILD_END);
@@ -46,7 +46,7 @@ int main(int argc, char *argv[])
                private->destroy(private);
                return 0;
        }
-       
+
        public = lib->creds->create(lib->creds, CRED_PUBLIC_KEY, KEY_ANY,
                                                                BUILD_BLOB_PEM, chunk_clone(chunk),
                                                                BUILD_END);
@@ -70,7 +70,7 @@ int main(int argc, char *argv[])
                public->destroy(public);
                return 0;
        }
-       
+
        fprintf(stderr, "unable to parse input key.\n");
        return -1;
 }
index 120ca85..99075d2 100644 (file)
@@ -13,7 +13,7 @@ void start_timing(struct timespec *start)
 double end_timing(struct timespec *start)
 {
        struct timespec end;
-       
+
        clock_gettime(CLOCK_THREAD_CPUTIME_ID, &end);
        return (end.tv_nsec - start->tv_nsec) / 1000000000.0 +
                        (end.tv_sec - start->tv_sec) * 1.0;
@@ -37,14 +37,14 @@ int main(int argc, char *argv[])
        key_type_t type = KEY_ANY;
        signature_scheme_t scheme = SIGN_UNKNOWN;
        chunk_t keydata, *sigs, data = chunk_from_buf(data_buf);
-       
+
        if (argc < 4)
        {
                usage();
        }
-       
+
        rounds = atoi(argv[3]);
-       
+
        if (streq(argv[2], "rsa"))
        {
                type = KEY_RSA;
@@ -58,18 +58,18 @@ int main(int argc, char *argv[])
        {
                usage();
        }
-       
+
        library_init(STRONGSWAN_CONF);
        lib->plugins->load(lib->plugins, IPSEC_PLUGINDIR, argv[1]);
        atexit(library_deinit);
-       
+
        keydata = chunk_create(buf, 0);
        while ((read = fread(pos, 1, sizeof(buf) - (pos - buf), stdin)))
        {
                pos += read;
                keydata.len += read;
        }
-       
+
        private = lib->creds->create(lib->creds, CRED_PRIVATE_KEY, type,
                                                                 BUILD_BLOB_PEM, keydata, BUILD_END);
        if (!private)
@@ -82,7 +82,7 @@ int main(int argc, char *argv[])
                switch (private->get_keysize(private))
                {
                        case 32:
-                               scheme = SIGN_ECDSA_256; 
+                               scheme = SIGN_ECDSA_256;
                                break;
                        case 48:
                                scheme = SIGN_ECDSA_384;
@@ -96,12 +96,12 @@ int main(int argc, char *argv[])
                                exit(1);
                }
        }
-       
+
        printf("%4d bit %N: ", private->get_keysize(private)*8,
                key_type_names, type);
-       
+
        sigs = malloc(sizeof(chunk_t) * rounds);
-       
+
        start_timing(&timing);
        for (round = 0; round < rounds; round++)
        {
@@ -112,7 +112,7 @@ int main(int argc, char *argv[])
                }
        };
        printf("sign()/s: %8.1f   ", rounds / end_timing(&timing));
-       
+
        public = private->get_public_key(private);
        if (!public)
        {
@@ -131,7 +131,7 @@ int main(int argc, char *argv[])
        printf("verify()/s: %8.1f\n", rounds / end_timing(&timing));
        public->destroy(public);
        private->destroy(private);
-       
+
        for (round = 0; round < rounds; round++)
        {
                free(sigs[round].ptr);
index 53cd043..7670ce1 100644 (file)
@@ -1,5 +1,5 @@
 /* Analyzes the concurrent use of charon's threads
- * 
+ *
  * Copyright (C) 2008 Andreas Steffen
  * Hochschule fuer Technik Rapperswil
  *
@@ -52,7 +52,7 @@ static int readline(FILE *fd, char *line)
                        *line = '\0';
                        return 1;
                }
-               line++;         
+               line++;
        }
        *line = '\0';
        return 0;
@@ -69,14 +69,14 @@ static void printline(state_t *state, char *timestamp)
        for (th = 1; th <= THREADS; th++)
        {
                states[state[th]]++;
-               printf("<td class=\"%s\"></td>", state_names[state[th]]);       
+               printf("<td class=\"%s\"></td>", state_names[state[th]]);
        }
        total = states[STATE_INIT] + states[STATE_AUTH] + states[STATE_BUSY] + states[STATE_RETRY];
        printf("<td class=\"init\">%d</td><td class=\"auth\">%d</td><td class=\"busy\">%d</td>",
                        states[STATE_INIT], states[STATE_AUTH], total);
        for (th = 10; th <= (THREADS + 2); th += 5)
        {
-               printf("<td class=\"%s\"></td>", (th <= total + 2)? "busy":"idle");     
+               printf("<td class=\"%s\"></td>", (th <= total + 2)? "busy":"idle");
        }
        printf("\n");
        printf("    </tr>\n");
@@ -91,13 +91,13 @@ int main(int argc, char *argv[])
        FILE *fd;
 
        state_t state[THREADS + 1];
-       
+
        /* threads 1..5 and 9 are always busy */
        for (th = 1; th <= THREADS; th++)
        {
                state[th] = (th <= 7 && th != 3)? STATE_BUSY : STATE_IDLE;
        }
-  
+
        /* open the log file */
        fd = fopen(LOGFILE, "r");
        if (!fd)
@@ -135,16 +135,16 @@ int main(int argc, char *argv[])
        printf("      <td class=\"log\">Timestamp</td>");
        for (th = 1 ; th <= THREADS; th++)
        {
-               printf("<td>%02d</td>", th);    
+               printf("<td>%02d</td>", th);
        }
        printf("<td class=\"init\">I</td><td class=\"auth\">A</td><td class=\"busy\">B</td>");
        for (th = 10; th <= (THREADS + 2); th += 5)
        {
-               printf("<td class=\"busy\">%d</td>", (th == 100)? 99:th);       
+               printf("<td class=\"busy\">%d</td>", (th == 100)? 99:th);
        }
        printf("\n");
        printf("    </tr>\n");
-       
+
        while (readline(fd, line))
        {
                char *p_section, *p_charon, *p_thread, *p_log;
@@ -170,7 +170,7 @@ int main(int argc, char *argv[])
                {
                        continue;
                }
-               
+
                /* determine thread */
                p_thread = p_charon + 8;
                th = atol(p_thread);
@@ -268,6 +268,6 @@ int main(int argc, char *argv[])
        printf("</body>\n");
        printf("</html>\n");
 
-       fclose(fd);     
+       fclose(fd);
        return 0;
 }
index 5abefd4..9f0ad97 100644 (file)
@@ -2,12 +2,12 @@
  * copyright reporter
  * (just avoids having the info in more than one place in the source)
  * Copyright (C) 2001  Henry Spencer.
- * 
+ *
  * 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
index 2671f84..7075586 100644 (file)
@@ -57,22 +57,22 @@ struct private_bus_t {
         * Public part of a bus_t object.
         */
        bus_t public;
-       
+
        /**
         * List of registered listeners as entry_t's
         */
        linked_list_t *listeners;
-       
+
        /**
         * mutex to synchronize active listeners, recursively
         */
        mutex_t *mutex;
-       
+
        /**
         * Thread local storage for a unique, simple thread ID
         */
        pthread_key_t thread_id;
-       
+
        /**
         * Thread local storage the threads IKE_SA
         */
@@ -90,17 +90,17 @@ struct entry_t {
         * registered listener interface
         */
        listener_t *listener;
-       
+
        /**
         * is this a active listen() call with a blocking thread
         */
        bool blocker;
-       
+
        /**
         * are we currently calling this listener
         */
        int calling;
-       
+
        /**
         * condvar where active listeners wait
         */
@@ -113,12 +113,12 @@ struct entry_t {
 static entry_t *entry_create(listener_t *listener, bool blocker)
 {
        entry_t *this = malloc_thing(entry_t);
-       
+
        this->listener = listener;
        this->blocker = blocker;
        this->calling = 0;
        this->condvar = condvar_create(CONDVAR_TYPE_DEFAULT);
-       
+
        return this;
 }
 
@@ -140,7 +140,7 @@ static u_int get_thread_number(private_bus_t *this)
 {
        static uintptr_t current_num = 0;
        uintptr_t stored_num;
-       
+
        stored_num = (uintptr_t)pthread_getspecific(this->thread_id);
        if (stored_num == 0)
        {       /* first call of current thread */
@@ -214,7 +214,7 @@ static void listen_(private_bus_t *this, listener_t *listener, job_t *job)
 {
        int old;
        cleanup_data_t data;
-       
+
        data.this = this;
        data.entry = entry_create(listener, TRUE);
 
@@ -302,20 +302,20 @@ static void vlog(private_bus_t *this, debug_t group, level_t level,
                                 char* format, va_list args)
 {
        log_data_t data;
-       
+
        data.ike_sa = pthread_getspecific(this->thread_sa);
        data.thread = get_thread_number(this);
        data.group = group;
        data.level = level;
        data.format = format;
        va_copy(data.args, args);
-       
+
        this->mutex->lock(this->mutex);
        /* We use the remove() method to invoke all listeners. This is cheap and
         * does not require an allocation for this performance critical function. */
        this->listeners->remove(this->listeners, &data, (void*)log_cb);
        this->mutex->unlock(this->mutex);
-       
+
        va_end(data.args);
 }
 
@@ -326,7 +326,7 @@ static void log_(private_bus_t *this, debug_t group, level_t level,
                                 char* format, ...)
 {
        va_list args;
-       
+
        va_start(args, format);
        vlog(this, group, level, format, args);
        va_end(args);
@@ -360,9 +360,9 @@ static void alert(private_bus_t *this, alert_t alert, ...)
        entry_t *entry;
        va_list args;
        bool keep;
-       
+
        ike_sa = pthread_getspecific(this->thread_sa);
-       
+
        this->mutex->lock(this->mutex);
        enumerator = this->listeners->create_enumerator(this->listeners);
        while (enumerator->enumerate(enumerator, &entry))
@@ -394,7 +394,7 @@ static void ike_state_change(private_bus_t *this, ike_sa_t *ike_sa,
        enumerator_t *enumerator;
        entry_t *entry;
        bool keep;
-       
+
        this->mutex->lock(this->mutex);
        enumerator = this->listeners->create_enumerator(this->listeners);
        while (enumerator->enumerate(enumerator, &entry))
@@ -425,9 +425,9 @@ static void child_state_change(private_bus_t *this, child_sa_t *child_sa,
        ike_sa_t *ike_sa;
        entry_t *entry;
        bool keep;
-       
+
        ike_sa = pthread_getspecific(this->thread_sa);
-       
+
        this->mutex->lock(this->mutex);
        enumerator = this->listeners->create_enumerator(this->listeners);
        while (enumerator->enumerate(enumerator, &entry))
@@ -458,9 +458,9 @@ static void message(private_bus_t *this, message_t *message, bool incoming)
        ike_sa_t *ike_sa;
        entry_t *entry;
        bool keep;
-       
+
        ike_sa = pthread_getspecific(this->thread_sa);
-       
+
        this->mutex->lock(this->mutex);
        enumerator = this->listeners->create_enumerator(this->listeners);
        while (enumerator->enumerate(enumerator, &entry))
@@ -492,7 +492,7 @@ static void ike_keys(private_bus_t *this, ike_sa_t *ike_sa,
        enumerator_t *enumerator;
        entry_t *entry;
        bool keep;
-       
+
        this->mutex->lock(this->mutex);
        enumerator = this->listeners->create_enumerator(this->listeners);
        while (enumerator->enumerate(enumerator, &entry))
@@ -524,9 +524,9 @@ static void child_keys(private_bus_t *this, child_sa_t *child_sa,
        ike_sa_t *ike_sa;
        entry_t *entry;
        bool keep;
-       
+
        ike_sa = pthread_getspecific(this->thread_sa);
-       
+
        this->mutex->lock(this->mutex);
        enumerator = this->listeners->create_enumerator(this->listeners);
        while (enumerator->enumerate(enumerator, &entry))
@@ -557,9 +557,9 @@ static void child_updown(private_bus_t *this, child_sa_t *child_sa, bool up)
        ike_sa_t *ike_sa;
        entry_t *entry;
        bool keep;
-       
+
        ike_sa = pthread_getspecific(this->thread_sa);
-       
+
        this->mutex->lock(this->mutex);
        enumerator = this->listeners->create_enumerator(this->listeners);
        while (enumerator->enumerate(enumerator, &entry))
@@ -590,9 +590,9 @@ static void child_rekey(private_bus_t *this, child_sa_t *old, child_sa_t *new)
        ike_sa_t *ike_sa;
        entry_t *entry;
        bool keep;
-       
+
        ike_sa = pthread_getspecific(this->thread_sa);
-       
+
        this->mutex->lock(this->mutex);
        enumerator = this->listeners->create_enumerator(this->listeners);
        while (enumerator->enumerate(enumerator, &entry))
@@ -621,7 +621,7 @@ static void ike_updown(private_bus_t *this, ike_sa_t *ike_sa, bool up)
        enumerator_t *enumerator;
        entry_t *entry;
        bool keep;
-       
+
        this->mutex->lock(this->mutex);
        enumerator = this->listeners->create_enumerator(this->listeners);
        while (enumerator->enumerate(enumerator, &entry))
@@ -640,13 +640,13 @@ static void ike_updown(private_bus_t *this, ike_sa_t *ike_sa, bool up)
        }
        enumerator->destroy(enumerator);
        this->mutex->unlock(this->mutex);
-       
+
        /* a down event for IKE_SA implicitly downs all CHILD_SAs */
        if (!up)
        {
                iterator_t *iterator;
                child_sa_t *child_sa;
-               
+
                iterator = ike_sa->create_child_sa_iterator(ike_sa);
                while (iterator->iterate(iterator, (void**)&child_sa))
                {
@@ -664,7 +664,7 @@ static void ike_rekey(private_bus_t *this, ike_sa_t *old, ike_sa_t *new)
        enumerator_t *enumerator;
        entry_t *entry;
        bool keep;
-       
+
        this->mutex->lock(this->mutex);
        enumerator = this->listeners->create_enumerator(this->listeners);
        while (enumerator->enumerate(enumerator, &entry))
@@ -694,9 +694,9 @@ static bool authorize(private_bus_t *this, linked_list_t *auth, bool final)
        ike_sa_t *ike_sa;
        entry_t *entry;
        bool keep, success = TRUE;
-       
+
        ike_sa = pthread_getspecific(this->thread_sa);
-       
+
        this->mutex->lock(this->mutex);
        enumerator = this->listeners->create_enumerator(this->listeners);
        while (enumerator->enumerate(enumerator, &entry))
@@ -739,7 +739,7 @@ static void destroy(private_bus_t *this)
 bus_t *bus_create()
 {
        private_bus_t *this = malloc_thing(private_bus_t);
-       
+
        this->public.add_listener = (void(*)(bus_t*,listener_t*))add_listener;
        this->public.remove_listener = (void(*)(bus_t*,listener_t*))remove_listener;
        this->public.listen = (void(*)(bus_t*, listener_t *listener, job_t *job))listen_;
@@ -758,12 +758,12 @@ bus_t *bus_create()
        this->public.child_rekey = (void(*)(bus_t*, child_sa_t *old, child_sa_t *new))child_rekey;
        this->public.authorize = (bool(*)(bus_t*, linked_list_t *auth, bool final))authorize;
        this->public.destroy = (void(*)(bus_t*)) destroy;
-       
+
        this->listeners = linked_list_create();
        this->mutex = mutex_create(MUTEX_TYPE_RECURSIVE);
        pthread_key_create(&this->thread_id, NULL);
        pthread_key_create(&this->thread_sa, NULL);
-       
+
        return &this->public;
 }
 
index 9c90db6..9a4492f 100644 (file)
@@ -142,7 +142,7 @@ enum alert_t {
  * may wait actively to events using the blocking listen() call.
  */
 struct bus_t {
-       
+
        /**
         * Register a listener to the bus.
         *
@@ -153,14 +153,14 @@ struct bus_t {
         * @param listener      listener to register.
         */
        void (*add_listener) (bus_t *this, listener_t *listener);
-       
+
        /**
         * Unregister a listener from the bus.
         *
         * @param listener      listener to unregister.
         */
        void (*remove_listener) (bus_t *this, listener_t *listener);
-       
+
        /**
         * Register a listener and block the calling thread.
         *
@@ -174,20 +174,20 @@ struct bus_t {
         * @param job           job to execute asynchronously when registered, or NULL
         */
        void (*listen)(bus_t *this, listener_t *listener, job_t *job);
-       
+
        /**
         * Set the IKE_SA the calling thread is using.
         *
         * To associate an received log message to an IKE_SA without passing it as
         * parameter each time, the thread registers the currenlty used IKE_SA
-        * during check-out. Before check-in, the thread unregisters the IKE_SA. 
+        * during check-out. Before check-in, the thread unregisters the IKE_SA.
         * This IKE_SA is stored per-thread, so each thread has its own IKE_SA
         * registered.
-        * 
+        *
         * @param ike_sa        ike_sa to register, or NULL to unregister
         */
        void (*set_sa) (bus_t *this, ike_sa_t *ike_sa);
-       
+
        /**
         * Send a log message to the bus.
         *
@@ -202,7 +202,7 @@ struct bus_t {
         * @param ...           printf() style argument list
         */
        void (*log)(bus_t *this, debug_t group, level_t level, char* format, ...);
-       
+
        /**
         * Send a log message to the bus using va_list arguments.
         *
@@ -215,7 +215,7 @@ struct bus_t {
         */
        void (*vlog)(bus_t *this, debug_t group, level_t level,
                                 char* format, va_list args);
-       
+
        /**
         * Raise an alert over the bus.
         *
@@ -223,7 +223,7 @@ struct bus_t {
         * @param ...           alert specific attributes
         */
        void (*alert)(bus_t *this, alert_t alert, ...);
-       
+
        /**
         * Send a IKE_SA state change event to the bus.
         *
@@ -247,7 +247,7 @@ struct bus_t {
         * @param incoming      TRUE for incoming messages, FALSE for outgoing
         */
        void (*message)(bus_t *this, message_t *message, bool incoming);
-       
+
        /**
         * IKE_SA authorization hook.
         *
@@ -256,7 +256,7 @@ struct bus_t {
         * @return                      TRUE to establish IKE_SA, FALSE to send AUTH_FAILED
         */
        bool (*authorize)(bus_t *this, linked_list_t *auth, bool final);
-       
+
        /**
         * IKE_SA keymat hook.
         *
@@ -278,7 +278,7 @@ struct bus_t {
         */
        void (*child_keys)(bus_t *this, child_sa_t *child_sa, diffie_hellman_t *dh,
                                           chunk_t nonce_i, chunk_t nonce_r);
-       
+
        /**
         * IKE_SA up/down hook.
         *
@@ -286,7 +286,7 @@ struct bus_t {
         * @param up            TRUE for an up event, FALSE for a down event
         */
        void (*ike_updown)(bus_t *this, ike_sa_t *ike_sa, bool up);
-       
+
        /**
         * IKE_SA rekeying hook.
         *
@@ -294,7 +294,7 @@ struct bus_t {
         * @param new           new IKE_SA replacing old
         */
        void (*ike_rekey)(bus_t *this, ike_sa_t *old, ike_sa_t *new);
-       
+
        /**
         * CHILD_SA up/down hook.
         *
@@ -302,7 +302,7 @@ struct bus_t {
         * @param up            TRUE for an up event, FALSE for a down event
         */
        void (*child_updown)(bus_t *this, child_sa_t *child_sa, bool up);
-       
+
        /**
         * CHILD_SA rekeying hook.
         *
@@ -310,7 +310,7 @@ struct bus_t {
         * @param new           new CHILD_SA replacing old
         */
        void (*child_rekey)(bus_t *this, child_sa_t *old, child_sa_t *new);
-       
+
        /**
         * Destroy the event bus.
         */
index c3213f5..12587de 100644 (file)
@@ -25,17 +25,17 @@ typedef struct private_file_logger_t private_file_logger_t;
  * Private data of a file_logger_t object
  */
 struct private_file_logger_t {
-       
+
        /**
         * Public data.
         */
        file_logger_t public;
-       
+
        /**
         * output file
         */
        FILE *out;
-       
+
        /**
         * Maximum level to log, for each group
         */
@@ -52,10 +52,10 @@ static bool log_(private_file_logger_t *this, debug_t group, level_t level,
        {
                char buffer[8192];
                char *current = buffer, *next;
-               
+
                /* write in memory buffer first */
                vsnprintf(buffer, sizeof(buffer), format, args);
-               
+
                /* prepend a prefix in front of every line */
                while (current)
                {
@@ -109,17 +109,17 @@ static void destroy(private_file_logger_t *this)
 file_logger_t *file_logger_create(FILE *out)
 {
        private_file_logger_t *this = malloc_thing(private_file_logger_t);
-       
+
        /* public functions */
        memset(&this->public.listener, 0, sizeof(listener_t));
        this->public.listener.log = (bool(*)(listener_t*,debug_t,level_t,int,ike_sa_t*,char*,va_list))log_;
        this->public.set_level = (void(*)(file_logger_t*,debug_t,level_t))set_level;
        this->public.destroy = (void(*)(file_logger_t*))destroy;
-       
+
        /* private variables */
        this->out = out;
        set_level(this, DBG_ANY, LEVEL_SILENT);
-       
+
        return &this->public;
 }
 
index a69374f..bd443fd 100644 (file)
@@ -29,12 +29,12 @@ typedef struct file_logger_t file_logger_t;
  * Logger to files which implements listener_t.
  */
 struct file_logger_t {
-       
+
        /**
         * Implements the listener_t interface.
         */
        listener_t listener;
-       
+
        /**
         * Set the loglevel for a debug group.
         *
@@ -42,7 +42,7 @@ struct file_logger_t {
         * @param level         max level to log (0..4)
         */
        void (*set_level) (file_logger_t *this, debug_t group, level_t level);
-       
+
        /**
         * Destroys a file_logger_t object.
         */
index 578f08e..4cd14e2 100644 (file)
@@ -29,7 +29,7 @@ typedef struct listener_t listener_t;
  * Listener interface, listens to events if registered to the bus.
  */
 struct listener_t {
-       
+
        /**
         * Log a debugging message.
         *
@@ -48,7 +48,7 @@ struct listener_t {
         */
        bool (*log)(listener_t *this, debug_t group, level_t level, int thread,
                                ike_sa_t *ike_sa, char* format, va_list args);
-       
+
        /**
         * Hook called if a critical alert is risen.
         *
@@ -59,7 +59,7 @@ struct listener_t {
         */
        bool (*alert)(listener_t *this, ike_sa_t *ike_sa,
                                  alert_t alert, va_list args);
-       
+
        /**
         * Handle state changes in an IKE_SA.
         *
@@ -69,7 +69,7 @@ struct listener_t {
         */
        bool (*ike_state_change)(listener_t *this, ike_sa_t *ike_sa,
                                                         ike_sa_state_t state);
-       
+
        /**
         * Handle state changes in a CHILD_SA.
         *
@@ -80,7 +80,7 @@ struct listener_t {
         */
        bool (*child_state_change)(listener_t *this, ike_sa_t *ike_sa,
                                                           child_sa_t *child_sa, child_sa_state_t state);
-       
+
        /**
         * Hook called for received/sent messages of an IKE_SA.
         *
@@ -91,7 +91,7 @@ struct listener_t {
         */
        bool (*message)(listener_t *this, ike_sa_t *ike_sa, message_t *message,
                                        bool incoming);
-       
+
        /**
         * Hook called with IKE_SA key material.
         *
@@ -104,7 +104,7 @@ struct listener_t {
         */
        bool (*ike_keys)(listener_t *this, ike_sa_t *ike_sa, diffie_hellman_t *dh,
                                         chunk_t nonce_i, chunk_t nonce_r, ike_sa_t *rekey);
-       
+
        /**
         * Hook called with CHILD_SA key material.
         *
@@ -117,7 +117,7 @@ struct listener_t {
         */
        bool (*child_keys)(listener_t *this, ike_sa_t *ike_sa, child_sa_t *child_sa,
                                           diffie_hellman_t *dh, chunk_t nonce_i, chunk_t nonce_r);
-       
+
        /**
         * Hook called if an IKE_SA gets up or down.
         *
@@ -126,7 +126,7 @@ struct listener_t {
         * @return                      TRUE to stay registered, FALSE to unregister
         */
        bool (*ike_updown)(listener_t *this, ike_sa_t *ike_sa, bool up);
-       
+
        /**
         * Hook called when an IKE_SA gets rekeyed.
         *
@@ -135,7 +135,7 @@ struct listener_t {
         * @return                      TRUE to stay registered, FALSE to unregister
         */
        bool (*ike_rekey)(listener_t *this, ike_sa_t *old, ike_sa_t *new);
-       
+
        /**
         * Hook called when a CHILD_SA gets up or down.
         *
@@ -146,7 +146,7 @@ struct listener_t {
         */
        bool (*child_updown)(listener_t *this, ike_sa_t *ike_sa,
                                                 child_sa_t *child_sa, bool up);
-       
+
        /**
         * Hook called when an CHILD_SA gets rekeyed.
         *
@@ -157,7 +157,7 @@ struct listener_t {
         */
        bool (*child_rekey)(listener_t *this, ike_sa_t *ike_sa,
                                                child_sa_t *old, child_sa_t *new);
-       
+
        /**
         * Hook called to invoke additional authorization rules.
         *
index 0b579ce..11421ad 100644 (file)
@@ -25,17 +25,17 @@ typedef struct private_sys_logger_t private_sys_logger_t;
  * Private data of a sys_logger_t object
  */
 struct private_sys_logger_t {
-       
+
        /**
         * Public data.
         */
        sys_logger_t public;
-       
+
        /**
         * syslog facility to use
         */
        int facility;
-       
+
        /**
         * Maximum level to log, for each group
         */
@@ -52,10 +52,10 @@ static bool log_(private_sys_logger_t *this, debug_t group, level_t level,
        {
                char buffer[8192];
                char *current = buffer, *next;
-               
+
                /* write in memory buffer first */
                vsnprintf(buffer, sizeof(buffer), format, args);
-               
+
                /* do a syslog with every line */
                while (current)
                {
@@ -106,16 +106,16 @@ static void destroy(private_sys_logger_t *this)
 sys_logger_t *sys_logger_create(int facility)
 {
        private_sys_logger_t *this = malloc_thing(private_sys_logger_t);
-       
+
        /* public functions */
        memset(&this->public.listener, 0, sizeof(listener_t));
        this->public.listener.log = (bool(*)(listener_t*,debug_t,level_t,int,ike_sa_t*,char*,va_list))log_;
        this->public.set_level = (void(*)(sys_logger_t*,debug_t,level_t))set_level;
        this->public.destroy = (void(*)(sys_logger_t*))destroy;
-       
+
        /* private variables */
        this->facility = facility;
        set_level(this, DBG_ANY, LEVEL_SILENT);
-       
+
        return &this->public;
 }
index 3ed0f02..730890d 100644 (file)
@@ -31,12 +31,12 @@ typedef struct sys_logger_t sys_logger_t;
  * Logger for syslog which implements listener_t.
  */
 struct sys_logger_t {
-       
+
        /**
         * Implements the listener_t interface.
         */
        listener_t listener;
-       
+
        /**
         * Set the loglevel for a debug group.
         *
@@ -44,7 +44,7 @@ struct sys_logger_t {
         * @param level         max level to log (0..4)
         */
        void (*set_level) (sys_logger_t *this, debug_t group, level_t level);
-       
+
        /**
         * Destroys a sys_logger_t object.
         */
index de1c441..d752d51 100644 (file)
@@ -30,7 +30,7 @@ typedef struct attribute_handler_t attribute_handler_t;
  * Interface to handle configuration payload attributes.
  */
 struct attribute_handler_t {
-       
+
        /**
         * Handle a configuration attribute.
         *
@@ -43,7 +43,7 @@ struct attribute_handler_t {
         */
        bool (*handle)(attribute_handler_t *this, ike_sa_t *ike_sa,
                                   configuration_attribute_type_t type, chunk_t data);
-       
+
        /**
         * Release an attribute handled during handle().
         *
index bf45fdb..86d7d07 100644 (file)
@@ -30,17 +30,17 @@ struct private_attribute_manager_t {
         * public functions
         */
        attribute_manager_t public;
-       
+
        /**
         * list of registered providers
         */
        linked_list_t *providers;
-       
+
        /**
         * list of registered handlers
         */
        linked_list_t *handlers;
-       
+
        /**
         * rwlock provider list
         */
@@ -57,7 +57,7 @@ static host_t* acquire_address(private_attribute_manager_t *this,
        enumerator_t *enumerator;
        attribute_provider_t *current;
        host_t *host = NULL;
-       
+
        this->lock->read_lock(this->lock);
        enumerator = this->providers->create_enumerator(this->providers);
        while (enumerator->enumerate(enumerator, &current))
@@ -70,7 +70,7 @@ static host_t* acquire_address(private_attribute_manager_t *this,
        }
        enumerator->destroy(enumerator);
        this->lock->unlock(this->lock);
-       
+
        if (!host)
        {
                DBG1(DBG_CFG, "acquiring address from pool '%s' failed", pool);
@@ -87,7 +87,7 @@ static void release_address(private_attribute_manager_t *this,
        enumerator_t *enumerator;
        attribute_provider_t *current;
        bool found = FALSE;
-       
+
        this->lock->read_lock(this->lock);
        enumerator = this->providers->create_enumerator(this->providers);
        while (enumerator->enumerate(enumerator, &current))
@@ -100,7 +100,7 @@ static void release_address(private_attribute_manager_t *this,
        }
        enumerator->destroy(enumerator);
        this->lock->unlock(this->lock);
-       
+
        if (!found)
        {
                DBG1(DBG_CFG, "releasing address to pool '%s' failed", pool);
@@ -161,7 +161,7 @@ static attribute_handler_t* handle(private_attribute_manager_t *this,
 {
        enumerator_t *enumerator;
        attribute_handler_t *current, *handled = NULL;
-       
+
        this->lock->read_lock(this->lock);
        enumerator = this->handlers->create_enumerator(this->handlers);
        while (enumerator->enumerate(enumerator, &current))
@@ -174,7 +174,7 @@ static attribute_handler_t* handle(private_attribute_manager_t *this,
        }
        enumerator->destroy(enumerator);
        this->lock->unlock(this->lock);
-       
+
        if (!handled)
        {
                DBG1(DBG_CFG, "handling %N attribute failed",
@@ -192,7 +192,7 @@ static void release(private_attribute_manager_t *this,
 {
        enumerator_t *enumerator;
        attribute_handler_t *current;
-       
+
        this->lock->read_lock(this->lock);
        enumerator = this->handlers->create_enumerator(this->handlers);
        while (enumerator->enumerate(enumerator, &current))
@@ -246,7 +246,7 @@ static void destroy(private_attribute_manager_t *this)
 attribute_manager_t *attribute_manager_create()
 {
        private_attribute_manager_t *this = malloc_thing(private_attribute_manager_t);
-       
+
        this->public.acquire_address = (host_t*(*)(attribute_manager_t*, char*, identification_t*,host_t*))acquire_address;
        this->public.release_address = (void(*)(attribute_manager_t*, char *, host_t*, identification_t*))release_address;
        this->public.create_attribute_enumerator = (enumerator_t*(*)(attribute_manager_t*, identification_t *id))create_attribute_enumerator;
@@ -257,11 +257,11 @@ attribute_manager_t *attribute_manager_create()
        this->public.add_handler = (void(*)(attribute_manager_t*, attribute_handler_t *handler))add_handler;
        this->public.remove_handler = (void(*)(attribute_manager_t*, attribute_handler_t *handler))remove_handler;
        this->public.destroy = (void(*)(attribute_manager_t*))destroy;
-       
+
        this->providers = linked_list_create();
        this->handlers = linked_list_create();
        this->lock = rwlock_create(RWLOCK_TYPE_DEFAULT);
-       
+
        return &this->public;
 }
 
index ceea065..68eb8b1 100644 (file)
@@ -35,7 +35,7 @@ typedef struct attribute_manager_t attribute_manager_t;
  * are received on the requesting peer.
  */
 struct attribute_manager_t {
-       
+
        /**
         * Acquire a virtual IP address to assign to a peer.
         *
@@ -47,7 +47,7 @@ struct attribute_manager_t {
        host_t* (*acquire_address)(attribute_manager_t *this,
                                                           char *pool, identification_t *id,
                                                           host_t *requested);
-       
+
        /**
         * Release a previously acquired address.
         *
@@ -57,7 +57,7 @@ struct attribute_manager_t {
         */
        void (*release_address)(attribute_manager_t *this,
                                                        char *pool, host_t *address, identification_t *id);
-       
+
        /**
         * Create an enumerator over attributes to hand out to a peer.
         *
@@ -66,7 +66,7 @@ struct attribute_manager_t {
         */
        enumerator_t* (*create_attribute_enumerator)(attribute_manager_t *this,
                                                                                                 identification_t *id);
-       
+
        /**
         * Register an attribute provider to the manager.
         *
@@ -81,7 +81,7 @@ struct attribute_manager_t {
         */
        void (*remove_provider)(attribute_manager_t *this,
                                                        attribute_provider_t *provider);
-       
+
        /**
         * Handle a configuration attribute by passing them to the handlers.
         *
@@ -92,7 +92,7 @@ struct attribute_manager_t {
         */
        attribute_handler_t* (*handle)(attribute_manager_t *this, ike_sa_t *ike_sa,
                                                        configuration_attribute_type_t type, chunk_t data);
-       
+
        /**
         * Release an attribute previously handle()d by a handler.
         *
@@ -104,7 +104,7 @@ struct attribute_manager_t {
        void (*release)(attribute_manager_t *this, attribute_handler_t *handler,
                                                ike_sa_t *ike_sa, configuration_attribute_type_t type,
                                                chunk_t data);
-       
+
        /**
         * Register an attribute handler to the manager.
         *
@@ -112,7 +112,7 @@ struct attribute_manager_t {
         */
        void (*add_handler)(attribute_manager_t *this,
                                                attribute_handler_t *handler);
-       
+
        /**
         * Unregister an attribute handler from the manager.
         *
@@ -120,7 +120,7 @@ struct attribute_manager_t {
         */
        void (*remove_handler)(attribute_manager_t *this,
                                                   attribute_handler_t *handler);
-       
+
        /**
         * Destroy a attribute_manager instance.
         */
index 0f1057a..b882572 100644 (file)
@@ -41,7 +41,7 @@ struct attribute_provider_t {
         * @return                              allocated address, NULL to serve none
         */
        host_t* (*acquire_address)(attribute_provider_t *this,
-                                                          char *pool, identification_t *id, 
+                                                          char *pool, identification_t *id,
                                                           host_t *requested);
        /**
         * Release a previously acquired address.
@@ -53,7 +53,7 @@ struct attribute_provider_t {
         */
        bool (*release_address)(attribute_provider_t *this,
                                                        char *pool, host_t *address, identification_t *id);
-       
+
        /**
         * Create an enumerator over attributes to hand out to a peer.
         *
index e4501bc..94362c7 100644 (file)
@@ -45,12 +45,12 @@ typedef struct private_auth_cfg_t private_auth_cfg_t;
  * private data of item_set
  */
 struct private_auth_cfg_t {
-       
+
        /**
         * public functions
         */
        auth_cfg_t public;
-       
+
        /**
         * list of entry_t
         */
@@ -84,7 +84,7 @@ typedef struct {
 static bool enumerate(entry_enumerator_t *this, auth_rule_t *type, void **value)
 {
        entry_t *entry;
-       
+
        if (this->inner->enumerate(this->inner, &entry))
        {
                this->current = entry;
@@ -110,7 +110,7 @@ static void entry_enumerator_destroy(entry_enumerator_t *this)
 static enumerator_t* create_enumerator(private_auth_cfg_t *this)
 {
        entry_enumerator_t *enumerator;
-       
+
        enumerator = malloc_thing(entry_enumerator_t);
        enumerator->inner = this->entries->create_enumerator(this->entries);
        enumerator->public.enumerate = (void*)enumerate;
@@ -168,9 +168,9 @@ static void replace(auth_cfg_t *this, entry_enumerator_t *enumerator,
        if (enumerator->current)
        {
                va_list args;
-               
+
                va_start(args, type);
-               
+
                destroy_entry_value(enumerator->current);
                enumerator->current->type = type;
                switch (type)
@@ -210,7 +210,7 @@ static void* get(private_auth_cfg_t *this, auth_rule_t type)
        void *current_value, *best_value = NULL;
        auth_rule_t current_type;
        bool found = FALSE;
-       
+
        enumerator = create_enumerator(this);
        while (enumerator->enumerate(enumerator, &current_type, &current_value))
        {
@@ -270,7 +270,7 @@ static void add(private_auth_cfg_t *this, auth_rule_t type, ...)
 {
        entry_t *entry = malloc_thing(entry_t);
        va_list args;
-       
+
        va_start(args, type);
        entry->type = type;
        switch (type)
@@ -311,7 +311,7 @@ static bool complies(private_auth_cfg_t *this, auth_cfg_t *constraints,
        bool success = TRUE;
        auth_rule_t t1, t2;
        void *value;
-       
+
        e1 = constraints->create_enumerator(constraints);
        while (e1->enumerate(e1, &t1, &value))
        {
@@ -321,9 +321,9 @@ static bool complies(private_auth_cfg_t *this, auth_cfg_t *constraints,
                        case AUTH_RULE_IM_CERT:
                        {
                                certificate_t *c1, *c2;
-                               
+
                                c1 = (certificate_t*)value;
-                               
+
                                success = FALSE;
                                e2 = create_enumerator(this);
                                while (e2->enumerate(e2, &t2, &c2))
@@ -345,7 +345,7 @@ static bool complies(private_auth_cfg_t *this, auth_cfg_t *constraints,
                        case AUTH_RULE_SUBJECT_CERT:
                        {
                                certificate_t *c1, *c2;
-                               
+
                                c1 = (certificate_t*)value;
                                c2 = get(this, AUTH_RULE_SUBJECT_CERT);
                                if (!c2 || !c1->equals(c1, c2))
@@ -364,7 +364,7 @@ static bool complies(private_auth_cfg_t *this, auth_cfg_t *constraints,
                        case AUTH_RULE_OCSP_VALIDATION:
                        {
                                cert_validation_t validated, required;
-                               
+
                                required = (uintptr_t)value;
                                validated = (uintptr_t)get(this, t1);
                                switch (required)
@@ -401,7 +401,7 @@ static bool complies(private_auth_cfg_t *this, auth_cfg_t *constraints,
                        case AUTH_RULE_EAP_IDENTITY:
                        {
                                identification_t *id1, *id2;
-                               
+
                                id1 = (identification_t*)value;
                                id2 = get(this, t1);
                                if (!id2 || !id2->matches(id2, id1))
@@ -499,7 +499,7 @@ static void merge(private_auth_cfg_t *this, private_auth_cfg_t *other, bool copy
                enumerator_t *enumerator;
                auth_rule_t type;
                void *value;
-               
+
                enumerator = create_enumerator(other);
                while (enumerator->enumerate(enumerator, &type, &value))
                {
@@ -512,7 +512,7 @@ static void merge(private_auth_cfg_t *this, private_auth_cfg_t *other, bool copy
                                case AUTH_HELPER_SUBJECT_CERT:
                                {
                                        certificate_t *cert = (certificate_t*)value;
-                                       
+
                                        add(this, type, cert->get_ref(cert));
                                        break;
                                }
@@ -530,7 +530,7 @@ static void merge(private_auth_cfg_t *this, private_auth_cfg_t *other, bool copy
                                case AUTH_RULE_AC_GROUP:
                                {
                                        identification_t *id = (identification_t*)value;
-                                       
+
                                        add(this, type, id->clone(id));
                                        break;
                                }
@@ -547,7 +547,7 @@ static void merge(private_auth_cfg_t *this, private_auth_cfg_t *other, bool copy
        else
        {
                entry_t *entry;
-               
+
                while (other->entries->remove_first(other->entries,
                                                                                        (void**)&entry) == SUCCESS)
                {
@@ -564,7 +564,7 @@ static bool equals(private_auth_cfg_t *this, private_auth_cfg_t *other)
        enumerator_t *e1, *e2;
        entry_t *i1, *i2;
        bool equal = TRUE, found;
-       
+
        if (this->entries->get_count(this->entries) !=
                other->entries->get_count(other->entries))
        {
@@ -601,10 +601,10 @@ static bool equals(private_auth_cfg_t *this, private_auth_cfg_t *other)
                                        case AUTH_HELPER_SUBJECT_CERT:
                                        {
                                                certificate_t *c1, *c2;
-                                               
+
                                                c1 = (certificate_t*)i1->value;
                                                c2 = (certificate_t*)i2->value;
-                                               
+
                                                if (c1->equals(c1, c2))
                                                {
                                                        found = TRUE;
@@ -617,10 +617,10 @@ static bool equals(private_auth_cfg_t *this, private_auth_cfg_t *other)
                                        case AUTH_RULE_AC_GROUP:
                                        {
                                                identification_t *id1, *id2;
-                                               
+
                                                id1 = (identification_t*)i1->value;
                                                id2 = (identification_t*)i2->value;
-                                               
+
                                                if (id1->equals(id1, id2))
                                                {
                                                        found = TRUE;
@@ -660,7 +660,7 @@ static void purge(private_auth_cfg_t *this, bool keep_ca)
 {
        entry_t *entry;
        linked_list_t *cas;
-       
+
        cas = linked_list_create();
        while (this->entries->remove_last(this->entries, (void**)&entry) == SUCCESS)
        {
@@ -689,7 +689,7 @@ static auth_cfg_t* clone_(private_auth_cfg_t *this)
        enumerator_t *enumerator;
        auth_cfg_t *clone;
        entry_t *entry;
-       
+
        clone = auth_cfg_create();
        enumerator = this->entries->create_enumerator(this->entries);
        while (enumerator->enumerate(enumerator, &entry))
@@ -749,7 +749,7 @@ static void destroy(private_auth_cfg_t *this)
 auth_cfg_t *auth_cfg_create()
 {
        private_auth_cfg_t *this = malloc_thing(private_auth_cfg_t);
-       
+
        this->public.add = (void(*)(auth_cfg_t*, auth_rule_t type, ...))add;
        this->public.get = (void*(*)(auth_cfg_t*, auth_rule_t type))get;
        this->public.create_enumerator = (enumerator_t*(*)(auth_cfg_t*))create_enumerator;
@@ -760,9 +760,9 @@ auth_cfg_t *auth_cfg_create()
        this->public.equals = (bool(*)(auth_cfg_t*, auth_cfg_t *other))equals;
        this->public.clone = (auth_cfg_t*(*)(auth_cfg_t*))clone_;
        this->public.destroy = (void(*)(auth_cfg_t*))destroy;
-       
+
        this->entries = linked_list_create();
-       
+
        return &this->public;
 }
 
index c6bc195..5e6215a 100644 (file)
@@ -41,7 +41,7 @@ typedef enum auth_rule_t auth_rule_t;
  * to transport credentials during the authentication process.
  */
 enum auth_rule_t {
-       
+
        /** identity to use for IKEv2 authentication exchange, identification_t* */
        AUTH_RULE_IDENTITY,
        /** authentication class, auth_class_t */
@@ -64,7 +64,7 @@ enum auth_rule_t {
        AUTH_RULE_OCSP_VALIDATION,
        /** subject is in attribute certificate group, identification_t* */
        AUTH_RULE_AC_GROUP,
-       
+
        /** intermediate certificate, certificate_t* */
        AUTH_HELPER_IM_CERT,
        /** subject certificate, certificate_t* */
@@ -86,7 +86,7 @@ extern enum_name_t *auth_rule_names;
  * RFC4739 defines multiple authentication rounds. This class defines such
  * a round from a configuration perspective, either for the local or the remote
  * peer. Local config are called "rulesets", as they define how we authenticate.
- * Remote peer configs are called "constraits", they define what is needed to 
+ * Remote peer configs are called "constraits", they define what is needed to
  * complete the authentication round successfully.
  *
  * @verbatim
@@ -122,7 +122,7 @@ struct auth_cfg_t {
         * @param ...           associated value to rule
         */
        void (*add)(auth_cfg_t *this, auth_rule_t rule, ...);
-       
+
        /**
         * Get an rule value.
         *
@@ -130,14 +130,14 @@ struct auth_cfg_t {
         * @return                      bool if item has been found
         */
        void* (*get)(auth_cfg_t *this, auth_rule_t rule);
-       
+
        /**
         * Create an enumerator over added rules.
         *
         * @return                      enumerator over (auth_rule_t, union{void*,uintpr_t})
         */
        enumerator_t* (*create_enumerator)(auth_cfg_t *this);
-       
+
        /**
         * Replace an rule at enumerator position.
         *
@@ -147,7 +147,7 @@ struct auth_cfg_t {
         */
        void (*replace)(auth_cfg_t *this, enumerator_t *pos,
                                        auth_rule_t rule, ...);
-       
+
        /**
         * Check if a used config fulfills a set of configured constraints.
         *
@@ -156,7 +156,7 @@ struct auth_cfg_t {
         * @return                              TRUE if this complies with constraints
         */
        bool (*complies)(auth_cfg_t *this, auth_cfg_t *constraints, bool log_error);
-       
+
        /**
         * Merge items from other into this.
         *
@@ -164,14 +164,14 @@ struct auth_cfg_t {
         * @param copy          TRUE to copy items, FALSE to move them
         */
        void (*merge)(auth_cfg_t *this, auth_cfg_t *other, bool copy);
-       
+
        /**
         * Purge all rules in a config.
         *
         * @param keep_ca       wheter to keep AUTH_RULE_CA_CERT entries
         */
        void (*purge)(auth_cfg_t *this, bool keep_ca);
-       
+
        /**
         * Check two configs for equality.
         *
@@ -179,14 +179,14 @@ struct auth_cfg_t {
         * @return                      TRUE if auth infos identical
         */
        bool (*equals)(auth_cfg_t *this, auth_cfg_t *other);
-       
+
        /**
         * Clone a authentication config, including all rules.
         *
         * @return                      cloned configuration
         */
        auth_cfg_t* (*clone)(auth_cfg_t *this);
-       
+
        /**
         * Destroy a config with all associated rules/values.
         */
index cfd6118..f6cbff4 100644 (file)
@@ -34,12 +34,12 @@ struct private_backend_manager_t {
         * Public part of backend_manager_t object.
         */
        backend_manager_t public;
-       
+
        /**
         * list of registered backends
         */
        linked_list_t *backends;
-       
+
        /**
         * rwlock for backends
         */
@@ -80,7 +80,7 @@ static ike_cfg_match_t get_ike_match(ike_cfg_t *cand, host_t *me, host_t *other)
 {
        host_t *me_cand, *other_cand;
        ike_cfg_match_t match = MATCH_NONE;
-       
+
        if (me)
        {
                me_cand = host_create_from_dns(cand->get_my_addr(cand),
@@ -103,7 +103,7 @@ static ike_cfg_match_t get_ike_match(ike_cfg_t *cand, host_t *me, host_t *other)
        {
                match += MATCH_ANY;
        }
-       
+
        if (other)
        {
                other_cand = host_create_from_dns(cand->get_other_addr(cand),
@@ -132,21 +132,21 @@ static ike_cfg_match_t get_ike_match(ike_cfg_t *cand, host_t *me, host_t *other)
 /**
  * implements backend_manager_t.get_ike_cfg.
  */
-static ike_cfg_t *get_ike_cfg(private_backend_manager_t *this, 
+static ike_cfg_t *get_ike_cfg(private_backend_manager_t *this,
                                                          host_t *me, host_t *other)
 {
        ike_cfg_t *current, *found = NULL;
        enumerator_t *enumerator;
        ike_cfg_match_t match, best = MATCH_ANY;
        ike_data_t *data;
-       
+
        data = malloc_thing(ike_data_t);
        data->this = this;
        data->me = me;
        data->other = other;
-       
+
        DBG2(DBG_CFG, "looking for an ike config for %H...%H", me, other);
-       
+
        this->lock->read_lock(this->lock);
        enumerator = enumerator_create_nested(
                                                this->backends->create_enumerator(this->backends),
@@ -154,11 +154,11 @@ static ike_cfg_t *get_ike_cfg(private_backend_manager_t *this,
        while (enumerator->enumerate(enumerator, (void**)&current))
        {
                match = get_ike_match(current, me, other);
-               
+
                if (match)
                {
-                       DBG2(DBG_CFG, "  candidate: %s...%s, prio %d", 
-                                current->get_my_addr(current), 
+                       DBG2(DBG_CFG, "  candidate: %s...%s, prio %d",
+                                current->get_my_addr(current),
                                 current->get_other_addr(current), match);
                        if (match > best)
                        {
@@ -173,7 +173,7 @@ static ike_cfg_t *get_ike_cfg(private_backend_manager_t *this,
        this->lock->unlock(this->lock);
        if (found)
        {
-               DBG2(DBG_CFG, "found matching ike config: %s...%s with prio %d", 
+               DBG2(DBG_CFG, "found matching ike config: %s...%s with prio %d",
                         found->get_my_addr(found), found->get_other_addr(found), best);
        }
        return found;
@@ -189,12 +189,12 @@ static id_match_t get_peer_match(identification_t *id,
        auth_cfg_t *auth;
        identification_t *candidate;
        id_match_t match = ID_MATCH_NONE;
-       
+
        if (!id)
        {
                return ID_MATCH_ANY;
        }
-       
+
        /* compare first auth config only */
        enumerator = cfg->create_auth_cfg_enumerator(cfg, local);
        if (enumerator->enumerate(enumerator, &auth))
@@ -269,7 +269,7 @@ static bool peer_enum_filter(linked_list_t *configs,
 static void peer_enum_filter_destroy(linked_list_t *configs)
 {
        match_entry_t *entry;
-       
+
        while (configs->remove_last(configs, (void**)&entry) == SUCCESS)
        {
                entry->cfg->destroy(entry->cfg);
@@ -285,7 +285,7 @@ static void insert_sorted(match_entry_t *entry, linked_list_t *list,
                                                  linked_list_t *helper)
 {
        match_entry_t *current;
-       
+
        while (list->remove_first(list, (void**)&current) == SUCCESS)
        {
                helper->insert_last(helper, current);
@@ -311,7 +311,7 @@ static void insert_sorted(match_entry_t *entry, linked_list_t *list,
 
 /**
  * Implements backend_manager_t.create_peer_cfg_enumerator.
- */                    
+ */
 static enumerator_t *create_peer_cfg_enumerator(private_backend_manager_t *this,
                                                        host_t *me, host_t *other, identification_t *my_id,
                                                        identification_t *other_id)
@@ -320,26 +320,26 @@ static enumerator_t *create_peer_cfg_enumerator(private_backend_manager_t *this,
        peer_data_t *data;
        peer_cfg_t *cfg;
        linked_list_t *configs, *helper;
-       
+
        data = malloc_thing(peer_data_t);
        data->lock = this->lock;
        data->me = my_id;
        data->other = other_id;
-       
+
        /* create a sorted list with all matches */
        this->lock->read_lock(this->lock);
        enumerator = enumerator_create_nested(
                                        this->backends->create_enumerator(this->backends),
                                        (void*)peer_enum_create, data, (void*)peer_enum_destroy);
-       
+
        if (!me && !other && !my_id && !other_id)
        {       /* shortcut if we are doing a "listall" */
                return enumerator;
        }
-       
+
        DBG1(DBG_CFG, "looking for peer configs matching %H[%Y]...%H[%Y]",
                 me, my_id, other, other_id);
-       
+
        configs = linked_list_create();
        /* only once allocated helper list for sorting */
        helper = linked_list_create();
@@ -348,16 +348,16 @@ static enumerator_t *create_peer_cfg_enumerator(private_backend_manager_t *this,
                id_match_t match_peer_me, match_peer_other;
                ike_cfg_match_t match_ike;
                match_entry_t *entry;
-               
+
                match_peer_me = get_peer_match(my_id, cfg, TRUE);
                match_peer_other = get_peer_match(other_id, cfg, FALSE);
                match_ike = get_ike_match(cfg->get_ike_cfg(cfg), me, other);
-               
+
                if (match_peer_me && match_peer_other && match_ike)
                {
                        DBG2(DBG_CFG, "  candidate \"%s\", match: %d/%d/%d (me/other/ike)",
                                 cfg->get_name(cfg), match_peer_me, match_peer_other, match_ike);
-                       
+
                        entry = malloc_thing(match_entry_t);
                        entry->match_peer = match_peer_me + match_peer_other;
                        entry->match_ike = match_ike;
@@ -367,7 +367,7 @@ static enumerator_t *create_peer_cfg_enumerator(private_backend_manager_t *this,
        }
        enumerator->destroy(enumerator);
        helper->destroy(helper);
-       
+
        return enumerator_create_filter(configs->create_enumerator(configs),
                                                                        (void*)peer_enum_filter, configs,
                                                                        (void*)peer_enum_filter_destroy);
@@ -375,13 +375,13 @@ static enumerator_t *create_peer_cfg_enumerator(private_backend_manager_t *this,
 
 /**
  * implements backend_manager_t.get_peer_cfg_by_name.
- */                    
+ */
 static peer_cfg_t *get_peer_cfg_by_name(private_backend_manager_t *this, char *name)
 {
        backend_t *backend;
        peer_cfg_t *config = NULL;
        enumerator_t *enumerator;
-       
+
        this->lock->read_lock(this->lock);
        enumerator = this->backends->create_enumerator(this->backends);
        while (config == NULL && enumerator->enumerate(enumerator, (void**)&backend))
@@ -429,17 +429,17 @@ static void destroy(private_backend_manager_t *this)
 backend_manager_t *backend_manager_create()
 {
        private_backend_manager_t *this = malloc_thing(private_backend_manager_t);
-       
+
        this->public.get_ike_cfg = (ike_cfg_t* (*)(backend_manager_t*, host_t*, host_t*))get_ike_cfg;
        this->public.get_peer_cfg_by_name = (peer_cfg_t* (*)(backend_manager_t*,char*))get_peer_cfg_by_name;
        this->public.create_peer_cfg_enumerator = (enumerator_t* (*)(backend_manager_t*,host_t*,host_t*,identification_t*,identification_t*))create_peer_cfg_enumerator;
        this->public.add_backend = (void(*)(backend_manager_t*, backend_t *backend))add_backend;
        this->public.remove_backend = (void(*)(backend_manager_t*, backend_t *backend))remove_backend;
        this->public.destroy = (void (*)(backend_manager_t*))destroy;
-       
+
        this->backends = linked_list_create();
        this->lock = rwlock_create(RWLOCK_TYPE_DEFAULT);
-       
+
        return &this->public;
 }
 
index 0b7d7d0..5b394f7 100644 (file)
@@ -46,11 +46,11 @@ typedef struct backend_manager_t backend_manager_t;
    |         |----->|           |     +--------------+         |
    |         |      |           |                              |
    +---------+      +-----------+                              |
-   
+
    @endverbatim
  */
 struct backend_manager_t {
-       
+
        /**
         * Get an ike_config identified by two hosts.
         *
@@ -58,9 +58,9 @@ struct backend_manager_t {
         * @param other_host            address of remote host
         * @return                                      matching ike_config, or NULL if none found
         */
-       ike_cfg_t* (*get_ike_cfg)(backend_manager_t *this, 
+       ike_cfg_t* (*get_ike_cfg)(backend_manager_t *this,
                                                          host_t *my_host, host_t *other_host);
-       
+
        /**
         * Get a peer_config identified by it's name.
         *
@@ -68,7 +68,7 @@ struct backend_manager_t {
         * @return                                      matching peer_config, or NULL if none found
         */
        peer_cfg_t* (*get_peer_cfg_by_name)(backend_manager_t *this, char *name);
-       
+
        /**
         * Create an enumerator over all matching peer configs.
         *
@@ -90,14 +90,14 @@ struct backend_manager_t {
         * @param backend                       backend to register
         */
        void (*add_backend)(backend_manager_t *this, backend_t *backend);
-       
+
        /**
         * Unregister a backend.
         *
         * @param backend                       backend to unregister
         */
        void (*remove_backend)(backend_manager_t *this, backend_t *backend);
-       
+
        /**
         * Destroys a backend_manager_t object.
         */
index 05c47f7..036a250 100644 (file)
@@ -25,7 +25,7 @@ ENUM(action_names, ACTION_NONE, ACTION_RESTART,
        "restart",
 );
 
-ENUM_BEGIN(ipcomp_transform_names, IPCOMP_NONE, IPCOMP_NONE, 
+ENUM_BEGIN(ipcomp_transform_names, IPCOMP_NONE, IPCOMP_NONE,
        "IPCOMP_NONE");
 ENUM_NEXT(ipcomp_transform_names, IPCOMP_OUI, IPCOMP_LZJH, IPCOMP_NONE,
        "IPCOMP_OUI",
@@ -45,62 +45,62 @@ struct private_child_cfg_t {
         * Public part
         */
        child_cfg_t public;
-       
+
        /**
         * Number of references hold by others to this child_cfg
         */
        refcount_t refcount;
-       
+
        /**
         * Name of the child_cfg, used to query it
         */
        char *name;
-       
+
        /**
         * list for all proposals
         */
        linked_list_t *proposals;
-       
+
        /**
         * list for traffic selectors for my site
         */
        linked_list_t *my_ts;
-       
+
        /**
         * list for traffic selectors for others site
         */
        linked_list_t *other_ts;
-       
+
        /**
         * updown script
         */
        char *updown;
-       
+
        /**
         * allow host access
         */
        bool hostaccess;
-       
+
        /**
         * Mode to propose for a initiated CHILD: tunnel/transport
         */
        ipsec_mode_t mode;
-       
+
        /**
         * action to take on DPD
         */
        action_t dpd_action;
-       
+
        /**
         * action to take on CHILD_SA close
         */
        action_t close_action;
-       
+
        /**
         * CHILD_SA lifetime config
         */
        lifetime_cfg_t lifetime;
-       
+
        /**
         * enable IPComp
         */
@@ -141,7 +141,7 @@ static linked_list_t* get_proposals(private_child_cfg_t *this, bool strip_dh)
        enumerator_t *enumerator;
        proposal_t *current;
        linked_list_t *proposals = linked_list_create();
-       
+
        enumerator = this->proposals->create_enumerator(this->proposals);
        while (enumerator->enumerate(enumerator, &current))
        {
@@ -153,7 +153,7 @@ static linked_list_t* get_proposals(private_child_cfg_t *this, bool strip_dh)
                proposals->insert_last(proposals, current);
        }
        enumerator->destroy(enumerator);
-       
+
        return proposals;
 }
 
@@ -165,10 +165,10 @@ static proposal_t* select_proposal(private_child_cfg_t*this,
 {
        enumerator_t *stored_enum, *supplied_enum;
        proposal_t *stored, *supplied, *selected = NULL;
-       
+
        stored_enum = this->proposals->create_enumerator(this->proposals);
        supplied_enum = proposals->create_enumerator(proposals);
-       
+
        /* compare all stored proposals with all supplied. Stored ones are preferred. */
        while (stored_enum->enumerate(stored_enum, &stored))
        {
@@ -194,7 +194,7 @@ static proposal_t* select_proposal(private_child_cfg_t*this,
                        break;
                }
                supplied_enum->destroy(supplied_enum);
-               supplied_enum = proposals->create_enumerator(proposals);        
+               supplied_enum = proposals->create_enumerator(proposals);
        }
        stored_enum->destroy(stored_enum);
        supplied_enum->destroy(supplied_enum);
@@ -232,7 +232,7 @@ static linked_list_t* get_traffic_selectors(private_child_cfg_t *this, bool loca
        enumerator_t *e1, *e2;
        traffic_selector_t *ts1, *ts2, *selected;
        linked_list_t *result = linked_list_create();
-       
+
        if (local)
        {
                e1 = this->my_ts->create_enumerator(this->my_ts);
@@ -241,11 +241,11 @@ static linked_list_t* get_traffic_selectors(private_child_cfg_t *this, bool loca
        {
                e1 = this->other_ts->create_enumerator(this->other_ts);
        }
-       
+
        /* no list supplied, just fetch the stored traffic selectors */
        if (supplied == NULL)
        {
-               DBG2(DBG_CFG, "proposing traffic selectors for %s:", 
+               DBG2(DBG_CFG, "proposing traffic selectors for %s:",
                         local ? "us" : "other");
                while (e1->enumerate(e1, &ts1))
                {
@@ -262,7 +262,7 @@ static linked_list_t* get_traffic_selectors(private_child_cfg_t *this, bool loca
        }
        else
        {
-               DBG2(DBG_CFG, "selecting traffic selectors for %s:", 
+               DBG2(DBG_CFG, "selecting traffic selectors for %s:",
                         local ? "us" : "other");
                e2 = supplied->create_enumerator(supplied);
                /* iterate over all stored selectors */
@@ -274,7 +274,7 @@ static linked_list_t* get_traffic_selectors(private_child_cfg_t *this, bool loca
                        {
                                ts1->set_address(ts1, host);
                        }
-                       
+
                        /* iterate over all supplied traffic selectors */
                        while (e2->enumerate(e2, &ts2))
                        {
@@ -298,7 +298,7 @@ static linked_list_t* get_traffic_selectors(private_child_cfg_t *this, bool loca
                e1->destroy(e1);
                e2->destroy(e2);
        }
-       
+
        /* remove any redundant traffic selectors in the list */
        e1 = result->create_enumerator(result);
        e2 = result->create_enumerator(result);
@@ -329,7 +329,7 @@ static linked_list_t* get_traffic_selectors(private_child_cfg_t *this, bool loca
        }
        e1->destroy(e1);
        e2->destroy(e2);
-       
+
        return result;
 }
 
@@ -410,7 +410,7 @@ static diffie_hellman_group_t get_dh_group(private_child_cfg_t *this)
        enumerator_t *enumerator;
        proposal_t *proposal;
        u_int16_t dh_group = MODP_NONE;
-       
+
        enumerator = this->proposals->create_enumerator(this->proposals);
        while (enumerator->enumerate(enumerator, &proposal))
        {
@@ -514,16 +514,16 @@ child_cfg_t *child_cfg_create(char *name, lifetime_cfg_t *lifetime,
        this->public.install_policy = (bool (*) (child_cfg_t *))install_policy;
        this->public.get_ref = (child_cfg_t* (*) (child_cfg_t*))get_ref;
        this->public.destroy = (void (*) (child_cfg_t*))destroy;
-       
+
        this->name = strdup(name);
        this->updown = updown ? strdup(updown) : NULL;
        this->hostaccess = hostaccess;
        this->mode = mode;
        this->dpd_action = dpd_action;
        this->close_action = close_action;
-       this->use_ipcomp = ipcomp; 
+       this->use_ipcomp = ipcomp;
        this->proxy_mode = FALSE;
-       this->install_policy = TRUE; 
+       this->install_policy = TRUE;
        this->refcount = 1;
        this->proposals = linked_list_create();
        this->my_ts = linked_list_create();
index 492514e..becee81 100644 (file)
@@ -88,68 +88,68 @@ struct lifetime_cfg_t {
  * After creation, proposals and traffic selectors may be added to the config.
  * A child_cfg object is referenced multiple times, and is not thread save.
  * Reading from the object is save, adding things is not allowed while other
- * threads may access the object. 
+ * threads may access the object.
  * A reference counter handles the number of references hold to this config.
  *
  * @see peer_cfg_t to get an overview over the configurations.
  */
 struct child_cfg_t {
-       
+
        /**
         * Get the name of the child_cfg.
-        * 
+        *
         * @return                              child_cfg's name
         */
        char *(*get_name) (child_cfg_t *this);
-       
+
        /**
-        * Add a proposal to the list. 
-        * 
+        * Add a proposal to the list.
+        *
         * The proposals are stored by priority, first added
         * is the most prefered.
         * After add, proposal is owned by child_cfg.
-        * 
+        *
         * @param proposal              proposal to add
         */
        void (*add_proposal) (child_cfg_t *this, proposal_t *proposal);
-       
+
        /**
         * Get the list of proposals for the CHILD_SA.
         *
         * Resulting list and all of its proposals must be freed after use.
-        * 
+        *
         * @param strip_dh              TRUE strip out diffie hellman groups
         * @return                              list of proposals
         */
        linked_list_t* (*get_proposals)(child_cfg_t *this, bool strip_dh);
-       
+
        /**
         * Select a proposal from a supplied list.
         *
         * Returned propsal is newly created and must be destroyed after usage.
-        * 
+        *
         * @param proposals             list from from wich proposals are selected
         * @param strip_dh              TRUE strip out diffie hellman groups
         * @return                              selected proposal, or NULL if nothing matches
         */
        proposal_t* (*select_proposal)(child_cfg_t*this, linked_list_t *proposals,
                                                                   bool strip_dh);
-       
+
        /**
         * Add a traffic selector to the config.
-        * 
+        *
         * Use the "local" parameter to add it for the local or the remote side.
         * After add, traffic selector is owned by child_cfg.
-        * 
+        *
         * @param local                 TRUE for local side, FALSE for remote
         * @param ts                    traffic_selector to add
         */
        void (*add_traffic_selector)(child_cfg_t *this, bool local,
                                                                 traffic_selector_t *ts);
-       
+
        /**
         * Get a list of traffic selectors to use for the CHILD_SA.
-        * 
+        *
         * The config contains two set of traffic selectors, one for the local
         * side, one for the remote side.
         * If a list with traffic selectors is supplied, these are used to narrow
@@ -158,7 +158,7 @@ struct child_cfg_t {
         * to a specific address (host-to-host or virtual-IP setups). Use
         * the "host" parameter to narrow such traffic selectors to that address.
         * Resulted list and its traffic selectors must be destroyed after use.
-        * 
+        *
         * @param local                 TRUE for TS on local side, FALSE for remote
         * @param supplied              list with TS to select from, or NULL
         * @param host                  address to use for narrowing "dynamic" TS', or NULL
@@ -169,14 +169,14 @@ struct child_cfg_t {
                                                                                        host_t *host);
        /**
         * Get the updown script to run for the CHILD_SA.
-        * 
+        *
         * @return                              path to updown script
         */
        char* (*get_updown)(child_cfg_t *this);
-       
+
        /**
         * Should we allow access to the local host (gateway)?
-        * 
+        *
         * @return                              value of hostaccess flag
         */
        bool (*get_hostaccess) (child_cfg_t *this);
@@ -190,41 +190,41 @@ struct child_cfg_t {
         * @return                              lifetime_cfg_t (has to be freed)
         */
        lifetime_cfg_t* (*get_lifetime) (child_cfg_t *this);
-       
+
        /**
         * Get the mode to use for the CHILD_SA.
         *
         * The mode is either tunnel, transport or BEET. The peer must agree
         * on the method, fallback is tunnel mode.
-        * 
+        *
         * @return                              ipsec mode
         */
        ipsec_mode_t (*get_mode) (child_cfg_t *this);
-       
+
        /**
         * Action to take on DPD.
         *
         * @return                              DPD action
-        */     
+        */
        action_t (*get_dpd_action) (child_cfg_t *this);
-       
+
        /**
         * Action to take if CHILD_SA gets closed.
         *
         * @return                              close action
-        */     
+        */
        action_t (*get_close_action) (child_cfg_t *this);
-       
+
        /**
         * Get the DH group to use for CHILD_SA setup.
-        * 
+        *
         * @return                              dh group to use
         */
        diffie_hellman_group_t (*get_dh_group)(child_cfg_t *this);
-       
+
        /**
         * Check whether IPComp should be used, if the other peer supports it.
-        * 
+        *
         * @return                              TRUE, if IPComp should be used
         *                                              FALSE, otherwise
         */
@@ -232,7 +232,7 @@ struct child_cfg_t {
 
        /**
         * Sets two options needed for Mobile IPv6 interoperability
-        * 
+        *
         * @param proxy_mode    use IPsec transport proxy mode (default FALSE)
         * @param install_policy install IPsec kernel policies (default TRUE)
         */
@@ -241,27 +241,27 @@ struct child_cfg_t {
 
        /**
         * Check whether IPsec transport SA should be set up in proxy mode
-        * 
+        *
         * @return                              TRUE, if proxy mode should be used
         *                                              FALSE, otherwise
         */
        bool (*use_proxy_mode)(child_cfg_t *this);
-       
+
        /**
         * Check whether IPsec policies should be installed in the kernel
-        * 
+        *
         * @return                              TRUE, if IPsec kernel policies should be installed
         *                                              FALSE, otherwise
         */
        bool (*install_policy)(child_cfg_t *this);
-       
+
        /**
         * Increase the reference count.
         *
         * @return                              reference to this
         */
        child_cfg_t* (*get_ref) (child_cfg_t *this);
-       
+
        /**
         * Destroys the child_cfg object.
         *
@@ -273,7 +273,7 @@ struct child_cfg_t {
 
 /**
  * Create a configuration template for CHILD_SA setup.
- * 
+ *
  * The "name" string gets cloned.
  *
  * The lifetime_cfg_t object gets cloned.
@@ -281,7 +281,7 @@ struct child_cfg_t {
  * specified. Rekeying of an SA starts at (x.rekey - random(0, x.jitter)).
  *
  * After a call to create, a reference is obtained (refcount = 1).
- * 
+ *
  * @param name                         name of the child_cfg
  * @param lifetime                     lifetime_cfg_t for this child_cfg
  * @param updown                       updown script to execute on up/down event
index e80ab57..c2ebf64 100644 (file)
@@ -32,7 +32,7 @@ struct private_ike_cfg_t {
         * Public part
         */
        ike_cfg_t public;
-       
+
        /**
         * Number of references hold by others to this ike_cfg
         */
@@ -45,19 +45,19 @@ struct private_ike_cfg_t {
 
        /**
         * Address of remote host
-        */     
+        */
        char *other;
-       
+
        /**
         * should we send a certificate request?
         */
        bool certreq;
-       
+
        /**
         * enforce UDP encapsulation
         */
        bool force_encap;
-       
+
        /**
         * List of proposals to use
         */
@@ -71,7 +71,7 @@ static bool send_certreq(private_ike_cfg_t *this)
 {
        return this->certreq;
 }
-       
+
 /**
  * Implementation of ike_cfg_t.force_encap.
  */
@@ -112,7 +112,7 @@ static linked_list_t* get_proposals(private_ike_cfg_t *this)
        iterator_t *iterator;
        proposal_t *current;
        linked_list_t *proposals = linked_list_create();
-       
+
        iterator = this->proposals->create_iterator(this->proposals, TRUE);
        while (iterator->iterate(iterator, (void**)&current))
        {
@@ -120,10 +120,10 @@ static linked_list_t* get_proposals(private_ike_cfg_t *this)
                proposals->insert_last(proposals, (void*)current);
        }
        iterator->destroy(iterator);
-       
+
        return proposals;
 }
-       
+
 /**
  * Implementation of ike_cfg_t.select_proposal.
  */
@@ -132,16 +132,16 @@ static proposal_t *select_proposal(private_ike_cfg_t *this,
 {
        iterator_t *stored_iter, *supplied_iter;
        proposal_t *stored, *supplied, *selected;
-       
+
        stored_iter = this->proposals->create_iterator(this->proposals, TRUE);
        supplied_iter = proposals->create_iterator(proposals, TRUE);
-       
-       
+
+
        /* compare all stored proposals with all supplied. Stored ones are preferred.*/
        while (stored_iter->iterate(stored_iter, (void**)&stored))
        {
                supplied_iter->reset(supplied_iter);
-               
+
                while (supplied_iter->iterate(supplied_iter, (void**)&supplied))
                {
                        selected = stored->select(stored, supplied);
@@ -162,7 +162,7 @@ static proposal_t *select_proposal(private_ike_cfg_t *this,
        supplied_iter->destroy(supplied_iter);
        DBG1(DBG_CFG, "received proposals: %#P", proposals);
        DBG1(DBG_CFG, "configured proposals: %#P", this->proposals);
-       
+
        return NULL;
 }
 
@@ -174,7 +174,7 @@ static diffie_hellman_group_t get_dh_group(private_ike_cfg_t *this)
        enumerator_t *enumerator;
        proposal_t *proposal;
        u_int16_t dh_group = MODP_NONE;
-       
+
        enumerator = this->proposals->create_enumerator(this->proposals);
        while (enumerator->enumerate(enumerator, &proposal))
        {
@@ -195,7 +195,7 @@ static bool equals(private_ike_cfg_t *this, private_ike_cfg_t *other)
        enumerator_t *e1, *e2;
        proposal_t *p1, *p2;
        bool eq = TRUE;
-       
+
        if (this == other)
        {
                return TRUE;
@@ -260,7 +260,7 @@ ike_cfg_t *ike_cfg_create(bool certreq, bool force_encap,
                                                  char *me, char *other)
 {
        private_ike_cfg_t *this = malloc_thing(private_ike_cfg_t);
-       
+
        /* public functions */
        this->public.send_certreq = (bool(*)(ike_cfg_t*))send_certreq;
        this->public.force_encap = (bool (*) (ike_cfg_t *))force_encap_meth;
@@ -273,7 +273,7 @@ ike_cfg_t *ike_cfg_create(bool certreq, bool force_encap,
        this->public.equals = (bool(*)(ike_cfg_t*,ike_cfg_t*)) equals;
        this->public.get_ref = (ike_cfg_t*(*)(ike_cfg_t*))get_ref;
        this->public.destroy = (void(*)(ike_cfg_t*))destroy;
-       
+
        /* private variables */
        this->refcount = 1;
        this->certreq = certreq;
@@ -281,6 +281,6 @@ ike_cfg_t *ike_cfg_create(bool certreq, bool force_encap,
        this->me = strdup(me);
        this->other = strdup(other);
        this->proposals = linked_list_create();
-       
+
        return &this->public;
 }
index 0649064..8b68af3 100644 (file)
@@ -37,71 +37,71 @@ typedef struct ike_cfg_t ike_cfg_t;
  * @see peer_cfg_t to get an overview over the configurations.
  */
 struct ike_cfg_t {
-       
+
        /**
         * Get own address.
-        * 
+        *
         * @return              string of address/DNS name
         */
        char* (*get_my_addr) (ike_cfg_t *this);
 
        /**
         * Get peers address.
-        * 
+        *
         * @return              string of address/DNS name
         */
        char* (*get_other_addr) (ike_cfg_t *this);
-       
+
        /**
         * Adds a proposal to the list.
-        * 
+        *
         * The first added proposal has the highest priority, the last
         * added the lowest.
-        * 
+        *
         * @param proposal      proposal to add
         */
        void (*add_proposal) (ike_cfg_t *this, proposal_t *proposal);
-       
+
        /**
         * Returns a list of all supported proposals.
-        * 
+        *
         * Returned list and its proposals must be destroyed after use.
-        * 
+        *
         * @return                      list containing all the proposals
         */
        linked_list_t* (*get_proposals) (ike_cfg_t *this);
-       
+
        /**
         * Select a proposed from suggested proposals.
-        * 
+        *
         * Returned proposal must be destroyed after use.
-        * 
+        *
         * @param proposals     list of proposals to select from
         * @return                      selected proposal, or NULL if none matches.
         */
        proposal_t *(*select_proposal) (ike_cfg_t *this, linked_list_t *proposals);
-       
+
        /**
         * Should we send a certificate request in IKE_SA_INIT?
         *
         * @return                      certificate request sending policy
         */
        bool (*send_certreq) (ike_cfg_t *this);
-       
+
        /**
         * Enforce UDP encapsulation by faking NATD notifies?
-        * 
+        *
         * @return                      TRUE to enfoce UDP encapsulation
         */
        bool (*force_encap) (ike_cfg_t *this);
-       
+
        /**
         * Get the DH group to use for IKE_SA setup.
-        * 
+        *
         * @return                      dh group to use for initialization
         */
        diffie_hellman_group_t (*get_dh_group)(ike_cfg_t *this);
-       
+
        /**
         * Check if two IKE configs are equal.
         *
@@ -109,17 +109,17 @@ struct ike_cfg_t {
         * @return                      TRUE if other equal to this
         */
        bool (*equals)(ike_cfg_t *this, ike_cfg_t *other);
-       
+
        /**
         * Increase reference count.
         *
         * @return                      reference to this
         */
        ike_cfg_t* (*get_ref) (ike_cfg_t *this);
-       
+
        /**
         * Destroys a ike_cfg_t object.
-        * 
+        *
         * Decrements the internal reference counter and
         * destroys the ike_cfg when it reaches zero.
         */
@@ -137,7 +137,7 @@ struct ike_cfg_t {
  * @param other                        address/DNS name of remote peer
  * @return                             ike_cfg_t object.
  */
-ike_cfg_t *ike_cfg_create(bool certreq, bool force_encap, 
+ike_cfg_t *ike_cfg_create(bool certreq, bool force_encap,
                                                  char *me, char *other);
 
 #endif /** IKE_CFG_H_ @}*/
index b2d2991..df946b7 100644 (file)
@@ -48,113 +48,113 @@ struct private_peer_cfg_t {
         * Public part
         */
        peer_cfg_t public;
-       
+
        /**
         * Number of references hold by others to this peer_cfg
         */
        refcount_t refcount;
-       
+
        /**
         * Name of the peer_cfg, used to query it
         */
        char *name;
-       
+
        /**
         * IKE version to use for initiation
         */
        u_int ike_version;
-       
+
        /**
         * IKE config associated to this peer config
         */
        ike_cfg_t *ike_cfg;
-       
+
        /**
         * list of child configs associated to this peer config
         */
        linked_list_t *child_cfgs;
-       
+
        /**
         * mutex to lock access to list of child_cfgs
         */
        mutex_t *mutex;
-       
+
        /**
         * should we send a certificate
         */
        cert_policy_t cert_policy;
-       
+
        /**
         * uniqueness of an IKE_SA
         */
        unique_policy_t unique;
-       
+
        /**
         * number of tries after giving up if peer does not respond
         */
        u_int32_t keyingtries;
-       
+
        /**
         * enable support for MOBIKE
         */
        bool use_mobike;
-       
+
        /**
         * Time before starting rekeying
         */
        u_int32_t rekey_time;
-       
+
        /**
         * Time before starting reauthentication
         */
        u_int32_t reauth_time;
-       
+
        /**
         * Time, which specifies the range of a random value substracted from above.
         */
        u_int32_t jitter_time;
-       
+
        /**
         * Delay before deleting a rekeying/reauthenticating SA
         */
        u_int32_t over_time;
-       
+
        /**
         * DPD check intervall
         */
        u_int32_t dpd;
-       
+
        /**
         * virtual IP to use locally
         */
        host_t *virtual_ip;
-       
+
        /**
         * pool to acquire configuration attributes from
         */
        char *pool;
-       
+
        /**
         * local authentication configs (rulesets)
         */
        linked_list_t *local_auth;
-       
+
        /**
         * remote authentication configs (constraints)
         */
        linked_list_t *remote_auth;
-       
+
 #ifdef ME
        /**
         * Is this a mediation connection?
         */
        bool mediation;
-       
+
        /**
         * Name of the mediation connection to mediate through
         */
        peer_cfg_t *mediated_by;
-       
+
        /**
         * ID of our peer at the mediation server (= leftid of the peer's conn with
         * the mediation server)
@@ -239,12 +239,12 @@ static bool child_cfg_enumerate(child_cfg_enumerator_t *this, child_cfg_t **chd)
 static enumerator_t* create_child_cfg_enumerator(private_peer_cfg_t *this)
 {
        child_cfg_enumerator_t *enumerator = malloc_thing(child_cfg_enumerator_t);
-       
+
        enumerator->public.enumerate = (void*)child_cfg_enumerate;
        enumerator->public.destroy = (void*)child_cfg_enumerator_destroy;
        enumerator->mutex = this->mutex;
        enumerator->wrapped = this->child_cfgs->create_enumerator(this->child_cfgs);
-       
+
        this->mutex->lock(this->mutex);
        return &enumerator->public;
 }
@@ -259,13 +259,13 @@ static int get_ts_match(child_cfg_t *cfg, bool local,
        enumerator_t *sup_enum, *cfg_enum;
        traffic_selector_t *sup_ts, *cfg_ts;
        int match = 0, round;
-       
+
        /* fetch configured TS list, narrowing dynamic TS */
        cfg_list = cfg->get_traffic_selectors(cfg, local, NULL, host);
-       
+
        /* use a round counter to rate leading TS with higher priority */
        round = sup_list->get_count(sup_list);
-       
+
        sup_enum = sup_list->create_enumerator(sup_list);
        while (sup_enum->enumerate(sup_enum, &sup_ts))
        {
@@ -286,9 +286,9 @@ static int get_ts_match(child_cfg_t *cfg, bool local,
                round--;
        }
        sup_enum->destroy(sup_enum);
-       
+
        cfg_list->destroy_offset(cfg_list, offsetof(traffic_selector_t, destroy));
-       
+
        return match;
 }
 
@@ -303,16 +303,16 @@ static child_cfg_t* select_child_cfg(private_peer_cfg_t *this,
        child_cfg_t *current, *found = NULL;
        enumerator_t *enumerator;
        int best = 0;
-       
+
        DBG2(DBG_CFG, "looking for a child config for %#R=== %#R", my_ts, other_ts);
        enumerator = create_child_cfg_enumerator(this);
        while (enumerator->enumerate(enumerator, &current))
        {
                int my_prio, other_prio;
-               
+
                my_prio = get_ts_match(current, TRUE, my_ts, my_host);
                other_prio = get_ts_match(current, FALSE, other_ts, other_host);
-               
+
                if (my_prio && other_prio)
                {
                        DBG2(DBG_CFG, "  candidate \"%s\" with prio %d+%d",
@@ -421,7 +421,7 @@ static host_t* get_virtual_ip(private_peer_cfg_t *this)
 {
        return this->virtual_ip;
 }
-       
+
 /**
  * Implementation of peer_cfg_t.get_pool.
  */
@@ -493,7 +493,7 @@ static bool auth_cfg_equal(private_peer_cfg_t *this, private_peer_cfg_t *other)
        enumerator_t *e1, *e2;
        auth_cfg_t *cfg1, *cfg2;
        bool equal = TRUE;
-       
+
        if (this->local_auth->get_count(this->local_auth) !=
                other->local_auth->get_count(other->local_auth))
        {
@@ -504,7 +504,7 @@ static bool auth_cfg_equal(private_peer_cfg_t *this, private_peer_cfg_t *other)
        {
                return FALSE;
        }
-       
+
        e1 = this->local_auth->create_enumerator(this->local_auth);
        e2 = other->local_auth->create_enumerator(other->local_auth);
        while (e1->enumerate(e1, &cfg1) && e2->enumerate(e2, &cfg2))
@@ -517,12 +517,12 @@ static bool auth_cfg_equal(private_peer_cfg_t *this, private_peer_cfg_t *other)
        }
        e1->destroy(e1);
        e2->destroy(e2);
-       
+
        if (!equal)
        {
                return FALSE;
        }
-       
+
        e1 = this->remote_auth->create_enumerator(this->remote_auth);
        e2 = other->remote_auth->create_enumerator(other->remote_auth);
        while (e1->enumerate(e1, &cfg1) && e2->enumerate(e2, &cfg2))
@@ -535,7 +535,7 @@ static bool auth_cfg_equal(private_peer_cfg_t *this, private_peer_cfg_t *other)
        }
        e1->destroy(e1);
        e2->destroy(e2);
-       
+
        return equal;
 }
 
@@ -552,7 +552,7 @@ static bool equals(private_peer_cfg_t *this, private_peer_cfg_t *other)
        {
                return FALSE;
        }
-       
+
        return (
                this->ike_version == other->ike_version &&
                this->cert_policy == other->cert_policy &&
@@ -657,7 +657,7 @@ peer_cfg_t *peer_cfg_create(char *name, u_int ike_version, ike_cfg_t *ike_cfg,
        this->public.get_mediated_by = (peer_cfg_t* (*) (peer_cfg_t *))get_mediated_by;
        this->public.get_peer_id = (identification_t* (*) (peer_cfg_t *))get_peer_id;
 #endif /* ME */
-       
+
        /* apply init values */
        this->name = strdup(name);
        this->ike_version = ike_version;
index e6f0db4..00c8a0c 100644 (file)
@@ -114,7 +114,7 @@ extern enum_name_t *unique_policy_names;
  * to gain access to the configuration.
  */
 struct peer_cfg_t {
-       
+
        /**
         * Get the name of the peer_cfg.
         *
@@ -123,42 +123,42 @@ struct peer_cfg_t {
         * @return                              peer_cfg's name
         */
        char* (*get_name) (peer_cfg_t *this);
-       
+
        /**
         * Get the IKE version to use for initiating.
         *
         * @return                              IKE major version
         */
        u_int (*get_ike_version)(peer_cfg_t *this);
-       
+
        /**
         * Get the IKE config to use for initiaton.
         *
         * @return                              the IKE config to use
         */
        ike_cfg_t* (*get_ike_cfg) (peer_cfg_t *this);
-       
+
        /**
         * Attach a CHILD config.
         *
         * @param child_cfg             CHILD config to add
         */
        void (*add_child_cfg) (peer_cfg_t *this, child_cfg_t *child_cfg);
-       
+
        /**
         * Detach a CHILD config, pointed to by an enumerator.
         *
         * @param enumerator    enumerator indicating element position
         */
        void (*remove_child_cfg)(peer_cfg_t *this, enumerator_t *enumerator);
-       
+
        /**
         * Create an enumerator for all attached CHILD configs.
         *
         * @return                              an enumerator over all CHILD configs.
         */
        enumerator_t* (*create_child_cfg_enumerator) (peer_cfg_t *this);
-       
+
        /**
         * Select a CHILD config from traffic selectors.
         *
@@ -171,7 +171,7 @@ struct peer_cfg_t {
        child_cfg_t* (*select_child_cfg) (peer_cfg_t *this, linked_list_t *my_ts,
                                                                          linked_list_t *other_ts, host_t *my_host,
                                                                          host_t *other_host);
-       
+
        /**
         * Add an authentication config to the peer configuration.
         *
@@ -179,7 +179,7 @@ struct peer_cfg_t {
         * @param local                 TRUE for local rules, FALSE for remote constraints
         */
        void (*add_auth_cfg)(peer_cfg_t *this, auth_cfg_t *cfg, bool local);
-       
+
        /**
         * Create an enumerator over registered authentication configs.
         *
@@ -201,49 +201,49 @@ struct peer_cfg_t {
         * @return                      unique policy
         */
        unique_policy_t (*get_unique_policy) (peer_cfg_t *this);
-       
+
        /**
         * Get the max number of retries after timeout.
         *
         * @return                      max number retries
         */
        u_int32_t (*get_keyingtries) (peer_cfg_t *this);
-       
+
        /**
         * Get a time to start rekeying (is randomized with jitter).
         *
         * @return                      time in s when to start rekeying, 0 disables rekeying
         */
        u_int32_t (*get_rekey_time)(peer_cfg_t *this);
-       
+
        /**
         * Get a time to start reauthentication (is randomized with jitter).
         *
         * @return                      time in s when to start reauthentication, 0 disables it
         */
        u_int32_t (*get_reauth_time)(peer_cfg_t *this);
-       
+
        /**
         * Get the timeout of a rekeying/reauthenticating SA.
         *
         * @return                      timeout in s
         */
        u_int32_t (*get_over_time)(peer_cfg_t *this);
-       
+
        /**
         * Use MOBIKE (RFC4555) if peer supports it?
         *
         * @return                      TRUE to enable MOBIKE support
         */
        bool (*use_mobike) (peer_cfg_t *this);
-       
+
        /**
         * Get the DPD check interval.
         *
         * @return                      dpd_delay in seconds
         */
        u_int32_t (*get_dpd) (peer_cfg_t *this);
-       
+
        /**
         * Get a virtual IP for the local peer.
         *
@@ -255,14 +255,14 @@ struct peer_cfg_t {
         * @return                              virtual IP, %any or NULL
         */
        host_t* (*get_virtual_ip) (peer_cfg_t *this);
-       
+
        /**
         * Get the name of the pool to acquire configuration attributes from.
         *
         * @return                              pool name, NULL if none defined
         */
        char* (*get_pool)(peer_cfg_t *this);
-       
+
 #ifdef ME
        /**
         * Is this a mediation connection?
@@ -270,14 +270,14 @@ struct peer_cfg_t {
         * @return                              TRUE, if this is a mediation connection
         */
        bool (*is_mediation) (peer_cfg_t *this);
-       
+
        /**
         * Get peer_cfg of the connection this one is mediated through.
         *
         * @return                              the peer_cfg of the mediation connection
         */
        peer_cfg_t* (*get_mediated_by) (peer_cfg_t *this);
-       
+
        /**
         * Get the id of the other peer at the mediation server.
         *
@@ -300,14 +300,14 @@ struct peer_cfg_t {
         * @return                              TRUE if peer_cfg and ike_cfg are equal
         */
        bool (*equals)(peer_cfg_t *this, peer_cfg_t *other);
-       
+
        /**
         * Increase reference count.
         *
         * @return                              reference to this
         */
        peer_cfg_t* (*get_ref) (peer_cfg_t *this);
-       
+
        /**
         * Destroys the peer_cfg object.
         *
index cf7e196..66a0a3b 100644 (file)
@@ -52,52 +52,52 @@ struct private_proposal_t {
         * Public part
         */
        proposal_t public;
-       
+
        /**
         * protocol (ESP or AH)
         */
        protocol_id_t protocol;
-       
+
        /**
         * priority ordered list of encryption algorithms
         */
        linked_list_t *encryption_algos;
-       
+
        /**
         * priority ordered list of integrity algorithms
         */
        linked_list_t *integrity_algos;
-       
+
        /**
         * priority ordered list of pseudo random functions
         */
        linked_list_t *prf_algos;
-       
+
        /**
         * priority ordered list of dh groups
         */
        linked_list_t *dh_groups;
-       
+
        /**
         * priority ordered list of extended sequence number flags
         */
        linked_list_t *esns;
-       
-       /** 
+
+       /**
         * senders SPI
         */
        u_int64_t spi;
 };
 
 /**
- * Struct used to store different kinds of algorithms. 
+ * Struct used to store different kinds of algorithms.
  */
 struct algorithm_t {
        /**
         * Value from an encryption_algorithm_t/integrity_algorithm_t/...
         */
        u_int16_t algorithm;
-       
+
        /**
         * the associated key size in bits, or zero if not needed
         */
@@ -110,7 +110,7 @@ struct algorithm_t {
 static void add_algo(linked_list_t *list, u_int16_t algo, u_int16_t key_size)
 {
        algorithm_t *algo_key;
-       
+
        algo_key = malloc_thing(algorithm_t);
        algo_key->algorithm = algo;
        algo_key->key_size = key_size;
@@ -200,7 +200,7 @@ static bool get_algorithm(private_proposal_t *this, transform_type_t type,
 {
        enumerator_t *enumerator;
        bool found = FALSE;
-       
+
        enumerator = create_enumerator(this, type);
        if (enumerator->enumerate(enumerator, alg, key_size))
        {
@@ -216,12 +216,12 @@ static bool get_algorithm(private_proposal_t *this, transform_type_t type,
 static bool has_dh_group(private_proposal_t *this, diffie_hellman_group_t group)
 {
        bool result = FALSE;
-       
+
        if (this->dh_groups->get_count(this->dh_groups))
        {
                algorithm_t *current;
                enumerator_t *enumerator;
-               
+
                enumerator = this->dh_groups->create_enumerator(this->dh_groups);
                while (enumerator->enumerate(enumerator, (void**)&current))
                {
@@ -246,7 +246,7 @@ static bool has_dh_group(private_proposal_t *this, diffie_hellman_group_t group)
 static void strip_dh(private_proposal_t *this)
 {
        algorithm_t *alg;
-       
+
        while (this->dh_groups->remove_last(this->dh_groups, (void**)&alg) == SUCCESS)
        {
                free(alg);
@@ -282,14 +282,14 @@ static bool select_algo(linked_list_t *first, linked_list_t *second, bool *add,
 {
        enumerator_t *e1, *e2;
        algorithm_t *alg1, *alg2;
-       
+
        /* if in both are zero algorithms specified, we HAVE a match */
        if (first->get_count(first) == 0 && second->get_count(second) == 0)
        {
                *add = FALSE;
                return TRUE;
        }
-       
+
        e1 = first->create_enumerator(first);
        e2 = second->create_enumerator(second);
        /* compare algs, order of algs in "first" is preferred */
@@ -327,18 +327,18 @@ static proposal_t *select_proposal(private_proposal_t *this, private_proposal_t
        u_int16_t algo;
        size_t key_size;
        bool add;
-       
+
        DBG2(DBG_CFG, "selecting proposal:");
-       
+
        /* check protocol */
        if (this->protocol != other->protocol)
        {
                DBG2(DBG_CFG, "  protocol mismatch, skipping");
                return NULL;
        }
-       
+
        selected = proposal_create(this->protocol);
-       
+
        /* select encryption algorithm */
        if (select_algo(this->encryption_algos, other->encryption_algos,
                                        &add, &algo, &key_size))
@@ -359,7 +359,7 @@ static proposal_t *select_proposal(private_proposal_t *this, private_proposal_t
        /* select integrity algorithm */
        if (!is_authenticated_encryption(algo))
        {
-               if (select_algo(this->integrity_algos, other->integrity_algos,  
+               if (select_algo(this->integrity_algos, other->integrity_algos,
                                                &add, &algo, &key_size))
                {
                        if (add)
@@ -424,10 +424,10 @@ static proposal_t *select_proposal(private_proposal_t *this, private_proposal_t
                return NULL;
        }
        DBG2(DBG_CFG, "  proposal matches");
-       
+
        /* apply SPI from "other" */
        selected->set_spi(selected, other->spi);
-       
+
        /* everything matched, return new proposal */
        return selected;
 }
@@ -463,7 +463,7 @@ static void clone_algo_list(linked_list_t *list, linked_list_t *clone_list)
 {
        algorithm_t *algo, *clone_algo;
        enumerator_t *enumerator;
-       
+
        enumerator = list->create_enumerator(list);
        while (enumerator->enumerate(enumerator, &algo))
        {
@@ -482,12 +482,12 @@ static bool algo_list_equals(linked_list_t *l1, linked_list_t *l2)
        enumerator_t *e1, *e2;
        algorithm_t *alg1, *alg2;
        bool equals = TRUE;
-       
+
        if (l1->get_count(l1) != l2->get_count(l2))
        {
                return FALSE;
        }
-       
+
        e1 = l1->create_enumerator(l1);
        e2 = l2->create_enumerator(l2);
        while (e1->enumerate(e1, &alg1) && e2->enumerate(e2, &alg2))
@@ -531,15 +531,15 @@ static bool equals(private_proposal_t *this, private_proposal_t *other)
 static proposal_t *clone_(private_proposal_t *this)
 {
        private_proposal_t *clone = (private_proposal_t*)proposal_create(this->protocol);
-       
+
        clone_algo_list(this->encryption_algos, clone->encryption_algos);
        clone_algo_list(this->integrity_algos, clone->integrity_algos);
        clone_algo_list(this->prf_algos, clone->prf_algos);
        clone_algo_list(this->dh_groups, clone->dh_groups);
        clone_algo_list(this->esns, clone->esns);
-       
+
        clone->spi = this->spi;
-       
+
        return &clone->public;
 }
 
@@ -551,7 +551,7 @@ static void check_proposal(private_proposal_t *this)
        enumerator_t *e;
        algorithm_t *alg;
        bool all_aead = TRUE;
-       
+
        e = this->encryption_algos->create_enumerator(this->encryption_algos);
        while (e->enumerate(e, &alg))
        {
@@ -562,7 +562,7 @@ static void check_proposal(private_proposal_t *this)
                }
        }
        e->destroy(e);
-       
+
        if (all_aead)
        {
                /* if all encryption algorithms in the proposal are authenticated encryption
@@ -613,7 +613,7 @@ static status_t add_string_algo(private_proposal_t *this, chunk_t alg)
                        case AUTH_AES_XCBC_96:
                                prf = PRF_AES128_XCBC;
                                break;
-                       default: 
+                       default:
                                prf = PRF_UNDEFINED;
                }
                if (prf != PRF_UNDEFINED)
@@ -633,7 +633,7 @@ static int print_alg(private_proposal_t *this, char **dst, size_t *len,
        enumerator_t *enumerator;
        size_t written = 0;
        u_int16_t alg, size;
-       
+
        enumerator = create_enumerator(this, kind);
        while (enumerator->enumerate(enumerator, &alg, &size))
        {
@@ -666,12 +666,12 @@ int proposal_printf_hook(char *dst, size_t len, printf_hook_spec_t *spec,
        enumerator_t *enumerator;
        size_t written = 0;
        bool first = TRUE;
-       
+
        if (this == NULL)
        {
                return print_in_hook(dst, len, "(null)");
        }
-       
+
        if (spec->hash)
        {
                enumerator = list->create_enumerator(list);
@@ -690,7 +690,7 @@ int proposal_printf_hook(char *dst, size_t len, printf_hook_spec_t *spec,
                enumerator->destroy(enumerator);
                return written;
        }
-       
+
        written = print_in_hook(dst, len, "%N:", protocol_id_names, this->protocol);
        written += print_alg(this, &dst, &len, ENCRYPTION_ALGORITHM,
                                                 encryption_algorithm_names, &first);
@@ -724,7 +724,7 @@ static void destroy(private_proposal_t *this)
 proposal_t *proposal_create(protocol_id_t protocol)
 {
        private_proposal_t *this = malloc_thing(private_proposal_t);
-       
+
        this->public.add_algorithm = (void (*)(proposal_t*,transform_type_t,u_int16_t,u_int16_t))add_algorithm;
        this->public.create_enumerator = (enumerator_t* (*)(proposal_t*,transform_type_t))create_enumerator;
        this->public.get_algorithm = (bool (*)(proposal_t*,transform_type_t,u_int16_t*,u_int16_t*))get_algorithm;
@@ -737,16 +737,16 @@ proposal_t *proposal_create(protocol_id_t protocol)
        this->public.equals = (bool(*)(proposal_t*, proposal_t *other))equals;
        this->public.clone = (proposal_t*(*)(proposal_t*))clone_;
        this->public.destroy = (void(*)(proposal_t*))destroy;
-       
+
        this->spi = 0;
        this->protocol = protocol;
-       
+
        this->encryption_algos = linked_list_create();
        this->integrity_algos = linked_list_create();
        this->prf_algos = linked_list_create();
        this->dh_groups = linked_list_create();
        this->esns = linked_list_create();
-       
+
        return &this->public;
 }
 
@@ -760,7 +760,7 @@ static void proposal_add_supported_ike(private_proposal_t *this)
        integrity_algorithm_t integrity;
        pseudo_random_function_t prf;
        diffie_hellman_group_t group;
-       
+
        enumerator = lib->crypto->create_crypter_enumerator(lib->crypto);
        while (enumerator->enumerate(enumerator, &encryption))
        {
@@ -787,10 +787,10 @@ static void proposal_add_supported_ike(private_proposal_t *this)
                                break;
                        default:
                                break;
-               }       
+               }
        }
        enumerator->destroy(enumerator);
-       
+
        enumerator = lib->crypto->create_signer_enumerator(lib->crypto);
        while (enumerator->enumerate(enumerator, &integrity))
        {
@@ -806,10 +806,10 @@ static void proposal_add_supported_ike(private_proposal_t *this)
                                break;
                        default:
                                break;
-               }       
+               }
        }
        enumerator->destroy(enumerator);
-       
+
        enumerator = lib->crypto->create_prf_enumerator(lib->crypto);
        while (enumerator->enumerate(enumerator, &prf))
        {
@@ -828,7 +828,7 @@ static void proposal_add_supported_ike(private_proposal_t *this)
                }
        }
        enumerator->destroy(enumerator);
-       
+
        enumerator = lib->crypto->create_dh_enumerator(lib->crypto);
        while (enumerator->enumerate(enumerator, &group))
        {
@@ -865,7 +865,7 @@ static void proposal_add_supported_ike(private_proposal_t *this)
 proposal_t *proposal_create_default(protocol_id_t protocol)
 {
        private_proposal_t *this = (private_proposal_t*)proposal_create(protocol);
-       
+
        switch (protocol)
        {
                case PROTO_IKE:
@@ -903,14 +903,14 @@ proposal_t *proposal_create_from_string(protocol_id_t protocol, const char *algs
        chunk_t string = {(void*)algs, strlen(algs)};
        chunk_t alg;
        status_t status = SUCCESS;
-       
+
        eat_whitespace(&string);
        if (string.len < 1)
        {
                destroy(this);
                return NULL;
        }
-       
+
        /* get all tokens, separated by '-' */
        while (extract_token(&alg, '-', &string))
        {
@@ -925,9 +925,9 @@ proposal_t *proposal_create_from_string(protocol_id_t protocol, const char *algs
                destroy(this);
                return NULL;
        }
-       
+
        check_proposal(this);
-       
+
        if (protocol == PROTO_AH || protocol == PROTO_ESP)
        {
                add_algorithm(this, EXTENDED_SEQUENCE_NUMBERS, NO_EXT_SEQ_NUMBERS, 0);
index bc7a8c5..f3857cb 100644 (file)
@@ -65,17 +65,17 @@ extern enum_name_t *extended_sequence_numbers_names;
 
 /**
  * Stores a set of algorithms used for an SA.
- * 
- * A proposal stores algorithms for a specific 
+ *
+ * A proposal stores algorithms for a specific
  * protocol. It can store algorithms for one protocol.
  * Proposals with multiple protocols are not supported,
  * as it's not specified in RFC4301 anymore.
  */
 struct proposal_t {
-       
+
        /**
         * Add an algorithm to the proposal.
-        * 
+        *
         * The algorithms are stored by priority, first added
         * is the most preferred.
         * Key size is only needed for encryption algorithms
@@ -84,27 +84,27 @@ struct proposal_t {
         * The alg parameter accepts encryption_algorithm_t,
         * integrity_algorithm_t, dh_group_number_t and
         * extended_sequence_numbers_t.
-        * 
+        *
         * @param type                  kind of algorithm
         * @param alg                   identifier for algorithm
         * @param key_size              key size to use
         */
        void (*add_algorithm) (proposal_t *this, transform_type_t type,
                                                   u_int16_t alg, u_int16_t key_size);
-       
+
        /**
         * Get an enumerator over algorithms for a specifc algo type.
-        * 
+        *
         * @param type                  kind of algorithm
         * @return                              enumerator over u_int16_t alg, u_int16_t key_size
         */
        enumerator_t *(*create_enumerator) (proposal_t *this, transform_type_t type);
-       
+
        /**
         * Get the algorithm for a type to use.
-        * 
+        *
         * If there are multiple algorithms, only the first is returned.
-        * 
+        *
         * @param type                  kind of algorithm
         * @param alg                   pointer which receives algorithm
         * @param key_size              pointer which receives the key size
@@ -112,53 +112,53 @@ struct proposal_t {
         */
        bool (*get_algorithm) (proposal_t *this, transform_type_t type,
                                                   u_int16_t *alg, u_int16_t *key_size);
-       
+
        /**
         * Check if the proposal has a specific DH group.
-        * 
+        *
         * @param group                 group to check for
         * @return                              TRUE if algorithm included
         */
        bool (*has_dh_group) (proposal_t *this, diffie_hellman_group_t group);
-       
+
        /**
         * Strip DH groups from proposal to use it without PFS.
         */
-       void (*strip_dh)(proposal_t *this);     
+       void (*strip_dh)(proposal_t *this);
 
        /**
         * Compare two proposal, and select a matching subset.
-        * 
+        *
         * If the proposals are for the same protocols (AH/ESP), they are
         * compared. If they have at least one algorithm of each type
         * in common, a resulting proposal of this kind is created.
-        * 
+        *
         * @param other                 proposal to compair agains
         * @return                              selected proposal, NULL if proposals don't match
         */
        proposal_t *(*select) (proposal_t *this, proposal_t *other);
-       
+
        /**
         * Get the protocol ID of the proposal.
         *
         * @return                              protocol of the proposal
         */
        protocol_id_t (*get_protocol) (proposal_t *this);
-       
+
        /**
         * Get the SPI of the proposal.
-        * 
+        *
         * @return                              spi for proto
         */
        u_int64_t (*get_spi) (proposal_t *this);
-       
+
        /**
         * Set the SPI of the proposal.
-        * 
+        *
         * @param spi                   spi to set for proto
         */
        void (*set_spi) (proposal_t *this, u_int64_t spi);
-       
+
        /**
         * Check for the eqality of two proposals.
         *
@@ -166,14 +166,14 @@ struct proposal_t {
         * @return                              TRUE if other equal to this
         */
        bool (*equals)(proposal_t *this, proposal_t *other);
-       
+
        /**
         * Clone a proposal.
-        * 
+        *
         * @return                              clone of proposal
         */
        proposal_t *(*clone) (proposal_t *this);
-       
+
        /**
         * Destroys the proposal object.
         */
@@ -214,7 +214,7 @@ proposal_t *proposal_create_from_string(protocol_id_t protocol, const char *algs
 /**
  * printf hook function for proposal_t.
  *
- * Arguments are: 
+ * Arguments are:
  *    proposal_t *proposal
  * With the #-specifier, arguments are:
  *    linked_list_t *list containing proposal_t*