Read the compression type byte for EC groups, only

This commit is contained in:
Martin Willi
2010-09-08 10:35:29 +02:00
parent 91a0825c39
commit 7b3c01845f
+5 -1
View File
@@ -419,6 +419,8 @@ static status_t process_key_exchange_dhe(private_tls_server_t *this,
return NEED_MORE; return NEED_MORE;
} }
if (ec)
{
if (pub.ptr[0] != TLS_ANSI_UNCOMPRESSED) if (pub.ptr[0] != TLS_ANSI_UNCOMPRESSED)
{ {
DBG1(DBG_TLS, "DH point format '%N' not supported", DBG1(DBG_TLS, "DH point format '%N' not supported",
@@ -426,7 +428,9 @@ static status_t process_key_exchange_dhe(private_tls_server_t *this,
this->alert->add(this->alert, TLS_FATAL, TLS_INTERNAL_ERROR); this->alert->add(this->alert, TLS_FATAL, TLS_INTERNAL_ERROR);
return NEED_MORE; return NEED_MORE;
} }
this->dh->set_other_public_value(this->dh, chunk_skip(pub, 1)); pub = chunk_skip(pub, 1);
}
this->dh->set_other_public_value(this->dh, pub);
if (this->dh->get_shared_secret(this->dh, &premaster) != SUCCESS) if (this->dh->get_shared_secret(this->dh, &premaster) != SUCCESS)
{ {
DBG1(DBG_TLS, "calculating premaster from DH failed"); DBG1(DBG_TLS, "calculating premaster from DH failed");