summaryrefslogtreecommitdiff
path: root/src/charon/encoding/payloads/transform_substructure.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/charon/encoding/payloads/transform_substructure.c')
-rw-r--r--src/charon/encoding/payloads/transform_substructure.c36
1 files changed, 10 insertions, 26 deletions
diff --git a/src/charon/encoding/payloads/transform_substructure.c b/src/charon/encoding/payloads/transform_substructure.c
index 7c3d6421a..497bd53b2 100644
--- a/src/charon/encoding/payloads/transform_substructure.c
+++ b/src/charon/encoding/payloads/transform_substructure.c
@@ -12,8 +12,6 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
- *
- * $Id: transform_substructure.c 3971 2008-05-16 13:27:21Z tobias $
*/
#include <stddef.h>
@@ -382,37 +380,23 @@ transform_substructure_t *transform_substructure_create()
/*
* Described in header
*/
-transform_substructure_t *transform_substructure_create_type(transform_type_t transform_type, u_int16_t transform_id, u_int16_t key_length)
+transform_substructure_t *transform_substructure_create_type(
+ transform_type_t transform_type,
+ u_int16_t transform_id, u_int16_t key_length)
{
transform_substructure_t *transform = transform_substructure_create();
transform->set_transform_type(transform,transform_type);
transform->set_transform_id(transform,transform_id);
- /* a keylength attribute is only created for variable length algos */
- if (transform_type == ENCRYPTION_ALGORITHM)
+ if (key_length)
{
- switch(transform_id)
- {
- case ENCR_AES_CBC:
- case ENCR_IDEA:
- case ENCR_CAST:
- case ENCR_BLOWFISH:
- case ENCR_AES_CCM_ICV8:
- case ENCR_AES_CCM_ICV12:
- case ENCR_AES_CCM_ICV16:
- case ENCR_AES_GCM_ICV8:
- case ENCR_AES_GCM_ICV12:
- case ENCR_AES_GCM_ICV16:
- {
- transform_attribute_t *attribute = transform_attribute_create_key_length(key_length);
- transform->add_transform_attribute(transform,attribute);
- break;
- }
- default:
- break;
- }
+ transform_attribute_t *attribute;
+
+ attribute = transform_attribute_create_key_length(key_length);
+ transform->add_transform_attribute(transform, attribute);
+
}
-
return transform;
}
+