The library API is not designed to proactively send alert by itself,
but it is rather a responsibility of the application to decide to
which alert to be sent when. This removes the manual call to
gnutls_alert_send in the code handling TLS 1.3 Certificate message
when a decompression error happens.
Signed-off-by: Daiki Ueno <ueno@gnu.org>
ret = decompress_certificate(session, &buf);
if (ret < 0) {
gnutls_assert();
- gnutls_alert_send(session, GNUTLS_AL_FATAL,
- GNUTLS_A_BAD_CERTIFICATE);
+ ret = GNUTLS_E_CERTIFICATE_ERROR;
goto cleanup;
}
}
do {
ret = gnutls_handshake(session);
} while (ret < 0 && gnutls_error_is_fatal(ret) == 0);
- if (ret >= 0)
+ if (ret < 0)
+ gnutls_alert_send_appropriate(session, ret);
+ else
fail("client: handshake should have failed\n");
gnutls_bye(session, GNUTLS_SHUT_WR);