diffie-hellman: Add a bool return value to get_my_public_value()
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user