Use a seperate section for each nested struct member in INIT macro

This commit is contained in:
Martin Willi
2010-08-18 12:15:03 +02:00
parent 53115857ae
commit ba31fe1fd6
77 changed files with 615 additions and 448 deletions
+3 -1
View File
@@ -383,7 +383,9 @@ receiver_t *receiver_create()
u_int32_t now = time_monotonic(NULL); u_int32_t now = time_monotonic(NULL);
INIT(this, INIT(this,
.public.destroy = _destroy, .public = {
.destroy = _destroy,
},
.secret_switch = now, .secret_switch = now,
.secret_offset = random() % now, .secret_offset = random() % now,
); );
@@ -61,7 +61,11 @@ plugin_t *addrblock_plugin_create()
private_addrblock_plugin_t *this; private_addrblock_plugin_t *this;
INIT(this, INIT(this,
.public.plugin.destroy = _destroy, .public = {
.plugin = {
.destroy = _destroy,
},
},
.validator = addrblock_validator_create(), .validator = addrblock_validator_create(),
.narrower = addrblock_narrow_create(), .narrower = addrblock_narrow_create(),
); );
@@ -79,9 +79,11 @@ plugin_t *android_plugin_create()
private_android_plugin_t *this; private_android_plugin_t *this;
INIT(this, INIT(this,
.public.plugin = { .public = {
.plugin = {
.destroy = _destroy, .destroy = _destroy,
}, },
},
.logger = android_logger_create(), .logger = android_logger_create(),
.handler = android_handler_create(), .handler = android_handler_create(),
.creds = android_creds_create(), .creds = android_creds_create(),
+5 -1
View File
@@ -62,7 +62,11 @@ plugin_t *dhcp_plugin_create()
private_dhcp_plugin_t *this; private_dhcp_plugin_t *this;
INIT(this, INIT(this,
.public.plugin.destroy = _destroy, .public = {
.plugin = {
.destroy = _destroy,
},
},
.socket = dhcp_socket_create(), .socket = dhcp_socket_create(),
); );
@@ -157,7 +157,7 @@ eap_identity_t *eap_identity_create_peer(identification_t *server,
INIT(this, INIT(this,
.public = { .public = {
.eap_method_interface = { .eap_method = {
.initiate = _initiate_peer, .initiate = _initiate_peer,
.process = _process_peer, .process = _process_peer,
.get_type = _get_type, .get_type = _get_type,
@@ -182,7 +182,8 @@ eap_identity_t *eap_identity_create_server(identification_t *server,
private_eap_identity_t *this; private_eap_identity_t *this;
INIT(this, INIT(this,
.public.eap_method_interface = { .public = {
.eap_method = {
.initiate = _initiate_server, .initiate = _initiate_server,
.process = _process_server, .process = _process_server,
.get_type = _get_type, .get_type = _get_type,
@@ -190,6 +191,7 @@ eap_identity_t *eap_identity_create_server(identification_t *server,
.get_msk = _get_msk, .get_msk = _get_msk,
.destroy = _destroy, .destroy = _destroy,
}, },
},
.peer = peer->clone(peer), .peer = peer->clone(peer),
.identity = chunk_empty, .identity = chunk_empty,
); );
@@ -33,7 +33,7 @@ struct eap_identity_t {
/** /**
* Implemented eap_method_t interface. * Implemented eap_method_t interface.
*/ */
eap_method_t eap_method_interface; eap_method_t eap_method;
}; };
/** /**
+4 -6
View File
@@ -236,7 +236,7 @@ eap_md5_t *eap_md5_create_server(identification_t *server, identification_t *pee
INIT(this, INIT(this,
.public = { .public = {
.eap_method_interface = { .eap_method = {
.initiate = _initiate_server, .initiate = _initiate_server,
.process = _process_server, .process = _process_server,
.get_type = _get_type, .get_type = _get_type,
@@ -247,8 +247,6 @@ eap_md5_t *eap_md5_create_server(identification_t *server, identification_t *pee
}, },
.peer = peer->clone(peer), .peer = peer->clone(peer),
.server = server->clone(server), .server = server->clone(server),
.challenge = chunk_empty,
.identifier = 0,
); );
/* generate a non-zero identifier */ /* generate a non-zero identifier */
@@ -267,7 +265,8 @@ eap_md5_t *eap_md5_create_peer(identification_t *server, identification_t *peer)
private_eap_md5_t *this; private_eap_md5_t *this;
INIT(this, INIT(this,
.public.eap_method_interface = { .public = {
.eap_method = {
.initiate = _initiate_peer, .initiate = _initiate_peer,
.process = _process_peer, .process = _process_peer,
.get_type = _get_type, .get_type = _get_type,
@@ -275,10 +274,9 @@ eap_md5_t *eap_md5_create_peer(identification_t *server, identification_t *peer)
.get_msk = _get_msk, .get_msk = _get_msk,
.destroy = _destroy, .destroy = _destroy,
}, },
},
.peer = peer->clone(peer), .peer = peer->clone(peer),
.server = server->clone(server), .server = server->clone(server),
.challenge = chunk_empty,
.identifier = 0,
); );
return &this->public; return &this->public;
+1 -1
View File
@@ -33,7 +33,7 @@ struct eap_md5_t {
/** /**
* Implemented eap_method_t interface. * Implemented eap_method_t interface.
*/ */
eap_method_t eap_method_interface; eap_method_t eap_method;
}; };
/** /**
@@ -313,7 +313,8 @@ eap_radius_t *eap_radius_create(identification_t *server, identification_t *peer
private_eap_radius_t *this; private_eap_radius_t *this;
INIT(this, INIT(this,
.public.eap_method_interface = { .public = {
.eap_method = {
.initiate = _initiate, .initiate = _initiate,
.process = _process, .process = _process,
.get_type = _get_type, .get_type = _get_type,
@@ -321,6 +322,7 @@ eap_radius_t *eap_radius_create(identification_t *server, identification_t *peer
.get_msk = _get_msk, .get_msk = _get_msk,
.destroy = _destroy, .destroy = _destroy,
}, },
},
/* initially EAP_RADIUS, but is set to the method selected by RADIUS */ /* initially EAP_RADIUS, but is set to the method selected by RADIUS */
.type = EAP_RADIUS, .type = EAP_RADIUS,
.eap_start = lib->settings->get_bool(lib->settings, .eap_start = lib->settings->get_bool(lib->settings,
@@ -33,7 +33,7 @@ struct eap_radius_t {
/** /**
* Implemented eap_method_t interface. * Implemented eap_method_t interface.
*/ */
eap_method_t eap_method_interface; eap_method_t eap_method;
}; };
/** /**
@@ -151,7 +151,11 @@ plugin_t *eap_radius_plugin_create()
private_eap_radius_plugin_t *this; private_eap_radius_plugin_t *this;
INIT(this, INIT(this,
.public.plugin.destroy = _destroy, .public = {
.plugin = {
.destroy = _destroy,
},
},
.servers = linked_list_create(), .servers = linked_list_create(),
); );
@@ -85,9 +85,11 @@ plugin_t *eap_simaka_sql_plugin_create()
"charon.plugins.eap-simaka-sql.remove_used", FALSE); "charon.plugins.eap-simaka-sql.remove_used", FALSE);
INIT(this, INIT(this,
.public.plugin = { .public = {
.plugin = {
.destroy = _destroy, .destroy = _destroy,
}, },
},
.db = db, .db = db,
.provider = eap_simaka_sql_provider_create(db, remove_used), .provider = eap_simaka_sql_provider_create(db, remove_used),
.card = eap_simaka_sql_card_create(db, remove_used), .card = eap_simaka_sql_card_create(db, remove_used),
+3 -1
View File
@@ -422,7 +422,8 @@ static eap_tls_t *eap_tls_create(identification_t *server,
private_eap_tls_t *this; private_eap_tls_t *this;
INIT(this, INIT(this,
.public.eap_method = { .public = {
.eap_method = {
.initiate = _initiate, .initiate = _initiate,
.process = _process, .process = _process,
.get_type = _get_type, .get_type = _get_type,
@@ -430,6 +431,7 @@ static eap_tls_t *eap_tls_create(identification_t *server,
.get_msk = _get_msk, .get_msk = _get_msk,
.destroy = _destroy, .destroy = _destroy,
}, },
},
.is_server = is_server, .is_server = is_server,
); );
/* MSK PRF ASCII constant label according to EAP-TLS RFC 5216 */ /* MSK PRF ASCII constant label according to EAP-TLS RFC 5216 */
@@ -38,7 +38,9 @@ plugin_t *eap_tls_plugin_create()
eap_tls_plugin_t *this; eap_tls_plugin_t *this;
INIT(this, INIT(this,
.plugin.destroy = _destroy, .plugin = {
.destroy = _destroy,
},
); );
charon->eap->add_method(charon->eap, EAP_TLS, 0, EAP_SERVER, charon->eap->add_method(charon->eap, EAP_TLS, 0, EAP_SERVER,
+3 -1
View File
@@ -431,7 +431,8 @@ static eap_ttls_t *eap_ttls_create(identification_t *server,
private_eap_ttls_t *this; private_eap_ttls_t *this;
INIT(this, INIT(this,
.public.eap_method = { .public = {
.eap_method = {
.initiate = _initiate, .initiate = _initiate,
.process = _process, .process = _process,
.get_type = _get_type, .get_type = _get_type,
@@ -439,6 +440,7 @@ static eap_ttls_t *eap_ttls_create(identification_t *server,
.get_msk = _get_msk, .get_msk = _get_msk,
.destroy = _destroy, .destroy = _destroy,
}, },
},
.is_server = is_server, .is_server = is_server,
); );
/* MSK PRF ASCII constant label according to EAP-TTLS RFC 5281 */ /* MSK PRF ASCII constant label according to EAP-TTLS RFC 5281 */
@@ -220,16 +220,16 @@ eap_ttls_peer_t *eap_ttls_peer_create(identification_t *server,
private_eap_ttls_peer_t *this; private_eap_ttls_peer_t *this;
INIT(this, INIT(this,
.public.application = { .public = {
.application = {
.process = _process, .process = _process,
.build = _build, .build = _build,
.destroy = _destroy, .destroy = _destroy,
}, },
},
.server = server->clone(server), .server = server->clone(server),
.peer = peer->clone(peer), .peer = peer->clone(peer),
.start_phase2 = TRUE, .start_phase2 = TRUE,
.method = NULL,
.out = NULL,
.avp = eap_ttls_avp_create(), .avp = eap_ttls_avp_create(),
); );
@@ -38,7 +38,9 @@ plugin_t *eap_ttls_plugin_create()
eap_ttls_plugin_t *this; eap_ttls_plugin_t *this;
INIT(this, INIT(this,
.plugin.destroy = _destroy, .plugin = {
.destroy = _destroy,
},
); );
charon->eap->add_method(charon->eap, EAP_TTLS, 0, EAP_SERVER, charon->eap->add_method(charon->eap, EAP_TTLS, 0, EAP_SERVER,
@@ -285,16 +285,16 @@ eap_ttls_server_t *eap_ttls_server_create(identification_t *server,
private_eap_ttls_server_t *this; private_eap_ttls_server_t *this;
INIT(this, INIT(this,
.public.application = { .public = {
.application = {
.process = _process, .process = _process,
.build = _build, .build = _build,
.destroy = _destroy, .destroy = _destroy,
}, },
},
.server = server->clone(server), .server = server->clone(server),
.peer = peer->clone(peer), .peer = peer->clone(peer),
.start_phase2 = TRUE, .start_phase2 = TRUE,
.method = NULL,
.out = NULL,
.avp = eap_ttls_avp_create(), .avp = eap_ttls_avp_create(),
); );
+5 -1
View File
@@ -60,7 +60,11 @@ plugin_t *farp_plugin_create()
private_farp_plugin_t *this; private_farp_plugin_t *this;
INIT(this, INIT(this,
.public.plugin.destroy = _destroy, .public = {
.plugin = {
.destroy = _destroy,
},
},
.listener = farp_listener_create(), .listener = farp_listener_create(),
); );
+5 -1
View File
@@ -142,7 +142,11 @@ plugin_t *ha_plugin_create()
} }
INIT(this, INIT(this,
.public.plugin.destroy = _destroy, .public = {
.plugin = {
.destroy = _destroy,
},
},
); );
if (secret) if (secret)
@@ -2598,7 +2598,8 @@ kernel_klips_ipsec_t *kernel_klips_ipsec_create()
private_kernel_klips_ipsec_t *this; private_kernel_klips_ipsec_t *this;
INIT(this, INIT(this,
.public.interface = { .public = {
.interface = {
.get_spi = _get_spi, .get_spi = _get_spi,
.get_cpi = _get_cpi, .get_cpi = _get_cpi,
.add_sa = _add_sa, .add_sa = _add_sa,
@@ -2611,6 +2612,7 @@ kernel_klips_ipsec_t *kernel_klips_ipsec_create()
.bypass_socket = _bypass_socket, .bypass_socket = _bypass_socket,
.destroy = _destroy, .destroy = _destroy,
}, },
},
.policies = linked_list_create(), .policies = linked_list_create(),
.allocated_spis = linked_list_create(), .allocated_spis = linked_list_create(),
.installed_sas = linked_list_create(), .installed_sas = linked_list_create(),
@@ -2202,7 +2202,8 @@ kernel_netlink_ipsec_t *kernel_netlink_ipsec_create()
int fd; int fd;
INIT(this, INIT(this,
.public.interface = { .public = {
.interface = {
.get_spi = _get_spi, .get_spi = _get_spi,
.get_cpi = _get_cpi, .get_cpi = _get_cpi,
.add_sa = _add_sa, .add_sa = _add_sa,
@@ -2215,6 +2216,7 @@ kernel_netlink_ipsec_t *kernel_netlink_ipsec_create()
.bypass_socket = _bypass_socket, .bypass_socket = _bypass_socket,
.destroy = _destroy, .destroy = _destroy,
}, },
},
.policies = hashtable_create((hashtable_hash_t)policy_hash, .policies = hashtable_create((hashtable_hash_t)policy_hash,
(hashtable_equals_t)policy_equals, 32), (hashtable_equals_t)policy_equals, 32),
.mutex = mutex_create(MUTEX_TYPE_DEFAULT), .mutex = mutex_create(MUTEX_TYPE_DEFAULT),
@@ -2154,7 +2154,8 @@ kernel_pfkey_ipsec_t *kernel_pfkey_ipsec_create()
private_kernel_pfkey_ipsec_t *this; private_kernel_pfkey_ipsec_t *this;
INIT(this, INIT(this,
.public.interface = { .public = {
.interface = {
.get_spi = _get_spi, .get_spi = _get_spi,
.get_cpi = _get_cpi, .get_cpi = _get_cpi,
.add_sa = _add_sa, .add_sa = _add_sa,
@@ -2167,6 +2168,7 @@ kernel_pfkey_ipsec_t *kernel_pfkey_ipsec_create()
.bypass_socket = _bypass_socket, .bypass_socket = _bypass_socket,
.destroy = _destroy, .destroy = _destroy,
}, },
},
.policies = linked_list_create(), .policies = linked_list_create(),
.mutex = mutex_create(MUTEX_TYPE_DEFAULT), .mutex = mutex_create(MUTEX_TYPE_DEFAULT),
.mutex_pfkey = mutex_create(MUTEX_TYPE_DEFAULT), .mutex_pfkey = mutex_create(MUTEX_TYPE_DEFAULT),
@@ -53,7 +53,11 @@ plugin_t *socket_default_plugin_create()
private_socket_default_plugin_t *this; private_socket_default_plugin_t *this;
INIT(this, INIT(this,
.public.plugin.destroy = _destroy, .public = {
.plugin = {
.destroy = _destroy,
},
},
.socket = socket_default_socket_create(), .socket = socket_default_socket_create(),
); );
@@ -53,7 +53,11 @@ plugin_t *socket_dynamic_plugin_create()
private_socket_dynamic_plugin_t *this; private_socket_dynamic_plugin_t *this;
INIT(this, INIT(this,
.public.plugin.destroy = _destroy, .public = {
.plugin = {
.destroy = _destroy,
},
},
.socket = socket_dynamic_socket_create(), .socket = socket_dynamic_socket_create(),
); );
@@ -53,7 +53,11 @@ plugin_t *socket_raw_plugin_create()
private_socket_raw_plugin_t *this; private_socket_raw_plugin_t *this;
INIT(this, INIT(this,
.public.plugin.destroy = _destroy, .public = {
.plugin = {
.destroy = _destroy,
},
},
.socket = socket_raw_socket_create(), .socket = socket_raw_socket_create(),
); );
@@ -136,10 +136,12 @@ inactivity_job_t *inactivity_job_create(u_int32_t reqid, u_int32_t timeout,
private_inactivity_job_t *this; private_inactivity_job_t *this;
INIT(this, INIT(this,
.public.job_interface = { .public = {
.job_interface = {
.execute = _execute, .execute = _execute,
.destroy = _destroy, .destroy = _destroy,
}, },
},
.reqid = reqid, .reqid = reqid,
.timeout = timeout, .timeout = timeout,
.close_ike = close_ike, .close_ike = close_ike,
@@ -652,13 +652,6 @@ eap_authenticator_t *eap_authenticator_create_builder(ike_sa_t *ike_sa,
.received_nonce = received_nonce, .received_nonce = received_nonce,
.sent_init = sent_init, .sent_init = sent_init,
.sent_nonce = sent_nonce, .sent_nonce = sent_nonce,
.msk = chunk_empty,
.method = NULL,
.eap_payload = NULL,
.eap_complete = FALSE,
.auth_complete = FALSE,
.eap_identity = NULL,
.require_mutual = FALSE,
); );
return &this->public; return &this->public;
@@ -674,24 +667,19 @@ eap_authenticator_t *eap_authenticator_create_verifier(ike_sa_t *ike_sa,
private_eap_authenticator_t *this; private_eap_authenticator_t *this;
INIT(this, INIT(this,
.public.authenticator = { .public = {
.authenticator = {
.build = _build_server, .build = _build_server,
.process = _process_server, .process = _process_server,
.is_mutual = _is_mutual, .is_mutual = _is_mutual,
.destroy = _destroy, .destroy = _destroy,
}, },
},
.ike_sa = ike_sa, .ike_sa = ike_sa,
.received_init = received_init, .received_init = received_init,
.received_nonce = received_nonce, .received_nonce = received_nonce,
.sent_init = sent_init, .sent_init = sent_init,
.sent_nonce = sent_nonce, .sent_nonce = sent_nonce,
.msk = chunk_empty,
.method = NULL,
.eap_payload = NULL,
.eap_complete = FALSE,
.auth_complete = FALSE,
.eap_identity = NULL,
.require_mutual = FALSE,
); );
return &this->public; return &this->public;
+3 -1
View File
@@ -123,13 +123,15 @@ ike_vendor_t *ike_vendor_create(ike_sa_t *ike_sa, bool initiator)
private_ike_vendor_t *this; private_ike_vendor_t *this;
INIT(this, INIT(this,
.public.task = { .public = {
.task = {
.build = _build, .build = _build,
.process = _process, .process = _process,
.migrate = _migrate, .migrate = _migrate,
.get_type = _get_type, .get_type = _get_type,
.destroy = _destroy, .destroy = _destroy,
}, },
},
.initiator = initiator, .initiator = initiator,
.ike_sa = ike_sa, .ike_sa = ike_sa,
); );
+4 -2
View File
@@ -1550,7 +1550,8 @@ aes_crypter_t *aes_crypter_create(encryption_algorithm_t algo, size_t key_size)
#endif #endif
INIT(this, INIT(this,
.public.crypter = { .public = {
.crypter = {
.encrypt = _encrypt, .encrypt = _encrypt,
.decrypt = _decrypt, .decrypt = _decrypt,
.get_block_size = _get_block_size, .get_block_size = _get_block_size,
@@ -1559,9 +1560,10 @@ aes_crypter_t *aes_crypter_create(encryption_algorithm_t algo, size_t key_size)
.set_key = _set_key, .set_key = _set_key,
.destroy = _destroy, .destroy = _destroy,
}, },
},
.key_size = key_size, .key_size = key_size,
.aes_Nkey = key_size / 4, .aes_Nkey = key_size / 4,
); );
return &(this->public); return &this->public;
} }
+5 -1
View File
@@ -47,7 +47,11 @@ plugin_t *aes_plugin_create()
private_aes_plugin_t *this; private_aes_plugin_t *this;
INIT(this, INIT(this,
.public.plugin.destroy = _destroy, .public = {
.plugin = {
.destroy = _destroy,
},
},
); );
lib->crypto->add_crypter(lib->crypto, ENCR_AES_CBC, lib->crypto->add_crypter(lib->crypto, ENCR_AES_CBC,
@@ -47,7 +47,11 @@ plugin_t *agent_plugin_create()
private_agent_plugin_t *this; private_agent_plugin_t *this;
INIT(this, INIT(this,
.public.plugin.destroy = _destroy, .public = {
.plugin = {
.destroy = _destroy,
},
},
); );
lib->creds->add_builder(lib->creds, CRED_PRIVATE_KEY, KEY_RSA, lib->creds->add_builder(lib->creds, CRED_PRIVATE_KEY, KEY_RSA,
@@ -402,7 +402,8 @@ agent_private_key_t *agent_private_key_open(key_type_t type, va_list args)
} }
INIT(this, INIT(this,
.public.key = { .public = {
.key = {
.get_type = _get_type, .get_type = _get_type,
.sign = _sign, .sign = _sign,
.decrypt = _decrypt, .decrypt = _decrypt,
@@ -416,6 +417,7 @@ agent_private_key_t *agent_private_key_open(key_type_t type, va_list args)
.get_ref = _get_ref, .get_ref = _get_ref,
.destroy = _destroy, .destroy = _destroy,
}, },
},
.ref = 1, .ref = 1,
); );
@@ -177,7 +177,8 @@ blowfish_crypter_t *blowfish_crypter_create(encryption_algorithm_t algo,
} }
INIT(this, INIT(this,
.public.crypter = { .public = {
.crypter = {
.encrypt = _encrypt, .encrypt = _encrypt,
.decrypt = _decrypt, .decrypt = _decrypt,
.get_block_size = _get_block_size, .get_block_size = _get_block_size,
@@ -186,6 +187,7 @@ blowfish_crypter_t *blowfish_crypter_create(encryption_algorithm_t algo,
.set_key = _set_key, .set_key = _set_key,
.destroy = _destroy, .destroy = _destroy,
}, },
},
.key_size = key_size ?: 16, .key_size = key_size ?: 16,
); );
@@ -48,7 +48,11 @@ plugin_t *blowfish_plugin_create()
private_blowfish_plugin_t *this; private_blowfish_plugin_t *this;
INIT(this, INIT(this,
.public.plugin.destroy = _destroy, .public = {
.plugin = {
.destroy = _destroy,
},
},
); );
lib->crypto->add_crypter(lib->crypto, ENCR_BLOWFISH, lib->crypto->add_crypter(lib->crypto, ENCR_BLOWFISH,
@@ -149,7 +149,8 @@ ctr_ipsec_crypter_t *ctr_ipsec_crypter_create(encryption_algorithm_t algo,
} }
INIT(this, INIT(this,
.public.crypter = { .public = {
.crypter = {
.encrypt = _crypt, .encrypt = _crypt,
.decrypt = _crypt, .decrypt = _crypt,
.get_block_size = _get_block_size, .get_block_size = _get_block_size,
@@ -158,6 +159,7 @@ ctr_ipsec_crypter_t *ctr_ipsec_crypter_create(encryption_algorithm_t algo,
.set_key = _set_key, .set_key = _set_key,
.destroy = _destroy, .destroy = _destroy,
}, },
},
.crypter = lib->crypto->create_crypter(lib->crypto, algo, key_size), .crypter = lib->crypto->create_crypter(lib->crypto, algo, key_size),
); );
+5 -1
View File
@@ -49,7 +49,11 @@ plugin_t *ctr_plugin_create()
private_ctr_plugin_t *this; private_ctr_plugin_t *this;
INIT(this, INIT(this,
.public.plugin.destroy = _destroy, .public = {
.plugin = {
.destroy = _destroy,
},
},
); );
lib->crypto->add_crypter(lib->crypto, ENCR_AES_CTR, lib->crypto->add_crypter(lib->crypto, ENCR_AES_CTR,
@@ -166,11 +166,13 @@ curl_fetcher_t *curl_fetcher_create()
private_curl_fetcher_t *this; private_curl_fetcher_t *this;
INIT(this, INIT(this,
.public.interface = { .public = {
.interface = {
.fetch = _fetch, .fetch = _fetch,
.set_option = _set_option, .set_option = _set_option,
.destroy = _destroy, .destroy = _destroy,
}, },
},
.curl = curl_easy_init(), .curl = curl_easy_init(),
); );
+3 -1
View File
@@ -1563,12 +1563,14 @@ des_crypter_t *des_crypter_create(encryption_algorithm_t algo)
private_des_crypter_t *this; private_des_crypter_t *this;
INIT(this, INIT(this,
.public.crypter = { .public = {
.crypter = {
.get_block_size = _get_block_size, .get_block_size = _get_block_size,
.get_iv_size = _get_iv_size, .get_iv_size = _get_iv_size,
.get_key_size = _get_key_size, .get_key_size = _get_key_size,
.destroy = _destroy, .destroy = _destroy,
}, },
},
); );
/* use functions depending on algorithm */ /* use functions depending on algorithm */
+5 -1
View File
@@ -47,7 +47,11 @@ plugin_t *des_plugin_create()
private_des_plugin_t *this; private_des_plugin_t *this;
INIT(this, INIT(this,
.public.plugin.destroy = _destroy, .public = {
.plugin = {
.destroy = _destroy,
},
},
); );
lib->crypto->add_crypter(lib->crypto, ENCR_3DES, lib->crypto->add_crypter(lib->crypto, ENCR_3DES,
@@ -278,7 +278,8 @@ gcrypt_crypter_t *gcrypt_crypter_create(encryption_algorithm_t algo,
} }
INIT(this, INIT(this,
.public.crypter = { .public = {
.crypter = {
.encrypt = _encrypt, .encrypt = _encrypt,
.decrypt = _decrypt, .decrypt = _decrypt,
.get_block_size = _get_block_size, .get_block_size = _get_block_size,
@@ -287,6 +288,7 @@ gcrypt_crypter_t *gcrypt_crypter_create(encryption_algorithm_t algo,
.set_key = _set_key, .set_key = _set_key,
.destroy = _destroy, .destroy = _destroy,
}, },
},
.alg = gcrypt_alg, .alg = gcrypt_alg,
.ctr_mode = mode == GCRY_CIPHER_MODE_CTR, .ctr_mode = mode == GCRY_CIPHER_MODE_CTR,
); );
+3 -1
View File
@@ -185,13 +185,15 @@ gcrypt_dh_t *gcrypt_dh_create(diffie_hellman_group_t group)
} }
INIT(this, INIT(this,
.public.dh = { .public = {
.dh = {
.get_shared_secret = _get_shared_secret, .get_shared_secret = _get_shared_secret,
.set_other_public_value = _set_other_public_value, .set_other_public_value = _set_other_public_value,
.get_my_public_value = _get_my_public_value, .get_my_public_value = _get_my_public_value,
.get_dh_group = _get_dh_group, .get_dh_group = _get_dh_group,
.destroy = _destroy, .destroy = _destroy,
}, },
},
.group = group, .group = group,
.p_len = params->prime.len, .p_len = params->prime.len,
); );
@@ -121,13 +121,15 @@ gcrypt_hasher_t *gcrypt_hasher_create(hash_algorithm_t algo)
} }
INIT(this, INIT(this,
.public.hasher = { .public = {
.hasher = {
.get_hash = _get_hash, .get_hash = _get_hash,
.allocate_hash = _allocate_hash, .allocate_hash = _allocate_hash,
.get_hash_size = _get_hash_size, .get_hash_size = _get_hash_size,
.reset = _reset, .reset = _reset,
.destroy = _destroy, .destroy = _destroy,
}, },
},
); );
err = gcry_md_open(&this->hd, gcrypt_alg, 0); err = gcry_md_open(&this->hd, gcrypt_alg, 0);
@@ -138,7 +138,11 @@ plugin_t *gcrypt_plugin_create()
gcry_control(GCRYCTL_INITIALIZATION_FINISHED, 0); gcry_control(GCRYCTL_INITIALIZATION_FINISHED, 0);
INIT(this, INIT(this,
.public.plugin.destroy = _destroy, .public = {
.plugin = {
.destroy = _destroy,
},
},
); );
/* hashers */ /* hashers */
@@ -83,11 +83,13 @@ gcrypt_rng_t *gcrypt_rng_create(rng_quality_t quality)
} }
INIT(this, INIT(this,
.public.rng = { .public = {
.rng = {
.get_bytes = _get_bytes, .get_bytes = _get_bytes,
.allocate_bytes = _allocate_bytes, .allocate_bytes = _allocate_bytes,
.destroy = _destroy, .destroy = _destroy,
}, },
},
.quality = quality, .quality = quality,
); );
@@ -427,7 +427,8 @@ static private_gcrypt_rsa_private_key_t *create_empty()
private_gcrypt_rsa_private_key_t *this; private_gcrypt_rsa_private_key_t *this;
INIT(this, INIT(this,
.public.key = { .public = {
.key = {
.get_type = _get_type, .get_type = _get_type,
.sign = _sign, .sign = _sign,
.decrypt = _decrypt, .decrypt = _decrypt,
@@ -441,6 +442,7 @@ static private_gcrypt_rsa_private_key_t *create_empty()
.get_ref = _get_ref, .get_ref = _get_ref,
.destroy = _destroy, .destroy = _destroy,
}, },
},
.ref = 1, .ref = 1,
); );
@@ -322,7 +322,8 @@ gcrypt_rsa_public_key_t *gcrypt_rsa_public_key_load(key_type_t type,
} }
INIT(this, INIT(this,
.public.key = { .public = {
.key = {
.get_type = _get_type, .get_type = _get_type,
.verify = _verify, .verify = _verify,
.encrypt = _encrypt_, .encrypt = _encrypt_,
@@ -334,6 +335,7 @@ gcrypt_rsa_public_key_t *gcrypt_rsa_public_key_load(key_type_t type,
.get_ref = _get_ref, .get_ref = _get_ref,
.destroy = _destroy, .destroy = _destroy,
}, },
},
.ref = 1, .ref = 1,
); );
@@ -206,13 +206,15 @@ gmp_diffie_hellman_t *gmp_diffie_hellman_create(diffie_hellman_group_t group)
} }
INIT(this, INIT(this,
.public.dh = { .public = {
.dh = {
.get_shared_secret = _get_shared_secret, .get_shared_secret = _get_shared_secret,
.set_other_public_value = _set_other_public_value, .set_other_public_value = _set_other_public_value,
.get_my_public_value = _get_my_public_value, .get_my_public_value = _get_my_public_value,
.get_dh_group = _get_dh_group, .get_dh_group = _get_dh_group,
.destroy = _destroy, .destroy = _destroy,
}, },
},
.group = group, .group = group,
.p_len = params->prime.len, .p_len = params->prime.len,
); );
+5 -1
View File
@@ -55,7 +55,11 @@ plugin_t *gmp_plugin_create()
private_gmp_plugin_t *this; private_gmp_plugin_t *this;
INIT(this, INIT(this,
.public.plugin.destroy = _destroy, .public = {
.plugin = {
.destroy = _destroy,
},
},
); );
lib->crypto->add_dh(lib->crypto, MODP_2048_BIT, lib->crypto->add_dh(lib->crypto, MODP_2048_BIT,
@@ -566,7 +566,8 @@ static private_gmp_rsa_private_key_t *gmp_rsa_private_key_create_empty(void)
private_gmp_rsa_private_key_t *this; private_gmp_rsa_private_key_t *this;
INIT(this, INIT(this,
.public.key = { .public = {
.key = {
.get_type = _get_type, .get_type = _get_type,
.sign = _sign, .sign = _sign,
.decrypt = _decrypt, .decrypt = _decrypt,
@@ -580,6 +581,7 @@ static private_gmp_rsa_private_key_t *gmp_rsa_private_key_create_empty(void)
.get_ref = _get_ref, .get_ref = _get_ref,
.destroy = _destroy, .destroy = _destroy,
}, },
},
.ref = 1, .ref = 1,
); );
return this; return this;
@@ -471,7 +471,8 @@ gmp_rsa_public_key_t *gmp_rsa_public_key_load(key_type_t type, va_list args)
} }
INIT(this, INIT(this,
.public.key = { .public = {
.key = {
.get_type = _get_type, .get_type = _get_type,
.verify = _verify, .verify = _verify,
.encrypt = _encrypt_, .encrypt = _encrypt_,
@@ -483,6 +484,7 @@ gmp_rsa_public_key_t *gmp_rsa_public_key_load(key_type_t type, va_list args)
.get_ref = _get_ref, .get_ref = _get_ref,
.destroy = _destroy, .destroy = _destroy,
}, },
},
.ref = 1, .ref = 1,
); );
+5 -1
View File
@@ -50,7 +50,11 @@ plugin_t *hmac_plugin_create()
private_hmac_plugin_t *this; private_hmac_plugin_t *this;
INIT(this, INIT(this,
.public.plugin.destroy = _destroy, .public = {
.plugin = {
.destroy = _destroy,
},
},
); );
lib->crypto->add_prf(lib->crypto, PRF_HMAC_SHA2_256, lib->crypto->add_prf(lib->crypto, PRF_HMAC_SHA2_256,
+3 -1
View File
@@ -108,7 +108,8 @@ hmac_prf_t *hmac_prf_create(pseudo_random_function_t algo)
} }
INIT(this, INIT(this,
.public.prf = { .public = {
.prf = {
.get_bytes = _get_bytes, .get_bytes = _get_bytes,
.allocate_bytes = _allocate_bytes, .allocate_bytes = _allocate_bytes,
.get_block_size = _get_block_size, .get_block_size = _get_block_size,
@@ -116,6 +117,7 @@ hmac_prf_t *hmac_prf_create(pseudo_random_function_t algo)
.set_key = _set_key, .set_key = _set_key,
.destroy = _destroy, .destroy = _destroy,
}, },
},
.hmac = hmac, .hmac = hmac,
); );
+3 -1
View File
@@ -172,7 +172,8 @@ hmac_signer_t *hmac_signer_create(integrity_algorithm_t algo)
} }
INIT(this, INIT(this,
.public.signer = { .public = {
.signer = {
.get_signature = _get_signature, .get_signature = _get_signature,
.allocate_signature = _allocate_signature, .allocate_signature = _allocate_signature,
.verify_signature = _verify_signature, .verify_signature = _verify_signature,
@@ -181,6 +182,7 @@ hmac_signer_t *hmac_signer_create(integrity_algorithm_t algo)
.set_key = _set_key, .set_key = _set_key,
.destroy = _destroy, .destroy = _destroy,
}, },
},
.block_size = min(trunc, hmac->get_block_size(hmac)), .block_size = min(trunc, hmac->get_block_size(hmac)),
.hmac = hmac, .hmac = hmac,
); );
@@ -165,7 +165,8 @@ openssl_crypter_t *openssl_crypter_create(encryption_algorithm_t algo,
private_openssl_crypter_t *this; private_openssl_crypter_t *this;
INIT(this, INIT(this,
.public.crypter = { .public = {
.crypter = {
.encrypt = _encrypt, .encrypt = _encrypt,
.decrypt = _decrypt, .decrypt = _decrypt,
.get_block_size = _get_block_size, .get_block_size = _get_block_size,
@@ -174,6 +175,7 @@ openssl_crypter_t *openssl_crypter_create(encryption_algorithm_t algo,
.set_key = _set_key, .set_key = _set_key,
.destroy = _destroy, .destroy = _destroy,
}, },
},
); );
switch (algo) switch (algo)
@@ -143,13 +143,15 @@ openssl_diffie_hellman_t *openssl_diffie_hellman_create(diffie_hellman_group_t g
private_openssl_diffie_hellman_t *this; private_openssl_diffie_hellman_t *this;
INIT(this, INIT(this,
.public.dh = { .public = {
.dh = {
.get_shared_secret = _get_shared_secret, .get_shared_secret = _get_shared_secret,
.set_other_public_value = _set_other_public_value, .set_other_public_value = _set_other_public_value,
.get_my_public_value = _get_my_public_value, .get_my_public_value = _get_my_public_value,
.get_dh_group = _get_dh_group, .get_dh_group = _get_dh_group,
.destroy = _destroy, .destroy = _destroy,
}, },
},
); );
this->dh = DH_new(); this->dh = DH_new();
@@ -269,13 +269,15 @@ openssl_ec_diffie_hellman_t *openssl_ec_diffie_hellman_create(diffie_hellman_gro
private_openssl_ec_diffie_hellman_t *this; private_openssl_ec_diffie_hellman_t *this;
INIT(this, INIT(this,
.public.dh = { .public = {
.dh = {
.get_shared_secret = _get_shared_secret, .get_shared_secret = _get_shared_secret,
.set_other_public_value = _set_other_public_value, .set_other_public_value = _set_other_public_value,
.get_my_public_value = _get_my_public_value, .get_my_public_value = _get_my_public_value,
.get_dh_group = _get_dh_group, .get_dh_group = _get_dh_group,
.destroy = _destroy, .destroy = _destroy,
}, },
},
.group = group, .group = group,
); );
@@ -286,7 +286,8 @@ static private_openssl_ec_private_key_t *create_empty(void)
private_openssl_ec_private_key_t *this; private_openssl_ec_private_key_t *this;
INIT(this, INIT(this,
.public.key = { .public = {
.key = {
.get_type = _get_type, .get_type = _get_type,
.sign = _sign, .sign = _sign,
.decrypt = _decrypt, .decrypt = _decrypt,
@@ -300,6 +301,7 @@ static private_openssl_ec_private_key_t *create_empty(void)
.get_ref = _get_ref, .get_ref = _get_ref,
.destroy = _destroy, .destroy = _destroy,
}, },
},
.ref = 1, .ref = 1,
); );
@@ -303,7 +303,8 @@ static private_openssl_ec_public_key_t *create_empty()
private_openssl_ec_public_key_t *this; private_openssl_ec_public_key_t *this;
INIT(this, INIT(this,
.public.key = { .public = {
.key = {
.get_type = _get_type, .get_type = _get_type,
.verify = _verify, .verify = _verify,
.encrypt = _encrypt, .encrypt = _encrypt,
@@ -315,6 +316,7 @@ static private_openssl_ec_public_key_t *create_empty()
.get_ref = _get_ref, .get_ref = _get_ref,
.destroy = _destroy, .destroy = _destroy,
}, },
},
.ref = 1, .ref = 1,
); );
@@ -149,13 +149,15 @@ openssl_hasher_t *openssl_hasher_create(hash_algorithm_t algo)
} }
INIT(this, INIT(this,
.public.hasher = { .public = {
.hasher = {
.get_hash = _get_hash, .get_hash = _get_hash,
.allocate_hash = _allocate_hash, .allocate_hash = _allocate_hash,
.get_hash_size = _get_hash_size, .get_hash_size = _get_hash_size,
.reset = _reset, .reset = _reset,
.destroy = _destroy, .destroy = _destroy,
}, },
},
); );
this->hasher = EVP_get_digestbyname(name); this->hasher = EVP_get_digestbyname(name);
@@ -245,7 +245,11 @@ plugin_t *openssl_plugin_create()
private_openssl_plugin_t *this; private_openssl_plugin_t *this;
INIT(this, INIT(this,
.public.plugin.destroy = _destroy, .public = {
.plugin = {
.destroy = _destroy,
},
},
); );
threading_init(); threading_init();
@@ -293,7 +293,8 @@ static private_openssl_rsa_private_key_t *create_empty()
private_openssl_rsa_private_key_t *this; private_openssl_rsa_private_key_t *this;
INIT(this, INIT(this,
.public.key = { .public = {
.key = {
.get_type = _get_type, .get_type = _get_type,
.sign = _sign, .sign = _sign,
.decrypt = _decrypt, .decrypt = _decrypt,
@@ -307,6 +308,7 @@ static private_openssl_rsa_private_key_t *create_empty()
.get_ref = _get_ref, .get_ref = _get_ref,
.destroy = _destroy, .destroy = _destroy,
}, },
},
.ref = 1, .ref = 1,
); );
@@ -304,7 +304,8 @@ static private_openssl_rsa_public_key_t *create_empty()
private_openssl_rsa_public_key_t *this; private_openssl_rsa_public_key_t *this;
INIT(this, INIT(this,
.public.key = { .public = {
.key = {
.get_type = _get_type, .get_type = _get_type,
.verify = _verify, .verify = _verify,
.encrypt = _encrypt, .encrypt = _encrypt,
@@ -316,6 +317,7 @@ static private_openssl_rsa_public_key_t *create_empty()
.get_ref = _get_ref, .get_ref = _get_ref,
.destroy = _destroy, .destroy = _destroy,
}, },
},
.ref = 1, .ref = 1,
); );
@@ -124,7 +124,8 @@ openssl_sha1_prf_t *openssl_sha1_prf_create(pseudo_random_function_t algo)
} }
INIT(this, INIT(this,
.public.prf = { .public = {
.prf = {
.get_block_size = _get_block_size, .get_block_size = _get_block_size,
.get_bytes = _get_bytes, .get_bytes = _get_bytes,
.allocate_bytes = _allocate_bytes, .allocate_bytes = _allocate_bytes,
@@ -132,6 +133,7 @@ openssl_sha1_prf_t *openssl_sha1_prf_create(pseudo_random_function_t algo)
.set_key = _set_key, .set_key = _set_key,
.destroy = _destroy, .destroy = _destroy,
}, },
},
); );
return &this->public; return &this->public;
@@ -177,7 +177,8 @@ padlock_aes_crypter_t *padlock_aes_crypter_create(encryption_algorithm_t algo,
} }
INIT(this, INIT(this,
.public.crypter = { .public = {
.crypter = {
.encrypt = _encrypt, .encrypt = _encrypt,
.decrypt = _decrypt, .decrypt = _decrypt,
.get_block_size = _get_block_size, .get_block_size = _get_block_size,
@@ -186,6 +187,7 @@ padlock_aes_crypter_t *padlock_aes_crypter_create(encryption_algorithm_t algo,
.set_key = _set_key, .set_key = _set_key,
.destroy = _destroy, .destroy = _destroy,
}, },
},
.key = chunk_alloc(key_size), .key = chunk_alloc(key_size),
); );
return &this->public; return &this->public;
@@ -134,7 +134,11 @@ plugin_t *padlock_plugin_create()
private_padlock_plugin_t *this; private_padlock_plugin_t *this;
INIT(this, INIT(this,
.public.plugin.destroy = _destroy, .public = {
.plugin = {
.destroy = _destroy,
},
},
.features = get_padlock_features(), .features = get_padlock_features(),
); );
@@ -104,11 +104,13 @@ padlock_rng_t *padlock_rng_create(rng_quality_t quality)
private_padlock_rng_t *this; private_padlock_rng_t *this;
INIT(this, INIT(this,
.public.rng = { .public = {
.rng = {
.get_bytes = _get_bytes, .get_bytes = _get_bytes,
.allocate_bytes = _allocate_bytes, .allocate_bytes = _allocate_bytes,
.destroy = _destroy, .destroy = _destroy,
}, },
},
); );
/* map RNG quality to Padlock quality factor */ /* map RNG quality to Padlock quality factor */
@@ -150,13 +150,15 @@ padlock_sha1_hasher_t *padlock_sha1_hasher_create(hash_algorithm_t algo)
return NULL; return NULL;
} }
INIT(this, INIT(this,
.public.hasher = { .public = {
.hasher = {
.get_hash = _get_hash, .get_hash = _get_hash,
.allocate_hash = _allocate_hash, .allocate_hash = _allocate_hash,
.get_hash_size = _get_hash_size, .get_hash_size = _get_hash_size,
.reset = _reset, .reset = _reset,
.destroy = _destroy, .destroy = _destroy,
}, },
},
); );
return &this->public; return &this->public;
} }
@@ -300,13 +300,15 @@ pkcs11_hasher_t *pkcs11_hasher_create(hash_algorithm_t algo)
private_pkcs11_hasher_t *this; private_pkcs11_hasher_t *this;
INIT(this, INIT(this,
.public.hasher = { .public = {
.hasher = {
.get_hash_size = _get_hash_size, .get_hash_size = _get_hash_size,
.reset = _reset, .reset = _reset,
.get_hash = _get_hash, .get_hash = _get_hash,
.allocate_hash = _allocate_hash, .allocate_hash = _allocate_hash,
.destroy = _destroy, .destroy = _destroy,
}, },
},
.mutex = mutex_create(MUTEX_TYPE_DEFAULT), .mutex = mutex_create(MUTEX_TYPE_DEFAULT),
); );
@@ -132,7 +132,11 @@ plugin_t *pkcs11_plugin_create()
CK_SLOT_ID slot; CK_SLOT_ID slot;
INIT(this, INIT(this,
.public.plugin.destroy = _destroy, .public = {
.plugin = {
.destroy = _destroy,
},
},
.creds = linked_list_create(), .creds = linked_list_create(),
.mutex = mutex_create(MUTEX_TYPE_DEFAULT), .mutex = mutex_create(MUTEX_TYPE_DEFAULT),
); );
@@ -531,7 +531,8 @@ pkcs11_private_key_t *pkcs11_private_key_connect(key_type_t type, va_list args)
} }
INIT(this, INIT(this,
.public.key = { .public = {
.key = {
.get_type = _get_type, .get_type = _get_type,
.sign = _sign, .sign = _sign,
.decrypt = _decrypt, .decrypt = _decrypt,
@@ -545,6 +546,7 @@ pkcs11_private_key_t *pkcs11_private_key_connect(key_type_t type, va_list args)
.get_ref = _get_ref, .get_ref = _get_ref,
.destroy = _destroy, .destroy = _destroy,
}, },
},
.ref = 1, .ref = 1,
); );
@@ -52,7 +52,11 @@ plugin_t *revocation_plugin_create()
private_revocation_plugin_t *this; private_revocation_plugin_t *this;
INIT(this, INIT(this,
.public.plugin.destroy = _destroy, .public = {
.plugin = {
.destroy = _destroy,
},
},
.validator = revocation_validator_create(), .validator = revocation_validator_create(),
); );
lib->credmgr->add_validator(lib->credmgr, &this->validator->validator); lib->credmgr->add_validator(lib->credmgr, &this->validator->validator);
+5 -1
View File
@@ -50,7 +50,11 @@ plugin_t *xcbc_plugin_create()
private_xcbc_plugin_t *this; private_xcbc_plugin_t *this;
INIT(this, INIT(this,
.public.plugin.destroy = _destroy, .public = {
.plugin = {
.destroy = _destroy,
},
},
); );
lib->crypto->add_prf(lib->crypto, PRF_AES128_XCBC, lib->crypto->add_prf(lib->crypto, PRF_AES128_XCBC,
+3 -1
View File
@@ -106,7 +106,8 @@ xcbc_prf_t *xcbc_prf_create(pseudo_random_function_t algo)
} }
INIT(this, INIT(this,
.public.prf = { .public = {
.prf = {
.get_bytes = _get_bytes, .get_bytes = _get_bytes,
.allocate_bytes = _allocate_bytes, .allocate_bytes = _allocate_bytes,
.get_block_size = _get_block_size, .get_block_size = _get_block_size,
@@ -114,6 +115,7 @@ xcbc_prf_t *xcbc_prf_create(pseudo_random_function_t algo)
.set_key = _set_key, .set_key = _set_key,
.destroy = _destroy, .destroy = _destroy,
}, },
},
.xcbc = xcbc, .xcbc = xcbc,
); );
+3 -1
View File
@@ -144,7 +144,8 @@ xcbc_signer_t *xcbc_signer_create(integrity_algorithm_t algo)
} }
INIT(this, INIT(this,
.public.signer = { .public = {
.signer = {
.get_signature = _get_signature, .get_signature = _get_signature,
.allocate_signature = _allocate_signature, .allocate_signature = _allocate_signature,
.verify_signature = _verify_signature, .verify_signature = _verify_signature,
@@ -153,6 +154,7 @@ xcbc_signer_t *xcbc_signer_create(integrity_algorithm_t algo)
.set_key = _set_key, .set_key = _set_key,
.destroy = _destroy, .destroy = _destroy,
}, },
},
.xcbc = xcbc, .xcbc = xcbc,
.block_size = min(trunc, xcbc->get_block_size(xcbc)), .block_size = min(trunc, xcbc->get_block_size(xcbc)),
); );
+3 -2
View File
@@ -645,7 +645,8 @@ tls_peer_t *tls_peer_create(tls_t *tls, tls_crypto_t *crypto,
private_tls_peer_t *this; private_tls_peer_t *this;
INIT(this, INIT(this,
.public.handshake = { .public = {
.handshake = {
.process = _process, .process = _process,
.build = _build, .build = _build,
.cipherspec_changed = _cipherspec_changed, .cipherspec_changed = _cipherspec_changed,
@@ -653,12 +654,12 @@ tls_peer_t *tls_peer_create(tls_t *tls, tls_crypto_t *crypto,
.finished = _finished, .finished = _finished,
.destroy = _destroy, .destroy = _destroy,
}, },
},
.state = STATE_INIT, .state = STATE_INIT,
.tls = tls, .tls = tls,
.crypto = crypto, .crypto = crypto,
.peer = peer, .peer = peer,
.server = server, .server = server,
.peer_auth_requested = FALSE,
.peer_auth = auth_cfg_create(), .peer_auth = auth_cfg_create(),
.server_auth = auth_cfg_create(), .server_auth = auth_cfg_create(),
); );
+3 -1
View File
@@ -635,7 +635,8 @@ tls_server_t *tls_server_create(tls_t *tls, tls_crypto_t *crypto,
private_tls_server_t *this; private_tls_server_t *this;
INIT(this, INIT(this,
.public.handshake = { .public = {
.handshake = {
.process = _process, .process = _process,
.build = _build, .build = _build,
.cipherspec_changed = _cipherspec_changed, .cipherspec_changed = _cipherspec_changed,
@@ -643,6 +644,7 @@ tls_server_t *tls_server_create(tls_t *tls, tls_crypto_t *crypto,
.finished = _finished, .finished = _finished,
.destroy = _destroy, .destroy = _destroy,
}, },
},
.tls = tls, .tls = tls,
.crypto = crypto, .crypto = crypto,
.server = server, .server = server,