u_int32_t now = time_monotonic(NULL);
INIT(this,
- .public.destroy = _destroy,
+ .public = {
+ .destroy = _destroy,
+ },
.secret_switch = now,
.secret_offset = random() % now,
);
private_addrblock_plugin_t *this;
INIT(this,
- .public.plugin.destroy = _destroy,
+ .public = {
+ .plugin = {
+ .destroy = _destroy,
+ },
+ },
.validator = addrblock_validator_create(),
.narrower = addrblock_narrow_create(),
);
private_android_plugin_t *this;
INIT(this,
- .public.plugin = {
- .destroy = _destroy,
+ .public = {
+ .plugin = {
+ .destroy = _destroy,
+ },
},
.logger = android_logger_create(),
.handler = android_handler_create(),
private_dhcp_plugin_t *this;
INIT(this,
- .public.plugin.destroy = _destroy,
+ .public = {
+ .plugin = {
+ .destroy = _destroy,
+ },
+ },
.socket = dhcp_socket_create(),
);
INIT(this,
.public = {
- .eap_method_interface = {
+ .eap_method = {
.initiate = _initiate_peer,
.process = _process_peer,
.get_type = _get_type,
private_eap_identity_t *this;
INIT(this,
- .public.eap_method_interface = {
- .initiate = _initiate_server,
- .process = _process_server,
- .get_type = _get_type,
- .is_mutual = _is_mutual,
- .get_msk = _get_msk,
- .destroy = _destroy,
+ .public = {
+ .eap_method = {
+ .initiate = _initiate_server,
+ .process = _process_server,
+ .get_type = _get_type,
+ .is_mutual = _is_mutual,
+ .get_msk = _get_msk,
+ .destroy = _destroy,
+ },
},
.peer = peer->clone(peer),
.identity = chunk_empty,
/**
* Implemented eap_method_t interface.
*/
- eap_method_t eap_method_interface;
+ eap_method_t eap_method;
};
/**
INIT(this,
.public = {
- .eap_method_interface = {
+ .eap_method = {
.initiate = _initiate_server,
.process = _process_server,
.get_type = _get_type,
},
.peer = peer->clone(peer),
.server = server->clone(server),
- .challenge = chunk_empty,
- .identifier = 0,
);
/* generate a non-zero identifier */
private_eap_md5_t *this;
INIT(this,
- .public.eap_method_interface = {
- .initiate = _initiate_peer,
- .process = _process_peer,
- .get_type = _get_type,
- .is_mutual = _is_mutual,
- .get_msk = _get_msk,
- .destroy = _destroy,
+ .public = {
+ .eap_method = {
+ .initiate = _initiate_peer,
+ .process = _process_peer,
+ .get_type = _get_type,
+ .is_mutual = _is_mutual,
+ .get_msk = _get_msk,
+ .destroy = _destroy,
+ },
},
.peer = peer->clone(peer),
.server = server->clone(server),
- .challenge = chunk_empty,
- .identifier = 0,
);
return &this->public;
/**
* Implemented eap_method_t interface.
*/
- eap_method_t eap_method_interface;
+ eap_method_t eap_method;
};
/**
private_eap_radius_t *this;
INIT(this,
- .public.eap_method_interface = {
- .initiate = _initiate,
- .process = _process,
- .get_type = _get_type,
- .is_mutual = _is_mutual,
- .get_msk = _get_msk,
- .destroy = _destroy,
+ .public = {
+ .eap_method = {
+ .initiate = _initiate,
+ .process = _process,
+ .get_type = _get_type,
+ .is_mutual = _is_mutual,
+ .get_msk = _get_msk,
+ .destroy = _destroy,
+ },
},
/* initially EAP_RADIUS, but is set to the method selected by RADIUS */
.type = EAP_RADIUS,
/**
* Implemented eap_method_t interface.
*/
- eap_method_t eap_method_interface;
+ eap_method_t eap_method;
};
/**
private_eap_radius_plugin_t *this;
INIT(this,
- .public.plugin.destroy = _destroy,
+ .public = {
+ .plugin = {
+ .destroy = _destroy,
+ },
+ },
.servers = linked_list_create(),
);
"charon.plugins.eap-simaka-sql.remove_used", FALSE);
INIT(this,
- .public.plugin = {
- .destroy = _destroy,
+ .public = {
+ .plugin = {
+ .destroy = _destroy,
+ },
},
.db = db,
.provider = eap_simaka_sql_provider_create(db, remove_used),
private_eap_tls_t *this;
INIT(this,
- .public.eap_method = {
- .initiate = _initiate,
- .process = _process,
- .get_type = _get_type,
- .is_mutual = _is_mutual,
- .get_msk = _get_msk,
- .destroy = _destroy,
+ .public = {
+ .eap_method = {
+ .initiate = _initiate,
+ .process = _process,
+ .get_type = _get_type,
+ .is_mutual = _is_mutual,
+ .get_msk = _get_msk,
+ .destroy = _destroy,
+ },
},
.is_server = is_server,
);
eap_tls_plugin_t *this;
INIT(this,
- .plugin.destroy = _destroy,
+ .plugin = {
+ .destroy = _destroy,
+ },
);
charon->eap->add_method(charon->eap, EAP_TLS, 0, EAP_SERVER,
private_eap_ttls_t *this;
INIT(this,
- .public.eap_method = {
- .initiate = _initiate,
- .process = _process,
- .get_type = _get_type,
- .is_mutual = _is_mutual,
- .get_msk = _get_msk,
- .destroy = _destroy,
+ .public = {
+ .eap_method = {
+ .initiate = _initiate,
+ .process = _process,
+ .get_type = _get_type,
+ .is_mutual = _is_mutual,
+ .get_msk = _get_msk,
+ .destroy = _destroy,
+ },
},
.is_server = is_server,
);
bool start_phase2;
/**
- * Current phase 2 EAP method
+ * Current phase 2 EAP method
*/
eap_method_t *method;
/**
- * Pending outbound EAP message
+ * Pending outbound EAP message
*/
eap_payload_t *out;
return NEED_MORE;
}
}
-
+
type = this->method->get_type(this->method, &vendor);
if (type != received_type || vendor != received_vendor)
DBG1(DBG_IKE, "%N method failed", eap_type_names, type);
}
return FAILED;
- }
+ }
}
METHOD(tls_application_t, build, status_t,
private_eap_ttls_peer_t *this;
INIT(this,
- .public.application = {
- .process = _process,
- .build = _build,
- .destroy = _destroy,
+ .public = {
+ .application = {
+ .process = _process,
+ .build = _build,
+ .destroy = _destroy,
+ },
},
.server = server->clone(server),
.peer = peer->clone(peer),
.start_phase2 = TRUE,
- .method = NULL,
- .out = NULL,
.avp = eap_ttls_avp_create(),
);
eap_ttls_plugin_t *this;
INIT(this,
- .plugin.destroy = _destroy,
+ .plugin = {
+ .destroy = _destroy,
+ },
);
charon->eap->add_method(charon->eap, EAP_TTLS, 0, EAP_SERVER,
bool start_phase2;
/**
- * Current phase 2 EAP method
+ * Current phase 2 EAP method
*/
eap_method_t *method;
/**
- * Pending outbound EAP message
+ * Pending outbound EAP message
*/
eap_payload_t *out;
return FAILED;
}
}
-
+
if (!received_vendor && received_type == EAP_IDENTITY)
{
chunk_t eap_id;
return FAILED;
}
}
-
+
if (this->method == 0)
{
DBG1(DBG_IKE, "no %N phase2 method installed", eap_type_names, EAP_TTLS);
status = this->method->process(this->method, in, &this->out);
in->destroy(in);
-
+
switch (status)
{
case SUCCESS:
DBG1(DBG_IKE, "%N method failed", eap_type_names, type);
}
return FAILED;
- }
+ }
return status;
}
private_eap_ttls_server_t *this;
INIT(this,
- .public.application = {
- .process = _process,
- .build = _build,
- .destroy = _destroy,
+ .public = {
+ .application = {
+ .process = _process,
+ .build = _build,
+ .destroy = _destroy,
+ },
},
.server = server->clone(server),
.peer = peer->clone(peer),
.start_phase2 = TRUE,
- .method = NULL,
- .out = NULL,
.avp = eap_ttls_avp_create(),
);
private_farp_plugin_t *this;
INIT(this,
- .public.plugin.destroy = _destroy,
+ .public = {
+ .plugin = {
+ .destroy = _destroy,
+ },
+ },
.listener = farp_listener_create(),
);
}
INIT(this,
- .public.plugin.destroy = _destroy,
+ .public = {
+ .plugin = {
+ .destroy = _destroy,
+ },
+ },
);
if (secret)
private_kernel_klips_ipsec_t *this;
INIT(this,
- .public.interface = {
- .get_spi = _get_spi,
- .get_cpi = _get_cpi,
- .add_sa = _add_sa,
- .update_sa = _update_sa,
- .query_sa = _query_sa,
- .del_sa = _del_sa,
- .add_policy = _add_policy,
- .query_policy = _query_policy,
- .del_policy = _del_policy,
- .bypass_socket = _bypass_socket,
- .destroy = _destroy,
+ .public = {
+ .interface = {
+ .get_spi = _get_spi,
+ .get_cpi = _get_cpi,
+ .add_sa = _add_sa,
+ .update_sa = _update_sa,
+ .query_sa = _query_sa,
+ .del_sa = _del_sa,
+ .add_policy = _add_policy,
+ .query_policy = _query_policy,
+ .del_policy = _del_policy,
+ .bypass_socket = _bypass_socket,
+ .destroy = _destroy,
+ },
},
.policies = linked_list_create(),
.allocated_spis = linked_list_create(),
*/
static bool policy_equals(policy_entry_t *key, policy_entry_t *other_key)
{
- return memeq(&key->sel, &other_key->sel,
+ return memeq(&key->sel, &other_key->sel,
sizeof(struct xfrm_selector) + sizeof(u_int32_t)) &&
key->direction == other_key->direction;
}
case NLMSG_ERROR:
{
struct nlmsgerr *err = NLMSG_DATA(hdr);
-
+
if (mark.value)
{
DBG1(DBG_KNL, "querying SAD entry with SPI %.8x "
int fd;
INIT(this,
- .public.interface = {
- .get_spi = _get_spi,
- .get_cpi = _get_cpi,
- .add_sa = _add_sa,
- .update_sa = _update_sa,
- .query_sa = _query_sa,
- .del_sa = _del_sa,
- .add_policy = _add_policy,
- .query_policy = _query_policy,
- .del_policy = _del_policy,
- .bypass_socket = _bypass_socket,
- .destroy = _destroy,
+ .public = {
+ .interface = {
+ .get_spi = _get_spi,
+ .get_cpi = _get_cpi,
+ .add_sa = _add_sa,
+ .update_sa = _update_sa,
+ .query_sa = _query_sa,
+ .del_sa = _del_sa,
+ .add_policy = _add_policy,
+ .query_policy = _query_policy,
+ .del_policy = _del_policy,
+ .bypass_socket = _bypass_socket,
+ .destroy = _destroy,
+ },
},
.policies = hashtable_create((hashtable_hash_t)policy_hash,
(hashtable_equals_t)policy_equals, 32),
private_kernel_pfkey_ipsec_t *this;
INIT(this,
- .public.interface = {
- .get_spi = _get_spi,
- .get_cpi = _get_cpi,
- .add_sa = _add_sa,
- .update_sa = _update_sa,
- .query_sa = _query_sa,
- .del_sa = _del_sa,
- .add_policy = _add_policy,
- .query_policy = _query_policy,
- .del_policy = _del_policy,
- .bypass_socket = _bypass_socket,
- .destroy = _destroy,
+ .public = {
+ .interface = {
+ .get_spi = _get_spi,
+ .get_cpi = _get_cpi,
+ .add_sa = _add_sa,
+ .update_sa = _update_sa,
+ .query_sa = _query_sa,
+ .del_sa = _del_sa,
+ .add_policy = _add_policy,
+ .query_policy = _query_policy,
+ .del_policy = _del_policy,
+ .bypass_socket = _bypass_socket,
+ .destroy = _destroy,
+ },
},
.policies = linked_list_create(),
.mutex = mutex_create(MUTEX_TYPE_DEFAULT),
private_socket_default_plugin_t *this;
INIT(this,
- .public.plugin.destroy = _destroy,
+ .public = {
+ .plugin = {
+ .destroy = _destroy,
+ },
+ },
.socket = socket_default_socket_create(),
);
private_socket_dynamic_plugin_t *this;
INIT(this,
- .public.plugin.destroy = _destroy,
+ .public = {
+ .plugin = {
+ .destroy = _destroy,
+ },
+ },
.socket = socket_dynamic_socket_create(),
);
private_socket_raw_plugin_t *this;
INIT(this,
- .public.plugin.destroy = _destroy,
+ .public = {
+ .plugin = {
+ .destroy = _destroy,
+ },
+ },
.socket = socket_raw_socket_create(),
);
private_inactivity_job_t *this;
INIT(this,
- .public.job_interface = {
- .execute = _execute,
- .destroy = _destroy,
+ .public = {
+ .job_interface = {
+ .execute = _execute,
+ .destroy = _destroy,
+ },
},
.reqid = reqid,
.timeout = timeout,
.received_nonce = received_nonce,
.sent_init = sent_init,
.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;
private_eap_authenticator_t *this;
INIT(this,
- .public.authenticator = {
- .build = _build_server,
- .process = _process_server,
- .is_mutual = _is_mutual,
- .destroy = _destroy,
+ .public = {
+ .authenticator = {
+ .build = _build_server,
+ .process = _process_server,
+ .is_mutual = _is_mutual,
+ .destroy = _destroy,
+ },
},
.ike_sa = ike_sa,
.received_init = received_init,
.received_nonce = received_nonce,
.sent_init = sent_init,
.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;
private_ike_vendor_t *this;
INIT(this,
- .public.task = {
- .build = _build,
- .process = _process,
- .migrate = _migrate,
- .get_type = _get_type,
- .destroy = _destroy,
+ .public = {
+ .task = {
+ .build = _build,
+ .process = _process,
+ .migrate = _migrate,
+ .get_type = _get_type,
+ .destroy = _destroy,
+ },
},
.initiator = initiator,
.ike_sa = ike_sa,
#endif
INIT(this,
- .public.crypter = {
- .encrypt = _encrypt,
- .decrypt = _decrypt,
- .get_block_size = _get_block_size,
- .get_iv_size = _get_iv_size,
- .get_key_size = _get_key_size,
- .set_key = _set_key,
- .destroy = _destroy,
+ .public = {
+ .crypter = {
+ .encrypt = _encrypt,
+ .decrypt = _decrypt,
+ .get_block_size = _get_block_size,
+ .get_iv_size = _get_iv_size,
+ .get_key_size = _get_key_size,
+ .set_key = _set_key,
+ .destroy = _destroy,
+ },
},
.key_size = key_size,
.aes_Nkey = key_size / 4,
);
- return &(this->public);
+ return &this->public;
}
private_aes_plugin_t *this;
INIT(this,
- .public.plugin.destroy = _destroy,
+ .public = {
+ .plugin = {
+ .destroy = _destroy,
+ },
+ },
);
lib->crypto->add_crypter(lib->crypto, ENCR_AES_CBC,
private_agent_plugin_t *this;
INIT(this,
- .public.plugin.destroy = _destroy,
+ .public = {
+ .plugin = {
+ .destroy = _destroy,
+ },
+ },
);
lib->creds->add_builder(lib->creds, CRED_PRIVATE_KEY, KEY_RSA,
}
INIT(this,
- .public.key = {
- .get_type = _get_type,
- .sign = _sign,
- .decrypt = _decrypt,
- .get_keysize = _get_keysize,
- .get_public_key = _get_public_key,
- .belongs_to = private_key_belongs_to,
- .equals = private_key_equals,
- .get_fingerprint = _get_fingerprint,
- .has_fingerprint = private_key_has_fingerprint,
- .get_encoding = _get_encoding,
- .get_ref = _get_ref,
- .destroy = _destroy,
+ .public = {
+ .key = {
+ .get_type = _get_type,
+ .sign = _sign,
+ .decrypt = _decrypt,
+ .get_keysize = _get_keysize,
+ .get_public_key = _get_public_key,
+ .belongs_to = private_key_belongs_to,
+ .equals = private_key_equals,
+ .get_fingerprint = _get_fingerprint,
+ .has_fingerprint = private_key_has_fingerprint,
+ .get_encoding = _get_encoding,
+ .get_ref = _get_ref,
+ .destroy = _destroy,
+ },
},
.ref = 1,
);
}
INIT(this,
- .public.crypter = {
- .encrypt = _encrypt,
- .decrypt = _decrypt,
- .get_block_size = _get_block_size,
- .get_iv_size = _get_iv_size,
- .get_key_size = _get_key_size,
- .set_key = _set_key,
- .destroy = _destroy,
+ .public = {
+ .crypter = {
+ .encrypt = _encrypt,
+ .decrypt = _decrypt,
+ .get_block_size = _get_block_size,
+ .get_iv_size = _get_iv_size,
+ .get_key_size = _get_key_size,
+ .set_key = _set_key,
+ .destroy = _destroy,
+ },
},
.key_size = key_size ?: 16,
);
private_blowfish_plugin_t *this;
INIT(this,
- .public.plugin.destroy = _destroy,
+ .public = {
+ .plugin = {
+ .destroy = _destroy,
+ },
+ },
);
lib->crypto->add_crypter(lib->crypto, ENCR_BLOWFISH,
}
INIT(this,
- .public.crypter = {
- .encrypt = _crypt,
- .decrypt = _crypt,
- .get_block_size = _get_block_size,
- .get_iv_size = _get_iv_size,
- .get_key_size = _get_key_size,
- .set_key = _set_key,
- .destroy = _destroy,
+ .public = {
+ .crypter = {
+ .encrypt = _crypt,
+ .decrypt = _crypt,
+ .get_block_size = _get_block_size,
+ .get_iv_size = _get_iv_size,
+ .get_key_size = _get_key_size,
+ .set_key = _set_key,
+ .destroy = _destroy,
+ },
},
.crypter = lib->crypto->create_crypter(lib->crypto, algo, key_size),
);
private_ctr_plugin_t *this;
INIT(this,
- .public.plugin.destroy = _destroy,
+ .public = {
+ .plugin = {
+ .destroy = _destroy,
+ },
+ },
);
lib->crypto->add_crypter(lib->crypto, ENCR_AES_CTR,
private_curl_fetcher_t *this;
INIT(this,
- .public.interface = {
- .fetch = _fetch,
- .set_option = _set_option,
- .destroy = _destroy,
+ .public = {
+ .interface = {
+ .fetch = _fetch,
+ .set_option = _set_option,
+ .destroy = _destroy,
+ },
},
.curl = curl_easy_init(),
);
private_des_crypter_t *this;
INIT(this,
- .public.crypter = {
- .get_block_size = _get_block_size,
- .get_iv_size = _get_iv_size,
- .get_key_size = _get_key_size,
- .destroy = _destroy,
+ .public = {
+ .crypter = {
+ .get_block_size = _get_block_size,
+ .get_iv_size = _get_iv_size,
+ .get_key_size = _get_key_size,
+ .destroy = _destroy,
+ },
},
);
private_des_plugin_t *this;
INIT(this,
- .public.plugin.destroy = _destroy,
+ .public = {
+ .plugin = {
+ .destroy = _destroy,
+ },
+ },
);
lib->crypto->add_crypter(lib->crypto, ENCR_3DES,
}
INIT(this,
- .public.crypter = {
- .encrypt = _encrypt,
- .decrypt = _decrypt,
- .get_block_size = _get_block_size,
- .get_iv_size = _get_iv_size,
- .get_key_size = _get_key_size,
- .set_key = _set_key,
- .destroy = _destroy,
+ .public = {
+ .crypter = {
+ .encrypt = _encrypt,
+ .decrypt = _decrypt,
+ .get_block_size = _get_block_size,
+ .get_iv_size = _get_iv_size,
+ .get_key_size = _get_key_size,
+ .set_key = _set_key,
+ .destroy = _destroy,
+ },
},
.alg = gcrypt_alg,
.ctr_mode = mode == GCRY_CIPHER_MODE_CTR,
}
INIT(this,
- .public.dh = {
- .get_shared_secret = _get_shared_secret,
- .set_other_public_value = _set_other_public_value,
- .get_my_public_value = _get_my_public_value,
- .get_dh_group = _get_dh_group,
- .destroy = _destroy,
+ .public = {
+ .dh = {
+ .get_shared_secret = _get_shared_secret,
+ .set_other_public_value = _set_other_public_value,
+ .get_my_public_value = _get_my_public_value,
+ .get_dh_group = _get_dh_group,
+ .destroy = _destroy,
+ },
},
.group = group,
.p_len = params->prime.len,
}
INIT(this,
- .public.hasher = {
- .get_hash = _get_hash,
- .allocate_hash = _allocate_hash,
- .get_hash_size = _get_hash_size,
- .reset = _reset,
- .destroy = _destroy,
+ .public = {
+ .hasher = {
+ .get_hash = _get_hash,
+ .allocate_hash = _allocate_hash,
+ .get_hash_size = _get_hash_size,
+ .reset = _reset,
+ .destroy = _destroy,
+ },
},
);
gcry_control(GCRYCTL_INITIALIZATION_FINISHED, 0);
INIT(this,
- .public.plugin.destroy = _destroy,
+ .public = {
+ .plugin = {
+ .destroy = _destroy,
+ },
+ },
);
/* hashers */
}
INIT(this,
- .public.rng = {
- .get_bytes = _get_bytes,
- .allocate_bytes = _allocate_bytes,
- .destroy = _destroy,
+ .public = {
+ .rng = {
+ .get_bytes = _get_bytes,
+ .allocate_bytes = _allocate_bytes,
+ .destroy = _destroy,
+ },
},
.quality = quality,
);
private_gcrypt_rsa_private_key_t *this;
INIT(this,
- .public.key = {
- .get_type = _get_type,
- .sign = _sign,
- .decrypt = _decrypt,
- .get_keysize = _get_keysize,
- .get_public_key = _get_public_key,
- .equals = private_key_equals,
- .belongs_to = private_key_belongs_to,
- .get_fingerprint = _get_fingerprint,
- .has_fingerprint = private_key_has_fingerprint,
- .get_encoding = _get_encoding,
- .get_ref = _get_ref,
- .destroy = _destroy,
+ .public = {
+ .key = {
+ .get_type = _get_type,
+ .sign = _sign,
+ .decrypt = _decrypt,
+ .get_keysize = _get_keysize,
+ .get_public_key = _get_public_key,
+ .equals = private_key_equals,
+ .belongs_to = private_key_belongs_to,
+ .get_fingerprint = _get_fingerprint,
+ .has_fingerprint = private_key_has_fingerprint,
+ .get_encoding = _get_encoding,
+ .get_ref = _get_ref,
+ .destroy = _destroy,
+ },
},
.ref = 1,
);
}
INIT(this,
- .public.key = {
- .get_type = _get_type,
- .verify = _verify,
- .encrypt = _encrypt_,
- .equals = public_key_equals,
- .get_keysize = _get_keysize,
- .get_fingerprint = _get_fingerprint,
- .has_fingerprint = public_key_has_fingerprint,
- .get_encoding = _get_encoding,
- .get_ref = _get_ref,
- .destroy = _destroy,
+ .public = {
+ .key = {
+ .get_type = _get_type,
+ .verify = _verify,
+ .encrypt = _encrypt_,
+ .equals = public_key_equals,
+ .get_keysize = _get_keysize,
+ .get_fingerprint = _get_fingerprint,
+ .has_fingerprint = public_key_has_fingerprint,
+ .get_encoding = _get_encoding,
+ .get_ref = _get_ref,
+ .destroy = _destroy,
+ },
},
.ref = 1,
);
}
INIT(this,
- .public.dh = {
- .get_shared_secret = _get_shared_secret,
- .set_other_public_value = _set_other_public_value,
- .get_my_public_value = _get_my_public_value,
- .get_dh_group = _get_dh_group,
- .destroy = _destroy,
+ .public = {
+ .dh = {
+ .get_shared_secret = _get_shared_secret,
+ .set_other_public_value = _set_other_public_value,
+ .get_my_public_value = _get_my_public_value,
+ .get_dh_group = _get_dh_group,
+ .destroy = _destroy,
+ },
},
.group = group,
.p_len = params->prime.len,
private_gmp_plugin_t *this;
INIT(this,
- .public.plugin.destroy = _destroy,
+ .public = {
+ .plugin = {
+ .destroy = _destroy,
+ },
+ },
);
lib->crypto->add_dh(lib->crypto, MODP_2048_BIT,
private_gmp_rsa_private_key_t *this;
INIT(this,
- .public.key = {
- .get_type = _get_type,
- .sign = _sign,
- .decrypt = _decrypt,
- .get_keysize = _get_keysize,
- .get_public_key = _get_public_key,
- .equals = private_key_equals,
- .belongs_to = private_key_belongs_to,
- .get_fingerprint = _get_fingerprint,
- .has_fingerprint = private_key_has_fingerprint,
- .get_encoding = _get_encoding,
- .get_ref = _get_ref,
- .destroy = _destroy,
+ .public = {
+ .key = {
+ .get_type = _get_type,
+ .sign = _sign,
+ .decrypt = _decrypt,
+ .get_keysize = _get_keysize,
+ .get_public_key = _get_public_key,
+ .equals = private_key_equals,
+ .belongs_to = private_key_belongs_to,
+ .get_fingerprint = _get_fingerprint,
+ .has_fingerprint = private_key_has_fingerprint,
+ .get_encoding = _get_encoding,
+ .get_ref = _get_ref,
+ .destroy = _destroy,
+ },
},
.ref = 1,
);
}
INIT(this,
- .public.key = {
- .get_type = _get_type,
- .verify = _verify,
- .encrypt = _encrypt_,
- .equals = public_key_equals,
- .get_keysize = _get_keysize,
- .get_fingerprint = _get_fingerprint,
- .has_fingerprint = public_key_has_fingerprint,
- .get_encoding = _get_encoding,
- .get_ref = _get_ref,
- .destroy = _destroy,
+ .public = {
+ .key = {
+ .get_type = _get_type,
+ .verify = _verify,
+ .encrypt = _encrypt_,
+ .equals = public_key_equals,
+ .get_keysize = _get_keysize,
+ .get_fingerprint = _get_fingerprint,
+ .has_fingerprint = public_key_has_fingerprint,
+ .get_encoding = _get_encoding,
+ .get_ref = _get_ref,
+ .destroy = _destroy,
+ },
},
.ref = 1,
);
private_hmac_plugin_t *this;
INIT(this,
- .public.plugin.destroy = _destroy,
+ .public = {
+ .plugin = {
+ .destroy = _destroy,
+ },
+ },
);
lib->crypto->add_prf(lib->crypto, PRF_HMAC_SHA2_256,
}
INIT(this,
- .public.prf = {
- .get_bytes = _get_bytes,
- .allocate_bytes = _allocate_bytes,
- .get_block_size = _get_block_size,
- .get_key_size = _get_key_size,
- .set_key = _set_key,
- .destroy = _destroy,
+ .public = {
+ .prf = {
+ .get_bytes = _get_bytes,
+ .allocate_bytes = _allocate_bytes,
+ .get_block_size = _get_block_size,
+ .get_key_size = _get_key_size,
+ .set_key = _set_key,
+ .destroy = _destroy,
+ },
},
.hmac = hmac,
);
}
INIT(this,
- .public.signer = {
- .get_signature = _get_signature,
- .allocate_signature = _allocate_signature,
- .verify_signature = _verify_signature,
- .get_key_size = _get_key_size,
- .get_block_size = _get_block_size,
- .set_key = _set_key,
- .destroy = _destroy,
+ .public = {
+ .signer = {
+ .get_signature = _get_signature,
+ .allocate_signature = _allocate_signature,
+ .verify_signature = _verify_signature,
+ .get_key_size = _get_key_size,
+ .get_block_size = _get_block_size,
+ .set_key = _set_key,
+ .destroy = _destroy,
+ },
},
.block_size = min(trunc, hmac->get_block_size(hmac)),
.hmac = hmac,
private_openssl_crypter_t *this;
INIT(this,
- .public.crypter = {
- .encrypt = _encrypt,
- .decrypt = _decrypt,
- .get_block_size = _get_block_size,
- .get_iv_size = _get_iv_size,
- .get_key_size = _get_key_size,
- .set_key = _set_key,
- .destroy = _destroy,
+ .public = {
+ .crypter = {
+ .encrypt = _encrypt,
+ .decrypt = _decrypt,
+ .get_block_size = _get_block_size,
+ .get_iv_size = _get_iv_size,
+ .get_key_size = _get_key_size,
+ .set_key = _set_key,
+ .destroy = _destroy,
+ },
},
);
private_openssl_diffie_hellman_t *this;
INIT(this,
- .public.dh = {
- .get_shared_secret = _get_shared_secret,
- .set_other_public_value = _set_other_public_value,
- .get_my_public_value = _get_my_public_value,
- .get_dh_group = _get_dh_group,
- .destroy = _destroy,
+ .public = {
+ .dh = {
+ .get_shared_secret = _get_shared_secret,
+ .set_other_public_value = _set_other_public_value,
+ .get_my_public_value = _get_my_public_value,
+ .get_dh_group = _get_dh_group,
+ .destroy = _destroy,
+ },
},
);
private_openssl_ec_diffie_hellman_t *this;
INIT(this,
- .public.dh = {
- .get_shared_secret = _get_shared_secret,
- .set_other_public_value = _set_other_public_value,
- .get_my_public_value = _get_my_public_value,
- .get_dh_group = _get_dh_group,
- .destroy = _destroy,
+ .public = {
+ .dh = {
+ .get_shared_secret = _get_shared_secret,
+ .set_other_public_value = _set_other_public_value,
+ .get_my_public_value = _get_my_public_value,
+ .get_dh_group = _get_dh_group,
+ .destroy = _destroy,
+ },
},
.group = group,
);
private_openssl_ec_private_key_t *this;
INIT(this,
- .public.key = {
- .get_type = _get_type,
- .sign = _sign,
- .decrypt = _decrypt,
- .get_keysize = _get_keysize,
- .get_public_key = _get_public_key,
- .equals = private_key_equals,
- .belongs_to = private_key_belongs_to,
- .get_fingerprint = _get_fingerprint,
- .has_fingerprint = private_key_has_fingerprint,
- .get_encoding = _get_encoding,
- .get_ref = _get_ref,
- .destroy = _destroy,
+ .public = {
+ .key = {
+ .get_type = _get_type,
+ .sign = _sign,
+ .decrypt = _decrypt,
+ .get_keysize = _get_keysize,
+ .get_public_key = _get_public_key,
+ .equals = private_key_equals,
+ .belongs_to = private_key_belongs_to,
+ .get_fingerprint = _get_fingerprint,
+ .has_fingerprint = private_key_has_fingerprint,
+ .get_encoding = _get_encoding,
+ .get_ref = _get_ref,
+ .destroy = _destroy,
+ },
},
.ref = 1,
);
private_openssl_ec_public_key_t *this;
INIT(this,
- .public.key = {
- .get_type = _get_type,
- .verify = _verify,
- .encrypt = _encrypt,
- .get_keysize = _get_keysize,
- .equals = public_key_equals,
- .get_fingerprint = _get_fingerprint,
- .has_fingerprint = public_key_has_fingerprint,
- .get_encoding = _get_encoding,
- .get_ref = _get_ref,
- .destroy = _destroy,
+ .public = {
+ .key = {
+ .get_type = _get_type,
+ .verify = _verify,
+ .encrypt = _encrypt,
+ .get_keysize = _get_keysize,
+ .equals = public_key_equals,
+ .get_fingerprint = _get_fingerprint,
+ .has_fingerprint = public_key_has_fingerprint,
+ .get_encoding = _get_encoding,
+ .get_ref = _get_ref,
+ .destroy = _destroy,
+ },
},
.ref = 1,
);
}
INIT(this,
- .public.hasher = {
- .get_hash = _get_hash,
- .allocate_hash = _allocate_hash,
- .get_hash_size = _get_hash_size,
- .reset = _reset,
- .destroy = _destroy,
+ .public = {
+ .hasher = {
+ .get_hash = _get_hash,
+ .allocate_hash = _allocate_hash,
+ .get_hash_size = _get_hash_size,
+ .reset = _reset,
+ .destroy = _destroy,
+ },
},
);
private_openssl_plugin_t *this;
INIT(this,
- .public.plugin.destroy = _destroy,
+ .public = {
+ .plugin = {
+ .destroy = _destroy,
+ },
+ },
);
threading_init();
private_openssl_rsa_private_key_t *this;
INIT(this,
- .public.key = {
- .get_type = _get_type,
- .sign = _sign,
- .decrypt = _decrypt,
- .get_keysize = _get_keysize,
- .get_public_key = _get_public_key,
- .equals = private_key_equals,
- .belongs_to = private_key_belongs_to,
- .get_fingerprint = _get_fingerprint,
- .has_fingerprint = private_key_has_fingerprint,
- .get_encoding = _get_encoding,
- .get_ref = _get_ref,
- .destroy = _destroy,
+ .public = {
+ .key = {
+ .get_type = _get_type,
+ .sign = _sign,
+ .decrypt = _decrypt,
+ .get_keysize = _get_keysize,
+ .get_public_key = _get_public_key,
+ .equals = private_key_equals,
+ .belongs_to = private_key_belongs_to,
+ .get_fingerprint = _get_fingerprint,
+ .has_fingerprint = private_key_has_fingerprint,
+ .get_encoding = _get_encoding,
+ .get_ref = _get_ref,
+ .destroy = _destroy,
+ },
},
.ref = 1,
);
private_openssl_rsa_public_key_t *this;
INIT(this,
- .public.key = {
- .get_type = _get_type,
- .verify = _verify,
- .encrypt = _encrypt,
- .equals = public_key_equals,
- .get_keysize = _get_keysize,
- .get_fingerprint = _get_fingerprint,
- .has_fingerprint = public_key_has_fingerprint,
- .get_encoding = _get_encoding,
- .get_ref = _get_ref,
- .destroy = _destroy,
+ .public = {
+ .key = {
+ .get_type = _get_type,
+ .verify = _verify,
+ .encrypt = _encrypt,
+ .equals = public_key_equals,
+ .get_keysize = _get_keysize,
+ .get_fingerprint = _get_fingerprint,
+ .has_fingerprint = public_key_has_fingerprint,
+ .get_encoding = _get_encoding,
+ .get_ref = _get_ref,
+ .destroy = _destroy,
+ },
},
.ref = 1,
);
}
INIT(this,
- .public.prf = {
- .get_block_size = _get_block_size,
- .get_bytes = _get_bytes,
- .allocate_bytes = _allocate_bytes,
- .get_key_size = _get_key_size,
- .set_key = _set_key,
- .destroy = _destroy,
+ .public = {
+ .prf = {
+ .get_block_size = _get_block_size,
+ .get_bytes = _get_bytes,
+ .allocate_bytes = _allocate_bytes,
+ .get_key_size = _get_key_size,
+ .set_key = _set_key,
+ .destroy = _destroy,
+ },
},
);
}
INIT(this,
- .public.crypter = {
- .encrypt = _encrypt,
- .decrypt = _decrypt,
- .get_block_size = _get_block_size,
- .get_iv_size = _get_iv_size,
- .get_key_size = _get_key_size,
- .set_key = _set_key,
- .destroy = _destroy,
+ .public = {
+ .crypter = {
+ .encrypt = _encrypt,
+ .decrypt = _decrypt,
+ .get_block_size = _get_block_size,
+ .get_iv_size = _get_iv_size,
+ .get_key_size = _get_key_size,
+ .set_key = _set_key,
+ .destroy = _destroy,
+ },
},
.key = chunk_alloc(key_size),
);
private_padlock_plugin_t *this;
INIT(this,
- .public.plugin.destroy = _destroy,
+ .public = {
+ .plugin = {
+ .destroy = _destroy,
+ },
+ },
.features = get_padlock_features(),
);
private_padlock_rng_t *this;
INIT(this,
- .public.rng = {
- .get_bytes = _get_bytes,
- .allocate_bytes = _allocate_bytes,
- .destroy = _destroy,
+ .public = {
+ .rng = {
+ .get_bytes = _get_bytes,
+ .allocate_bytes = _allocate_bytes,
+ .destroy = _destroy,
+ },
},
);
return NULL;
}
INIT(this,
- .public.hasher = {
- .get_hash = _get_hash,
- .allocate_hash = _allocate_hash,
- .get_hash_size = _get_hash_size,
- .reset = _reset,
- .destroy = _destroy,
+ .public = {
+ .hasher = {
+ .get_hash = _get_hash,
+ .allocate_hash = _allocate_hash,
+ .get_hash_size = _get_hash_size,
+ .reset = _reset,
+ .destroy = _destroy,
+ },
},
);
return &this->public;
private_pkcs11_hasher_t *this;
INIT(this,
- .public.hasher = {
- .get_hash_size = _get_hash_size,
- .reset = _reset,
- .get_hash = _get_hash,
- .allocate_hash = _allocate_hash,
- .destroy = _destroy,
+ .public = {
+ .hasher = {
+ .get_hash_size = _get_hash_size,
+ .reset = _reset,
+ .get_hash = _get_hash,
+ .allocate_hash = _allocate_hash,
+ .destroy = _destroy,
+ },
},
.mutex = mutex_create(MUTEX_TYPE_DEFAULT),
);
CK_SLOT_ID slot;
INIT(this,
- .public.plugin.destroy = _destroy,
+ .public = {
+ .plugin = {
+ .destroy = _destroy,
+ },
+ },
.creds = linked_list_create(),
.mutex = mutex_create(MUTEX_TYPE_DEFAULT),
);
}
INIT(this,
- .public.key = {
- .get_type = _get_type,
- .sign = _sign,
- .decrypt = _decrypt,
- .get_keysize = _get_keysize,
- .get_public_key = _get_public_key,
- .equals = private_key_equals,
- .belongs_to = private_key_belongs_to,
- .get_fingerprint = _get_fingerprint,
- .has_fingerprint = private_key_has_fingerprint,
- .get_encoding = _get_encoding,
- .get_ref = _get_ref,
- .destroy = _destroy,
+ .public = {
+ .key = {
+ .get_type = _get_type,
+ .sign = _sign,
+ .decrypt = _decrypt,
+ .get_keysize = _get_keysize,
+ .get_public_key = _get_public_key,
+ .equals = private_key_equals,
+ .belongs_to = private_key_belongs_to,
+ .get_fingerprint = _get_fingerprint,
+ .has_fingerprint = private_key_has_fingerprint,
+ .get_encoding = _get_encoding,
+ .get_ref = _get_ref,
+ .destroy = _destroy,
+ },
},
.ref = 1,
);
private_revocation_plugin_t *this;
INIT(this,
- .public.plugin.destroy = _destroy,
+ .public = {
+ .plugin = {
+ .destroy = _destroy,
+ },
+ },
.validator = revocation_validator_create(),
);
lib->credmgr->add_validator(lib->credmgr, &this->validator->validator);
private_xcbc_plugin_t *this;
INIT(this,
- .public.plugin.destroy = _destroy,
+ .public = {
+ .plugin = {
+ .destroy = _destroy,
+ },
+ },
);
lib->crypto->add_prf(lib->crypto, PRF_AES128_XCBC,
}
INIT(this,
- .public.prf = {
- .get_bytes = _get_bytes,
- .allocate_bytes = _allocate_bytes,
- .get_block_size = _get_block_size,
- .get_key_size = _get_key_size,
- .set_key = _set_key,
- .destroy = _destroy,
+ .public = {
+ .prf = {
+ .get_bytes = _get_bytes,
+ .allocate_bytes = _allocate_bytes,
+ .get_block_size = _get_block_size,
+ .get_key_size = _get_key_size,
+ .set_key = _set_key,
+ .destroy = _destroy,
+ },
},
.xcbc = xcbc,
);
}
INIT(this,
- .public.signer = {
- .get_signature = _get_signature,
- .allocate_signature = _allocate_signature,
- .verify_signature = _verify_signature,
- .get_key_size = _get_key_size,
- .get_block_size = _get_block_size,
- .set_key = _set_key,
- .destroy = _destroy,
+ .public = {
+ .signer = {
+ .get_signature = _get_signature,
+ .allocate_signature = _allocate_signature,
+ .verify_signature = _verify_signature,
+ .get_key_size = _get_key_size,
+ .get_block_size = _get_block_size,
+ .set_key = _set_key,
+ .destroy = _destroy,
+ },
},
.xcbc = xcbc,
.block_size = min(trunc, xcbc->get_block_size(xcbc)),
private_tls_peer_t *this;
INIT(this,
- .public.handshake = {
- .process = _process,
- .build = _build,
- .cipherspec_changed = _cipherspec_changed,
- .change_cipherspec = _change_cipherspec,
- .finished = _finished,
- .destroy = _destroy,
+ .public = {
+ .handshake = {
+ .process = _process,
+ .build = _build,
+ .cipherspec_changed = _cipherspec_changed,
+ .change_cipherspec = _change_cipherspec,
+ .finished = _finished,
+ .destroy = _destroy,
+ },
},
.state = STATE_INIT,
.tls = tls,
.crypto = crypto,
.peer = peer,
.server = server,
- .peer_auth_requested = FALSE,
.peer_auth = auth_cfg_create(),
.server_auth = auth_cfg_create(),
);
private_tls_server_t *this;
INIT(this,
- .public.handshake = {
- .process = _process,
- .build = _build,
- .cipherspec_changed = _cipherspec_changed,
- .change_cipherspec = _change_cipherspec,
- .finished = _finished,
- .destroy = _destroy,
+ .public = {
+ .handshake = {
+ .process = _process,
+ .build = _build,
+ .cipherspec_changed = _cipherspec_changed,
+ .change_cipherspec = _change_cipherspec,
+ .finished = _finished,
+ .destroy = _destroy,
+ },
},
.tls = tls,
.crypto = crypto,