diff options
Diffstat (limited to 'Source/charon/payloads/ke_payload.c')
-rw-r--r-- | Source/charon/payloads/ke_payload.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Source/charon/payloads/ke_payload.c b/Source/charon/payloads/ke_payload.c index cfbd536c4..624727a57 100644 --- a/Source/charon/payloads/ke_payload.c +++ b/Source/charon/payloads/ke_payload.c @@ -111,6 +111,36 @@ encoding_rule_t ke_payload_encodings[] = { { KEY_EXCHANGE_DATA, offsetof(private_ke_payload_t, key_exchange_data) } }; +/* + 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + ! Next Payload !C! RESERVED ! Payload Length ! + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + ! DH Group # ! RESERVED ! + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + ! ! + ~ Key Exchange Data ~ + ! ! + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +*/ + +/** + * Implements payload_t's verify function. + * See #payload_s.verify for description. + */ +static status_t verify(private_ke_payload_t *this) +{ + if (this->critical) + { + /* critical bit is set! */ + return FAILED; + } + + /* dh group is not verified in here */ + return SUCCESS; +} + /** * Implements payload_t's and ke_payload_t's destroy function. * See #payload_s.destroy or ke_payload_s.destroy for description. @@ -259,6 +289,7 @@ ke_payload_t *ke_payload_create() return NULL; } /* interface functions */ + this->public.payload_interface.verify = (status_t (*) (payload_t *))verify; this->public.payload_interface.get_encoding_rules = (status_t (*) (payload_t *, encoding_rule_t **, size_t *) ) get_encoding_rules; this->public.payload_interface.get_length = (size_t (*) (payload_t *)) get_length; this->public.payload_interface.get_next_type = (payload_type_t (*) (payload_t *)) get_next_type; |