aboutsummaryrefslogtreecommitdiffstats
path: root/Source/charon/encoding/generator.c
diff options
context:
space:
mode:
authorJan Hutter <jhutter@hsr.ch>2005-12-05 12:21:38 +0000
committerJan Hutter <jhutter@hsr.ch>2005-12-05 12:21:38 +0000
commitf6ba78c370794ea8247b33752a8dbe930b19df1e (patch)
tree8aaeb98d0c3702610e37a7e5ced5f9b76a30696c /Source/charon/encoding/generator.c
parent3ebebc5e963afed1242192f4fa440c177daee4bc (diff)
downloadstrongswan-f6ba78c370794ea8247b33752a8dbe930b19df1e.tar.bz2
strongswan-f6ba78c370794ea8247b33752a8dbe930b19df1e.tar.xz
- added payload CERT
- cleaned code of different states - added additional notify handling
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 cfc96f4b2..b50e7fffb 100644
--- a/Source/charon/encoding/generator.c
+++ b/Source/charon/encoding/generator.c
@@ -42,6 +42,7 @@
#include <encoding/payloads/nonce_payload.h>
#include <encoding/payloads/id_payload.h>
#include <encoding/payloads/auth_payload.h>
+#include <encoding/payloads/cert_payload.h>
#include <encoding/payloads/ts_payload.h>
@@ -797,6 +798,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 CERT_DATA:
+ {
+ /* the AUTH 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_cert_payload = CERT_PAYLOAD_HEADER_LENGTH + ((chunk_t *)(this->data_struct + rules[i].offset))->len;
+ u_int16_t int16_val = htons(length_of_cert_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 */