diffie-hellman: Add a bool return value to get_my_public_value()

This commit is contained in:
Martin Willi
2015-03-23 17:54:03 +01:00
parent 8a7dbf3c2a
commit 42431690e0
23 changed files with 87 additions and 39 deletions
+8 -2
View File
@@ -320,9 +320,15 @@ ke_payload_t *ke_payload_create(payload_type_t type)
ke_payload_t *ke_payload_create_from_diffie_hellman(payload_type_t type,
diffie_hellman_t *dh)
{
private_ke_payload_t *this = (private_ke_payload_t*)ke_payload_create(type);
private_ke_payload_t *this;
chunk_t value;
dh->get_my_public_value(dh, &this->key_exchange_data);
if (!dh->get_my_public_value(dh, &value))
{
return NULL;
}
this = (private_ke_payload_t*)ke_payload_create(type);
this->key_exchange_data = value;
this->dh_group_number = dh->get_dh_group(dh);
this->payload_length += this->key_exchange_data.len;