From: Alain Spineux Date: Sat, 16 May 2020 09:26:21 +0000 (+0200) Subject: BEE Backport bacula/src/qt-console/bcomm/dircomm.cpp X-Git-Tag: Release-11.3.2~1569 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d7859ed7b6e39e5b37860710f0e1db1d8b87f513;p=thirdparty%2Fbacula.git BEE Backport bacula/src/qt-console/bcomm/dircomm.cpp This commit is the result of the squash of the following main commits: Author: Alain Spineux Date: Tue Apr 9 11:13:50 2019 +0200 PSK: Add PSK to QT's applications - add "TLS PSK Enable" to resources - update hello messages - rename authenticatebase.c to .cc and add the file to the QT tools because of a RTTI compilation problem. I use .cc because it works best with both bacula's CORE and QT to be compiled as C++ and not C - call init_crypto() and init_signals() in tray-monitor --- diff --git a/bacula/src/qt-console/bcomm/dircomm.cpp b/bacula/src/qt-console/bcomm/dircomm.cpp index 7ef5c5e5c5..f568f3c8c3 100644 --- a/bacula/src/qt-console/bcomm/dircomm.cpp +++ b/bacula/src/qt-console/bcomm/dircomm.cpp @@ -158,7 +158,9 @@ bool DirComm::connect_dir() goto bail_out; } } - + if (cons && !cons->psk_ctx && cons->tls_psk_enable) { + cons->psk_ctx = new_psk_context(NULL /* cons->password */); + } /* Initialize Director TLS context once */ if (!m_console->m_dir->tls_ctx && (m_console->m_dir->tls_enable || m_console->m_dir->tls_require)) { /* Generate passphrase prompt */ @@ -182,6 +184,9 @@ bool DirComm::connect_dir() goto bail_out; } } + if (!m_console->m_dir->psk_ctx && m_console->m_dir->tls_psk_enable) { + m_console->m_dir->psk_ctx = new_psk_context(NULL /*m_console->m_dir->password*/); + } if (m_console->m_dir->heartbeat_interval) { heart_beat = m_console->m_dir->heartbeat_interval;