- fixed bug in diffie hellman exchange (no public value was written)
This commit is contained in:
@@ -42,6 +42,10 @@ OBJS+= $(BUILD_DIR)auth_payload.o
|
||||
$(BUILD_DIR)auth_payload.o : $(PAYLOADS_DIR)auth_payload.c $(PAYLOADS_DIR)auth_payload.h
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
#OBJS+= $(BUILD_DIR)ts_payload.o
|
||||
#$(BUILD_DIR)ts_payload.o : $(PAYLOADS_DIR)ts_payload.c $(PAYLOADS_DIR)ts_payload.h
|
||||
# $(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
OBJS+= $(BUILD_DIR)payload.o
|
||||
$(BUILD_DIR)payload.o : $(PAYLOADS_DIR)payload.c $(PAYLOADS_DIR)payload.h
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file auth_payload.h
|
||||
*
|
||||
* @brief Interface of auth_payload_t.
|
||||
* @brief Implementation of auth_payload_t.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ struct private_id_payload_t {
|
||||
id_payload_t public;
|
||||
|
||||
/**
|
||||
* TRUE if this ID payload is of type IDi, FALSE for IDr
|
||||
* TRUE if this ID payload is of type IDi, FALSE for IDr.
|
||||
*/
|
||||
bool is_initiator;
|
||||
|
||||
|
||||
@@ -176,8 +176,6 @@ struct id_payload_t {
|
||||
/**
|
||||
* @brief Creates an empty id_payload_t object.
|
||||
*
|
||||
* As default a ID payload of type IDi is created.
|
||||
*
|
||||
* @param is_initiator
|
||||
* - TRUE if this payload is of type IDi
|
||||
* - FALSE if this payload is of type IDr
|
||||
|
||||
@@ -141,6 +141,9 @@ encoding_rule_t proposal_substructure_encodings[] = {
|
||||
*/
|
||||
static status_t verify(private_proposal_substructure_t *this)
|
||||
{
|
||||
status_t status = SUCCESS;
|
||||
iterator_t *iterator;
|
||||
|
||||
if ((this->next_payload != NO_PAYLOAD) && (this->next_payload != PROPOSAL_SUBSTRUCTURE))
|
||||
{
|
||||
/* must be 0 or 2 */
|
||||
@@ -157,9 +160,26 @@ static status_t verify(private_proposal_substructure_t *this)
|
||||
/* reserved are not supported */
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
iterator = this->transforms->create_iterator(this->transforms,TRUE);
|
||||
|
||||
while(iterator->has_next(iterator))
|
||||
{
|
||||
payload_t *current_transform;
|
||||
iterator->current(iterator,(void **)¤t_transform);
|
||||
|
||||
status = current_transform->verify(current_transform);
|
||||
if (status != SUCCESS)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
iterator->destroy(iterator);
|
||||
|
||||
|
||||
/* proposal number is checked in SA payload */
|
||||
return SUCCESS;
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -115,7 +115,7 @@ encoding_rule_t sa_payload_encodings[] = {
|
||||
static status_t verify(private_sa_payload_t *this)
|
||||
{
|
||||
int proposal_number = 1;
|
||||
status_t status;
|
||||
status_t status = SUCCESS;
|
||||
iterator_t *iterator;
|
||||
bool first = TRUE;
|
||||
|
||||
@@ -131,10 +131,7 @@ static status_t verify(private_sa_payload_t *this)
|
||||
while(iterator->has_next(iterator))
|
||||
{
|
||||
proposal_substructure_t *current_proposal;
|
||||
status = iterator->current(iterator,(void **)¤t_proposal);
|
||||
{
|
||||
break;
|
||||
}
|
||||
iterator->current(iterator,(void **)¤t_proposal);
|
||||
if (current_proposal->get_proposal_number(current_proposal) > proposal_number)
|
||||
{
|
||||
if (first)
|
||||
@@ -158,6 +155,12 @@ static status_t verify(private_sa_payload_t *this)
|
||||
status = FAILED;
|
||||
break;
|
||||
}
|
||||
|
||||
status = current_proposal->payload_interface.verify(&(current_proposal->payload_interface));
|
||||
if (status != SUCCESS)
|
||||
{
|
||||
break;
|
||||
}
|
||||
first = FALSE;
|
||||
}
|
||||
|
||||
|
||||
@@ -148,7 +148,10 @@ encoding_rule_t transform_substructure_encodings[] = {
|
||||
*/
|
||||
static status_t verify(private_transform_substructure_t *this)
|
||||
{
|
||||
if ((this->next_payload != NO_PAYLOAD) && (this->next_payload != TRANSFORM_SUBSTRUCTURE))
|
||||
status_t status = SUCCESS;
|
||||
iterator_t *iterator;
|
||||
|
||||
if ((this->next_payload != NO_PAYLOAD) && (this->next_payload != 3))
|
||||
{
|
||||
/* must be 0 or 3 */
|
||||
return FAILED;
|
||||
@@ -218,9 +221,25 @@ static status_t verify(private_transform_substructure_t *this)
|
||||
return FAILED;
|
||||
}
|
||||
}
|
||||
iterator = this->attributes->create_iterator(this->attributes,TRUE);
|
||||
|
||||
while(iterator->has_next(iterator))
|
||||
{
|
||||
payload_t *current_attributes;
|
||||
iterator->current(iterator,(void **)¤t_attributes);
|
||||
|
||||
status = current_attributes->verify(current_attributes);
|
||||
if (status != SUCCESS)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
iterator->destroy(iterator);
|
||||
|
||||
|
||||
/* proposal number is checked in SA payload */
|
||||
return SUCCESS;
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user