Skip to content

Commit 2f609c5

Browse files
bcodding-rhchucklever
authored andcommitted
tlshd: fix a regression for certificate verification
Commit b010190 left session_status unset for GNUTLS_E_CERTIFICATE_VERIFICATION_ERROR. Fix this by always setting EACCESS in the error handling switch statement. Fixes: b010190 ("tlshd: Pass ETIMEDOUT from gnutls to kernel") Closes: #98 Signed-off-by: Benjamin Coddington <[email protected]>
1 parent 1152ef7 commit 2f609c5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/tlshd/handshake.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ void tlshd_start_tls_handshake(gnutls_session_t session,
9090
} while (ret < 0 && !gnutls_error_is_fatal(ret));
9191
tlshd_set_nagle(session, saved);
9292
if (ret < 0) {
93+
/* Any errors here should default to blocking access: */
94+
parms->session_status = EACCES;
9395
switch (ret) {
9496
case GNUTLS_E_CERTIFICATE_VERIFICATION_ERROR:
9597
tlshd_log_cert_verification_error(session);
@@ -100,7 +102,6 @@ void tlshd_start_tls_handshake(gnutls_session_t session,
100102
break;
101103
default:
102104
tlshd_log_notice("tlshd_start_tls_handshake unhandled error %d, returning EACCES\n", ret);
103-
parms->session_status = EACCES;
104105
}
105106
return;
106107
}

0 commit comments

Comments
 (0)