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
+5 -1
View File
@@ -990,7 +990,11 @@ static status_t send_key_exchange_dhe(private_tls_peer_t *this,
}
chunk_clear(&premaster);
this->dh->get_my_public_value(this->dh, &pub);
if (!this->dh->get_my_public_value(this->dh, &pub))
{
this->alert->add(this->alert, TLS_FATAL, TLS_INTERNAL_ERROR);
return NEED_MORE;
}
if (this->dh->get_dh_group(this->dh) == MODP_CUSTOM)
{
writer->write_data16(writer, pub);
+5 -1
View File
@@ -915,7 +915,11 @@ static status_t send_server_key_exchange(private_tls_server_t *this,
this->alert->add(this->alert, TLS_FATAL, TLS_INTERNAL_ERROR);
return NEED_MORE;
}
this->dh->get_my_public_value(this->dh, &chunk);
if (!this->dh->get_my_public_value(this->dh, &chunk))
{
this->alert->add(this->alert, TLS_FATAL, TLS_INTERNAL_ERROR);
return NEED_MORE;
}
if (params)
{
writer->write_data16(writer, chunk);