aboutsummaryrefslogtreecommitdiffstats
path: root/Source/charon/encoding/generator.c
diff options
context:
space:
mode:
authorJan Hutter <jhutter@hsr.ch>2005-11-29 09:57:22 +0000
committerJan Hutter <jhutter@hsr.ch>2005-11-29 09:57:22 +0000
commitdb6e764580f29c658a3f5486b74e13ad4de7abd4 (patch)
tree050666c2ee034daa6fb808190bf2dd24f99a62f1 /Source/charon/encoding/generator.c
parenta0753941e115fa450b3f750427a3755535cfe2fb (diff)
downloadstrongswan-db6e764580f29c658a3f5486b74e13ad4de7abd4.tar.bz2
strongswan-db6e764580f29c658a3f5486b74e13ad4de7abd4.tar.xz
- added and tested id_payload_t
Diffstat (limited to 'Source/charon/encoding/generator.c')
-rw-r--r--Source/charon/encoding/generator.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/charon/encoding/generator.c b/Source/charon/encoding/generator.c
index cb646fa59..c239cf697 100644
--- a/Source/charon/encoding/generator.c
+++ b/Source/charon/encoding/generator.c
@@ -40,6 +40,7 @@
#include <encoding/payloads/ke_payload.h>
#include <encoding/payloads/notify_payload.h>
#include <encoding/payloads/nonce_payload.h>
+#include <encoding/payloads/id_payload.h>
typedef struct private_generator_t private_generator_t;
@@ -759,6 +760,19 @@ static void generate_payload (private_generator_t *this,payload_t *payload)
this->write_bytes_to_buffer_at_offset(this,&int16_val,sizeof(u_int16_t),payload_length_position_offset);
break;
}
+ case ID_DATA:
+ {
+ /* the ID Data value is generated from chunk */
+ this->generate_from_chunk(this, rules[i].offset);
+
+ u_int32_t payload_length_position_offset = this->last_payload_length_position_offset;
+ /* Length of nonce PAYLOAD is calculated */
+ u_int16_t length_of_id_payload = ID_PAYLOAD_HEADER_LENGTH + ((chunk_t *)(this->data_struct + rules[i].offset))->len;
+ u_int16_t int16_val = htons(length_of_id_payload);
+
+ this->write_bytes_to_buffer_at_offset(this,&int16_val,sizeof(u_int16_t),payload_length_position_offset);
+ break;
+ }
case PROPOSALS:
{
/* before iterative generate the transforms, store the current payload length position */