- added and tested auth_payload_t class

This commit is contained in:
Jan Hutter
2005-11-29 11:16:15 +00:00
parent 0e96f7d8c3
commit 2326633550
14 changed files with 570 additions and 21 deletions
+14
View File
@@ -41,6 +41,7 @@
#include <encoding/payloads/notify_payload.h>
#include <encoding/payloads/nonce_payload.h>
#include <encoding/payloads/id_payload.h>
#include <encoding/payloads/auth_payload.h>
typedef struct private_generator_t private_generator_t;
@@ -773,6 +774,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 AUTH_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_auth_payload = AUTH_PAYLOAD_HEADER_LENGTH + ((chunk_t *)(this->data_struct + rules[i].offset))->len;
u_int16_t int16_val = htons(length_of_auth_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 */