diff options
Diffstat (limited to 'src/libstrongswan/plugins/gcrypt')
-rw-r--r-- | src/libstrongswan/plugins/gcrypt/gcrypt_crypter.c | 18 | ||||
-rw-r--r-- | src/libstrongswan/plugins/gcrypt/gcrypt_dh.c | 14 | ||||
-rw-r--r-- | src/libstrongswan/plugins/gcrypt/gcrypt_hasher.c | 14 | ||||
-rw-r--r-- | src/libstrongswan/plugins/gcrypt/gcrypt_plugin.c | 6 | ||||
-rw-r--r-- | src/libstrongswan/plugins/gcrypt/gcrypt_rng.c | 10 | ||||
-rw-r--r-- | src/libstrongswan/plugins/gcrypt/gcrypt_rsa_private_key.c | 28 | ||||
-rw-r--r-- | src/libstrongswan/plugins/gcrypt/gcrypt_rsa_public_key.c | 24 |
7 files changed, 65 insertions, 49 deletions
diff --git a/src/libstrongswan/plugins/gcrypt/gcrypt_crypter.c b/src/libstrongswan/plugins/gcrypt/gcrypt_crypter.c index 943f9c2d2..599481911 100644 --- a/src/libstrongswan/plugins/gcrypt/gcrypt_crypter.c +++ b/src/libstrongswan/plugins/gcrypt/gcrypt_crypter.c @@ -278,14 +278,16 @@ gcrypt_crypter_t *gcrypt_crypter_create(encryption_algorithm_t algo, } 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, diff --git a/src/libstrongswan/plugins/gcrypt/gcrypt_dh.c b/src/libstrongswan/plugins/gcrypt/gcrypt_dh.c index 183d34d04..1d519ce56 100644 --- a/src/libstrongswan/plugins/gcrypt/gcrypt_dh.c +++ b/src/libstrongswan/plugins/gcrypt/gcrypt_dh.c @@ -185,12 +185,14 @@ gcrypt_dh_t *gcrypt_dh_create(diffie_hellman_group_t group) } 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, diff --git a/src/libstrongswan/plugins/gcrypt/gcrypt_hasher.c b/src/libstrongswan/plugins/gcrypt/gcrypt_hasher.c index ece4fab77..96c87614f 100644 --- a/src/libstrongswan/plugins/gcrypt/gcrypt_hasher.c +++ b/src/libstrongswan/plugins/gcrypt/gcrypt_hasher.c @@ -121,12 +121,14 @@ gcrypt_hasher_t *gcrypt_hasher_create(hash_algorithm_t algo) } 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, + }, }, ); diff --git a/src/libstrongswan/plugins/gcrypt/gcrypt_plugin.c b/src/libstrongswan/plugins/gcrypt/gcrypt_plugin.c index cc13f5516..eb9b95004 100644 --- a/src/libstrongswan/plugins/gcrypt/gcrypt_plugin.c +++ b/src/libstrongswan/plugins/gcrypt/gcrypt_plugin.c @@ -138,7 +138,11 @@ plugin_t *gcrypt_plugin_create() gcry_control(GCRYCTL_INITIALIZATION_FINISHED, 0); INIT(this, - .public.plugin.destroy = _destroy, + .public = { + .plugin = { + .destroy = _destroy, + }, + }, ); /* hashers */ diff --git a/src/libstrongswan/plugins/gcrypt/gcrypt_rng.c b/src/libstrongswan/plugins/gcrypt/gcrypt_rng.c index fb4443da5..d29755de9 100644 --- a/src/libstrongswan/plugins/gcrypt/gcrypt_rng.c +++ b/src/libstrongswan/plugins/gcrypt/gcrypt_rng.c @@ -83,10 +83,12 @@ gcrypt_rng_t *gcrypt_rng_create(rng_quality_t quality) } 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, ); diff --git a/src/libstrongswan/plugins/gcrypt/gcrypt_rsa_private_key.c b/src/libstrongswan/plugins/gcrypt/gcrypt_rsa_private_key.c index 2d9baa471..38ce2cd6c 100644 --- a/src/libstrongswan/plugins/gcrypt/gcrypt_rsa_private_key.c +++ b/src/libstrongswan/plugins/gcrypt/gcrypt_rsa_private_key.c @@ -427,19 +427,21 @@ static private_gcrypt_rsa_private_key_t *create_empty() 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, ); diff --git a/src/libstrongswan/plugins/gcrypt/gcrypt_rsa_public_key.c b/src/libstrongswan/plugins/gcrypt/gcrypt_rsa_public_key.c index a49a6e5e2..f8645da97 100644 --- a/src/libstrongswan/plugins/gcrypt/gcrypt_rsa_public_key.c +++ b/src/libstrongswan/plugins/gcrypt/gcrypt_rsa_public_key.c @@ -322,17 +322,19 @@ gcrypt_rsa_public_key_t *gcrypt_rsa_public_key_load(key_type_t type, } 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, ); |