From 38fb67fbf18489f40845b072e4ed50b1f6cf0c9c Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Thu, 17 Nov 2011 11:27:46 +0000 Subject: Add a payload.get_header_length() method, remove header length definitions --- src/conftest/hooks/ike_auth_fill.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/conftest/hooks/ike_auth_fill.c') diff --git a/src/conftest/hooks/ike_auth_fill.c b/src/conftest/hooks/ike_auth_fill.c index 2843d60c1..052a4be08 100644 --- a/src/conftest/hooks/ike_auth_fill.c +++ b/src/conftest/hooks/ike_auth_fill.c @@ -51,7 +51,10 @@ struct private_ike_auth_fill_t { /** size of non ESP-Marker */ #define NON_ESP_MARKER_LEN 4 - +/** length of fixed encryption payload header */ +#define ENCRYPTION_PAYLOAD_HEADER_LENGTH 4 +/** length of fixed cert payload header */ +#define CERT_PAYLOAD_HEADER_LENGTH 5 /** * Calculate packet size on wire (without ethernet/IP header) */ -- cgit v1.2.3 From d6cec44b2400589a746649862326f72490288544 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Wed, 23 Nov 2011 12:11:49 +0100 Subject: Fixed conftests after extending CERT payload. --- src/conftest/hooks/ike_auth_fill.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/conftest/hooks/ike_auth_fill.c') diff --git a/src/conftest/hooks/ike_auth_fill.c b/src/conftest/hooks/ike_auth_fill.c index 052a4be08..ac26d1bfe 100644 --- a/src/conftest/hooks/ike_auth_fill.c +++ b/src/conftest/hooks/ike_auth_fill.c @@ -108,7 +108,7 @@ METHOD(listener_t, message, bool, diff = this->bytes - size - CERT_PAYLOAD_HEADER_LENGTH; data = chunk_alloc(diff); memset(data.ptr, 0x12, data.len); - pld = cert_payload_create_custom(201, data); + pld = cert_payload_create_custom(201, data, CERTIFICATE); message->add_payload(message, &pld->payload_interface); DBG1(DBG_CFG, "inserting %d dummy bytes certificate payload", diff); } -- cgit v1.2.3 From 9ad5b8fa951c294f3f79ffe701cac712a6cf18df Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Tue, 6 Dec 2011 13:37:57 +0100 Subject: Cleanup CERT payload constructors --- src/conftest/hooks/ike_auth_fill.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/conftest/hooks/ike_auth_fill.c') diff --git a/src/conftest/hooks/ike_auth_fill.c b/src/conftest/hooks/ike_auth_fill.c index ac26d1bfe..7362c19f4 100644 --- a/src/conftest/hooks/ike_auth_fill.c +++ b/src/conftest/hooks/ike_auth_fill.c @@ -108,7 +108,7 @@ METHOD(listener_t, message, bool, diff = this->bytes - size - CERT_PAYLOAD_HEADER_LENGTH; data = chunk_alloc(diff); memset(data.ptr, 0x12, data.len); - pld = cert_payload_create_custom(201, data, CERTIFICATE); + pld = cert_payload_create_custom(CERTIFICATE, 201, data); message->add_payload(message, &pld->payload_interface); DBG1(DBG_CFG, "inserting %d dummy bytes certificate payload", diff); } -- cgit v1.2.3 From 47b8f6ef4b3637e94d4b211721b38ba263f6d9c0 Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Thu, 19 Jan 2012 16:22:25 +0100 Subject: Invoke bus_t.message hook twice, once plain and parsed, once encoded and encrypted --- src/conftest/hooks/ike_auth_fill.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/conftest/hooks/ike_auth_fill.c') diff --git a/src/conftest/hooks/ike_auth_fill.c b/src/conftest/hooks/ike_auth_fill.c index 7362c19f4..09590d4f3 100644 --- a/src/conftest/hooks/ike_auth_fill.c +++ b/src/conftest/hooks/ike_auth_fill.c @@ -92,9 +92,9 @@ static size_t calculate_wire_size(message_t *message, ike_sa_t *ike_sa) METHOD(listener_t, message, bool, private_ike_auth_fill_t *this, ike_sa_t *ike_sa, message_t *message, - bool incoming) + bool incoming, bool plain) { - if (!incoming && + if (!incoming && plain && message->get_request(message) == this->req && message->get_message_id(message) == this->id) { -- cgit v1.2.3