checking the size of ME_* notify payloads

This commit is contained in:
Tobias Brunner
2008-03-27 10:17:29 +00:00
parent b0dee635d2
commit 54150b3f13
2 changed files with 22 additions and 9 deletions
+21 -1
View File
@@ -332,7 +332,27 @@ static status_t verify(private_notify_payload_t *this)
}
break;
}
/* FIXME: check size of IKE-ME payloads */
case ME_ENDPOINT:
if (this->notification_data.len != 12 ||
this->notification_data.len != 24)
{
bad_length = TRUE;
}
break;
case ME_CONNECTID:
if (this->notification_data.len < 4 ||
this->notification_data.len > 16)
{
bad_length = TRUE;
}
break;
case ME_CONNECTKEY:
if (this->notification_data.len < 16 ||
this->notification_data.len > 32)
{
bad_length = TRUE;
}
break;
default:
/* TODO: verify */
break;
+1 -8
View File
@@ -26,16 +26,9 @@
#include <encoding/payloads/endpoint_notify.h>
#include <processing/jobs/mediation_job.h>
#define ME_CONNECTID_LEN 8
#define ME_CONNECTID_LEN 4
#define ME_CONNECTKEY_LEN 16
/* FIXME: proposed values */
#define ME_CONNECTID_MIN_LEN 4
#define ME_CONNECTID_MAX_LEN 16
#define ME_CONNECTKEY_MIN_LEN 8
#define ME_CONNECTKEY_MAX_LEN 64
typedef struct private_ike_me_t private_ike_me_t;
/**