mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-02-10 16:57:00 +08:00
Disable DTLS-PSK protocol when run under a unix socket
It is not possible to derive PSK keys when only the TCP CSTP session is available, without the TLS session. Relates #22 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
This commit is contained in:
@@ -839,6 +839,13 @@ size_t urlfw_size = 0;
|
||||
}
|
||||
|
||||
READ_TF("dtls-psk", config->dtls_psk, 1);
|
||||
if (perm_config->unix_conn_file) {
|
||||
if (config->dtls_psk) {
|
||||
fprintf(stderr, NOTESTR"'dtls-psk' cannot be combined with unix socket file\n");
|
||||
}
|
||||
config->dtls_psk = 0;
|
||||
}
|
||||
|
||||
READ_TF("match-tls-dtls-ciphers", config->match_dtls_and_tls, 0);
|
||||
if (config->match_dtls_and_tls) {
|
||||
if (config->dtls_legacy) {
|
||||
|
||||
@@ -335,7 +335,7 @@ static int setup_dtls_connection(struct worker_st *ws)
|
||||
|
||||
gnutls_session_set_ptr(session, ws);
|
||||
|
||||
if (ws->req.use_psk) {
|
||||
if (ws->req.use_psk && ws->session) {
|
||||
oclog(ws, LOG_INFO, "setting up DTLS-PSK connection");
|
||||
ret = setup_dtls_psk_keys(session, ws);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user