- nonce payload added

- tested
This commit is contained in:
Martin Willi
2005-11-15 15:26:27 +00:00
parent 2dcb14b0ae
commit e23b3bae41
7 changed files with 130 additions and 12 deletions
+1
View File
@@ -47,6 +47,7 @@ mapping_t encoding_type_t_mappings[] = {
{ATTRIBUTE_TYPE, "ATTRIBUTE_TYPE"},
{ATTRIBUTE_LENGTH_OR_VALUE, "ATTRIBUTE_LENGTH_OR_VALUE"},
{ATTRIBUTE_VALUE, "ATTRIBUTE_VALUE"},
{NONCE_DATA, "NONCE_DATA"},
{MAPPING_END, NULL}
};
+11 -1
View File
@@ -296,7 +296,17 @@ enum encoding_type_e{
*
* When parsing SPI_SIZE bytes are read and written into the chunk pointing to.
*/
ATTRIBUTE_VALUE
ATTRIBUTE_VALUE,
/**
* Representating a Nonce Data field
*
* When generating the content of the chunkt pointing to
* is written.
*
* When parsing (Payload Length - 4) bytes are read and written into the chunk pointing to.
*/
NONCE_DATA
};
/**
+1 -1
View File
@@ -97,7 +97,7 @@ encoding_rule_t nonce_payload_encodings[] = {
/* Length of the whole nonce payload*/
{ PAYLOAD_LENGTH, offsetof(private_nonce_payload_t, payload_length) },
/* some nonce bytes, lenth is defined in PAYLOAD_LENGTH */
{ NONCE, offsetof(private_nonce_payload_t, nonce) }
{ NONCE_DATA, offsetof(private_nonce_payload_t, nonce) }
};
/**
+3
View File
@@ -26,6 +26,7 @@
#include "ike_header.h"
#include "sa_payload.h"
#include "nonce_payload.h"
@@ -76,6 +77,8 @@ payload_t *payload_create(payload_type_t type)
return (payload_t*)transform_substructure_create();
case TRANSFORM_ATTRIBUTE:
return (payload_t*)transform_attribute_create();
case NONCE:
return (payload_t*)nonce_payload_create();
default:
return NULL;
}