moved typedefs to beginning of files to solve some include problems
splitted authenticator to have a separate implementation for each auth_method_t using va_copy to clone va_lists, should fix proplems on AMD64 some other cleanups
This commit is contained in:
@@ -23,11 +23,10 @@
|
||||
#ifndef CONFIGURATION_H_
|
||||
#define CONFIGURATION_H_
|
||||
|
||||
#include <types.h>
|
||||
|
||||
|
||||
typedef struct configuration_t configuration_t;
|
||||
|
||||
#include <types.h>
|
||||
|
||||
/**
|
||||
* @brief The interface for various daemon related configs.
|
||||
*
|
||||
|
||||
@@ -24,6 +24,9 @@
|
||||
#ifndef CONNECTION_H_
|
||||
#define CONNECTION_H_
|
||||
|
||||
typedef enum cert_policy_t cert_policy_t;
|
||||
typedef struct connection_t connection_t;
|
||||
|
||||
#include <types.h>
|
||||
#include <utils/host.h>
|
||||
#include <utils/linked_list.h>
|
||||
@@ -31,7 +34,6 @@
|
||||
#include <config/proposal.h>
|
||||
#include <crypto/diffie_hellman.h>
|
||||
|
||||
typedef enum cert_policy_t cert_policy_t;
|
||||
|
||||
/**
|
||||
* Certificate sending policy. This is also used for certificate
|
||||
@@ -60,16 +62,12 @@ enum cert_policy_t {
|
||||
*/
|
||||
extern enum_name_t *cert_policy_names;
|
||||
|
||||
|
||||
typedef struct connection_t connection_t;
|
||||
|
||||
/**
|
||||
* @brief A connection_t defines the rules to set up an IKE_SA.
|
||||
*
|
||||
*
|
||||
* @b Constructors:
|
||||
* - connection_create()
|
||||
*
|
||||
*
|
||||
* @ingroup config
|
||||
*/
|
||||
struct connection_t {
|
||||
|
||||
@@ -23,13 +23,12 @@
|
||||
#ifndef CONNECTION_STORE_H_
|
||||
#define CONNECTION_STORE_H_
|
||||
|
||||
typedef struct connection_store_t connection_store_t;
|
||||
|
||||
#include <types.h>
|
||||
#include <config/connections/connection.h>
|
||||
#include <utils/iterator.h>
|
||||
|
||||
|
||||
typedef struct connection_store_t connection_store_t;
|
||||
|
||||
/**
|
||||
* @brief The interface for a store of connection_t's.
|
||||
*
|
||||
|
||||
@@ -23,12 +23,11 @@
|
||||
#ifndef LOCAL_CONNECTION_H_
|
||||
#define LOCAL_CONNECTION_H_
|
||||
|
||||
typedef struct local_connection_store_t local_connection_store_t;
|
||||
|
||||
#include <types.h>
|
||||
#include <config/connections/connection_store.h>
|
||||
|
||||
|
||||
typedef struct local_connection_store_t local_connection_store_t;
|
||||
|
||||
/**
|
||||
* @brief A connection_store_t implementation using a simple connection list.
|
||||
*
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
#ifndef CREDENTIAL_STORE_H_
|
||||
#define CREDENTIAL_STORE_H_
|
||||
|
||||
typedef struct credential_store_t credential_store_t;
|
||||
|
||||
#include <types.h>
|
||||
#include <crypto/x509.h>
|
||||
#include <crypto/rsa/rsa_private_key.h>
|
||||
@@ -31,14 +33,12 @@
|
||||
#include <utils/identification.h>
|
||||
|
||||
|
||||
typedef struct credential_store_t credential_store_t;
|
||||
|
||||
/**
|
||||
* @brief The interface for a credential_store backend.
|
||||
*
|
||||
*
|
||||
* @b Constructors:
|
||||
* - stroke_create()
|
||||
*
|
||||
* - stroke_create()
|
||||
*
|
||||
* @ingroup config
|
||||
*/
|
||||
struct credential_store_t {
|
||||
|
||||
@@ -1125,7 +1125,7 @@ local_credential_store_t * local_credential_store_create(bool strict)
|
||||
this->public.credential_store.get_trusted_public_key = (rsa_public_key_t*(*)(credential_store_t*,identification_t*))get_trusted_public_key;
|
||||
this->public.credential_store.get_certificate = (x509_t* (*) (credential_store_t*,identification_t*))get_certificate;
|
||||
this->public.credential_store.get_ca_certificate = (x509_t* (*) (credential_store_t*,identification_t*))get_ca_certificate;
|
||||
this->public.credential_store.get_ca_certificate_by_keyid = (x509_t* (*) (credential_store_t*,identification_t*))get_ca_certificate_by_keyid;
|
||||
this->public.credential_store.get_ca_certificate_by_keyid = (x509_t* (*) (credential_store_t*,chunk_t))get_ca_certificate_by_keyid;
|
||||
this->public.credential_store.get_issuer_certificate = (x509_t* (*) (credential_store_t*,const x509_t*))get_issuer_certificate;
|
||||
this->public.credential_store.verify = (bool (*) (credential_store_t*,x509_t*,bool*))verify;
|
||||
this->public.credential_store.add_end_certificate = (x509_t* (*) (credential_store_t*,x509_t*))add_end_certificate;
|
||||
|
||||
@@ -23,13 +23,13 @@
|
||||
#ifndef LOCAL_CREDENTIAL_H_
|
||||
#define LOCAL_CREDENTIAL_H_
|
||||
|
||||
typedef struct local_credential_store_t local_credential_store_t;
|
||||
|
||||
#include <types.h>
|
||||
#include <daemon.h>
|
||||
#include <config/credentials/credential_store.h>
|
||||
|
||||
|
||||
typedef struct local_credential_store_t local_credential_store_t;
|
||||
|
||||
/**
|
||||
* @brief A credential_store_t implementation using simple credentail lists.
|
||||
*
|
||||
|
||||
@@ -23,12 +23,12 @@
|
||||
#ifndef LOCAL_POLICY_STORE_H_
|
||||
#define LOCAL_POLICY_STORE_H_
|
||||
|
||||
typedef struct local_policy_store_t local_policy_store_t;
|
||||
|
||||
#include <types.h>
|
||||
#include <config/policies/policy_store.h>
|
||||
|
||||
|
||||
typedef struct local_policy_store_t local_policy_store_t;
|
||||
|
||||
/**
|
||||
* @brief A policy_store_t implementation using a simple policy lists.
|
||||
*
|
||||
|
||||
@@ -31,13 +31,6 @@
|
||||
#include <utils/linked_list.h>
|
||||
#include <utils/identification.h>
|
||||
|
||||
ENUM(auth_method_names, RSA_DIGITAL_SIGNATURE, DSS_DIGITAL_SIGNATURE,
|
||||
"RSA signature",
|
||||
"pre-shared key",
|
||||
"DSS signature"
|
||||
);
|
||||
|
||||
|
||||
ENUM(dpd_action_names, DPD_NONE, DPD_RESTART,
|
||||
"DPD_NONE",
|
||||
"DPD_CLEAR",
|
||||
|
||||
@@ -24,48 +24,15 @@
|
||||
#ifndef POLICY_H_
|
||||
#define POLICY_H_
|
||||
|
||||
typedef enum dpd_action_t dpd_action_t;
|
||||
typedef struct policy_t policy_t;
|
||||
|
||||
#include <types.h>
|
||||
#include <utils/identification.h>
|
||||
#include <config/traffic_selector.h>
|
||||
#include <config/proposal.h>
|
||||
#include <sa/authenticators/authenticator.h>
|
||||
|
||||
typedef enum auth_method_t auth_method_t;
|
||||
|
||||
/**
|
||||
* AUTH Method to use.
|
||||
*
|
||||
* @ingroup config
|
||||
*/
|
||||
enum auth_method_t {
|
||||
/**
|
||||
* Computed as specified in section 2.15 of RFC using
|
||||
* an RSA private key over a PKCS#1 padded hash.
|
||||
*/
|
||||
RSA_DIGITAL_SIGNATURE = 1,
|
||||
|
||||
/**
|
||||
* Computed as specified in section 2.15 of RFC using the
|
||||
* shared key associated with the identity in the ID payload
|
||||
* and the negotiated prf function
|
||||
*/
|
||||
SHARED_KEY_MESSAGE_INTEGRITY_CODE = 2,
|
||||
|
||||
/**
|
||||
* Computed as specified in section 2.15 of RFC using a
|
||||
* DSS private key over a SHA-1 hash.
|
||||
*/
|
||||
DSS_DIGITAL_SIGNATURE = 3,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum names for auth_method_t.
|
||||
*
|
||||
* @ingroup config
|
||||
*/
|
||||
extern enum_name_t *auth_method_names;
|
||||
|
||||
|
||||
typedef enum dpd_action_t dpd_action_t;
|
||||
|
||||
/**
|
||||
* @brief Actions to take when a peer does not respond (dead peer detected).
|
||||
@@ -90,18 +57,15 @@ enum dpd_action_t {
|
||||
*/
|
||||
extern enum_name_t *dpd_action_names;
|
||||
|
||||
|
||||
typedef struct policy_t policy_t;
|
||||
|
||||
/**
|
||||
* @brief A policy_t defines the policies to apply to CHILD_SAs.
|
||||
*
|
||||
*
|
||||
* The given two IDs identify a policy. These rules define how
|
||||
* child SAs may be set up and which traffic may be IPsec'ed.
|
||||
*
|
||||
*
|
||||
* @b Constructors:
|
||||
* - policy_create()
|
||||
*
|
||||
*
|
||||
* @ingroup config
|
||||
*/
|
||||
struct policy_t {
|
||||
|
||||
@@ -23,13 +23,13 @@
|
||||
#ifndef POLICY_STORE_H_
|
||||
#define POLICY_STORE_H_
|
||||
|
||||
typedef struct policy_store_t policy_store_t;
|
||||
|
||||
#include <types.h>
|
||||
#include <config/policies/policy.h>
|
||||
#include <utils/linked_list.h>
|
||||
|
||||
|
||||
typedef struct policy_store_t policy_store_t;
|
||||
|
||||
/**
|
||||
* @brief The interface for a store of policy_t's.
|
||||
*
|
||||
|
||||
@@ -23,6 +23,12 @@
|
||||
#ifndef PROPOSAL_H_
|
||||
#define PROPOSAL_H_
|
||||
|
||||
typedef enum protocol_id_t protocol_id_t;
|
||||
typedef enum transform_type_t transform_type_t;
|
||||
typedef enum extended_sequence_numbers_t extended_sequence_numbers_t;
|
||||
typedef struct algorithm_t algorithm_t;
|
||||
typedef struct proposal_t proposal_t;
|
||||
|
||||
#include <types.h>
|
||||
#include <utils/identification.h>
|
||||
#include <utils/linked_list.h>
|
||||
@@ -32,12 +38,9 @@
|
||||
#include <crypto/diffie_hellman.h>
|
||||
#include <config/traffic_selector.h>
|
||||
|
||||
|
||||
typedef enum protocol_id_t protocol_id_t;
|
||||
|
||||
/**
|
||||
* Protocol ID of a proposal.
|
||||
*
|
||||
*
|
||||
* @ingroup config
|
||||
*/
|
||||
enum protocol_id_t {
|
||||
@@ -55,11 +58,9 @@ enum protocol_id_t {
|
||||
extern enum_name_t *protocol_id_names;
|
||||
|
||||
|
||||
typedef enum transform_type_t transform_type_t;
|
||||
|
||||
/**
|
||||
* Type of a transform, as in IKEv2 RFC 3.3.2.
|
||||
*
|
||||
*
|
||||
* @ingroup config
|
||||
*/
|
||||
enum transform_type_t {
|
||||
@@ -79,11 +80,9 @@ enum transform_type_t {
|
||||
extern enum_name_t *transform_type_names;
|
||||
|
||||
|
||||
typedef enum extended_sequence_numbers_t extended_sequence_numbers_t;
|
||||
|
||||
/**
|
||||
/**
|
||||
* Extended sequence numbers, as in IKEv2 RFC 3.3.2.
|
||||
*
|
||||
*
|
||||
* @ingroup config
|
||||
*/
|
||||
enum extended_sequence_numbers_t {
|
||||
@@ -99,7 +98,6 @@ enum extended_sequence_numbers_t {
|
||||
extern enum_name_t *extended_sequence_numbers_names;
|
||||
|
||||
|
||||
typedef struct algorithm_t algorithm_t;
|
||||
|
||||
/**
|
||||
* Struct used to store different kinds of algorithms. The internal
|
||||
@@ -117,8 +115,6 @@ struct algorithm_t {
|
||||
u_int16_t key_size;
|
||||
};
|
||||
|
||||
typedef struct proposal_t proposal_t;
|
||||
|
||||
/**
|
||||
* @brief Stores a set of algorithms used for an SA.
|
||||
*
|
||||
|
||||
@@ -24,6 +24,9 @@
|
||||
#ifndef TRAFFIC_SELECTOR_H_
|
||||
#define TRAFFIC_SELECTOR_H_
|
||||
|
||||
typedef enum ts_type_t ts_type_t;
|
||||
typedef struct traffic_selector_t traffic_selector_t;
|
||||
|
||||
#include <types.h>
|
||||
#include <utils/host.h>
|
||||
|
||||
@@ -32,8 +35,6 @@
|
||||
*/
|
||||
#define TRAFFIC_SELECTOR_PRINTF_SPEC 'R'
|
||||
|
||||
typedef enum ts_type_t ts_type_t;
|
||||
|
||||
/**
|
||||
* Traffic selector types.
|
||||
*
|
||||
@@ -65,21 +66,18 @@ enum ts_type_t {
|
||||
*/
|
||||
extern enum_name_t *ts_type_name;
|
||||
|
||||
|
||||
typedef struct traffic_selector_t traffic_selector_t;
|
||||
|
||||
/**
|
||||
* @brief Object representing a traffic selector entry.
|
||||
*
|
||||
*
|
||||
* A traffic selector defines an range of addresses
|
||||
* and a range of ports. IPv6 is not fully supported yet.
|
||||
*
|
||||
*
|
||||
* @b Constructors:
|
||||
* - traffic_selector_create_from_bytes()
|
||||
* - traffic_selector_create_from_string()
|
||||
*
|
||||
*
|
||||
* @todo Add IPv6 support
|
||||
*
|
||||
*
|
||||
* @ingroup config
|
||||
*/
|
||||
struct traffic_selector_t {
|
||||
|
||||
Reference in New Issue
Block a user