summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2020-01-15 11:05:31 +0100
committerNikos Mavrogiannopoulos <nmav@redhat.com>2020-01-20 17:38:12 +0100
commitf39b85db96c099c5f851f000cb74fb5200e05919 (patch)
tree6bbb6ce49e1610435ab20db79ec63b9c3145a299 /lib
parent6ab20d77120f818522863bd43cab20541e0afa57 (diff)
downloadgnutls-f39b85db96c099c5f851f000cb74fb5200e05919.tar.gz
tls13: request OCSP responses as a server
The TLS1.3 protocol requires the server to advertise an empty OCSP status request extension on its certificate verify message for an OCSP response to be sent by the client. We now always send this extension to allow clients attaching those responses. Resolves: #876 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/tls13/certificate_request.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/tls13/certificate_request.c b/lib/tls13/certificate_request.c
index 7c0eb04d9b..37e7b41049 100644
--- a/lib/tls13/certificate_request.c
+++ b/lib/tls13/certificate_request.c
@@ -266,6 +266,11 @@ int write_certificate_authorities(void *ctx, gnutls_buffer_st *buf)
size);
}
+static int append_empty_ext(void *ctx, gnutls_buffer_st *buf)
+{
+ return GNUTLS_E_INT_RET_0;
+}
+
int _gnutls13_send_certificate_request(gnutls_session_t session, unsigned again)
{
gnutls_certificate_credentials_t cred;
@@ -341,6 +346,17 @@ int _gnutls13_send_certificate_request(gnutls_session_t session, unsigned again)
goto cleanup;
}
+#ifdef ENABLE_OCSP
+ /* We always advertise our support for OCSP stapling */
+ ret = _gnutls_extv_append(&buf, ext_mod_status_request.tls_id, session,
+ append_empty_ext);
+ if (ret < 0) {
+ gnutls_assert();
+ goto cleanup;
+ }
+ session->internals.hsk_flags |= HSK_CLIENT_OCSP_REQUESTED;
+#endif
+
ret = _gnutls_extv_append_final(&buf, init_pos, 0);
if (ret < 0) {
gnutls_assert();