diff --git a/src/lib/gui/tls/TlsCertificate.cpp b/src/lib/gui/tls/TlsCertificate.cpp index f05529e85..0428b778e 100644 --- a/src/lib/gui/tls/TlsCertificate.cpp +++ b/src/lib/gui/tls/TlsCertificate.cpp @@ -7,20 +7,12 @@ #include "TlsCertificate.h" -#include "base/FinalAction.h" #include "common/Settings.h" -#include "io/Filesystem.h" #include "net/Fingerprint.h" #include "net/FingerprintDatabase.h" #include "net/SecureUtils.h" #include -#include - -#include -#include -#include -#include TlsCertificate::TlsCertificate(QObject *parent) : QObject(parent) { @@ -60,43 +52,3 @@ int TlsCertificate::getCertKeyLength(const QString &path) const { return deskflow::getCertLength(path.toStdString()); } - -bool TlsCertificate::isCertificateValid(const QString &path) const -{ - OpenSSL_add_all_algorithms(); - ERR_load_crypto_strings(); - - auto fp = deskflow::fopenUtf8Path(path.toStdString(), "r"); - if (!fp) { - qWarning() << tr("could not read from default certificate file"); - return false; - } - auto fileClose = deskflow::finally([fp]() { std::fclose(fp); }); - - auto *cert = PEM_read_X509(fp, nullptr, nullptr, nullptr); - if (!cert) { - qWarning() << tr("could not load default certificate file to memory"); - return false; - } - auto certFree = deskflow::finally([cert]() { X509_free(cert); }); - - auto *pubkey = X509_get_pubkey(cert); - if (!pubkey) { - qWarning() << tr("default certificate key file does not contain valid public key"); - return false; - } - auto pubkeyFree = deskflow::finally([pubkey]() { EVP_PKEY_free(pubkey); }); - - if (auto type = EVP_PKEY_type(EVP_PKEY_id(pubkey)); type != EVP_PKEY_RSA && type != EVP_PKEY_DSA) { - qWarning() << tr("public key in default certificate key file is not RSA or DSA"); - return false; - } - - if (EVP_PKEY_bits(pubkey) < 2048) { - // We could have small keys in old barrier installations - qWarning() << tr("public key in default certificate key file is too small"); - return false; - } - - return true; -} diff --git a/src/lib/gui/tls/TlsCertificate.h b/src/lib/gui/tls/TlsCertificate.h index aa0a6330c..1f6cd7b68 100644 --- a/src/lib/gui/tls/TlsCertificate.h +++ b/src/lib/gui/tls/TlsCertificate.h @@ -16,7 +16,6 @@ class TlsCertificate : public QObject public: explicit TlsCertificate(QObject *parent = nullptr); - bool isCertificateValid(const QString &path) const; bool generateCertificate(const QString &path, int keyLength) const; bool generateFingerprint(const QString &certificateFilename) const; int getCertKeyLength(const QString &path) const; diff --git a/translations/deskflow_es.ts b/translations/deskflow_es.ts index b9c218e5e..525127de2 100644 --- a/translations/deskflow_es.ts +++ b/translations/deskflow_es.ts @@ -1265,29 +1265,6 @@ Al habilitar esta opción, se deshabilitará la interfaz gráfica de usuario (GU <html><head/><body><p>Requiere el paquete wl-clipboard</p><p>Al usar wl-clipboard v2.2.1, existe un error que provoca la pérdida del foco y que puede dificultar el uso de Deskflow. Este error se ha corregido al usar la rama principal de wl-clipboard, a menos que su Compositor no sea compatible con el protocolo wlroots-data-control.</p></body></html> - - TlsCertificate - - could not read from default certificate file - No se pudo leer el archivo de certificado predeterminado - - - could not load default certificate file to memory - No se pudo cargar el archivo de certificado predeterminado en la memoria - - - default certificate key file does not contain valid public key - El archivo de clave de certificado predeterminado no contiene una clave pública válida - - - public key in default certificate key file is not RSA or DSA - La clave pública en el archivo de clave de certificado predeterminado no es RSA ni DSA - - - public key in default certificate key file is too small - La clave pública en el archivo de clave del certificado predeterminado es demasiado pequeña - - deskflow::gui::TlsUtility diff --git a/translations/deskflow_it.ts b/translations/deskflow_it.ts index f80b928ca..0f0c468cb 100644 --- a/translations/deskflow_it.ts +++ b/translations/deskflow_it.ts @@ -1265,29 +1265,6 @@ L'abilitazione di questa impostazione disabiliterà l'interfaccia graf <html><head/><body><p>Richiede il pacchetto wl-clipboard</p><p>Quando si utilizza wl-clipboard v2.2.1, si verifica un bug di furto del focus che potrebbe rendere Deskflow più difficile da usare. Questo problema è stato risolto quando si utilizza il ramo master di wl-clipboard, a meno che il proprio compositore non supporti il ​​protocollo wlroots-data-control.</p></body></html> - - TlsCertificate - - could not read from default certificate file - Impossibile leggere dal file di certificato predefinito - - - could not load default certificate file to memory - Impossibile caricare il file di certificato predefinito in memoria - - - default certificate key file does not contain valid public key - Il file della chiave del certificato predefinito non contiene una chiave pubblica valida - - - public key in default certificate key file is not RSA or DSA - La chiave pubblica nel file della chiave del certificato predefinito non è RSA o DSA - - - public key in default certificate key file is too small - La chiave pubblica nel file della chiave del certificato predefinito è troppo piccola - - deskflow::gui::TlsUtility diff --git a/translations/deskflow_ja.ts b/translations/deskflow_ja.ts index 79e3a9490..f1040aeba 100644 --- a/translations/deskflow_ja.ts +++ b/translations/deskflow_ja.ts @@ -1266,29 +1266,6 @@ Enabling this setting will disable the server config GUI. <html><head/><body><p>wl-clipboard パッケージが必要です。</p><p>wl-clipboard v2.2.1 を使用すると、フォーカス盗用のバグにより Deskflow の使い勝手が悪くなる可能性があります。この問題は wl-clipboard のマスターブランチで修正されていますが、使用しているコンポジターが wlroots-data-control プロトコルに対応している必要があります。</p></body></html> - - TlsCertificate - - could not read from default certificate file - 既定の証明書ファイルが読み取れませんでした - - - could not load default certificate file to memory - 既定の証明書ファイルをメモリーに読み込めませんでした - - - default certificate key file does not contain valid public key - 既定の証明書鍵ファイルに正常な公開鍵が含まれていません - - - public key in default certificate key file is not RSA or DSA - 既定の証明書鍵ファイル内の公開鍵がRSAでもDSAでもありません - - - public key in default certificate key file is too small - 既定の証明書鍵ファイル内の公開鍵が小さすぎます - - deskflow::gui::TlsUtility diff --git a/translations/deskflow_ru.ts b/translations/deskflow_ru.ts index 21a337d2b..9b98de844 100644 --- a/translations/deskflow_ru.ts +++ b/translations/deskflow_ru.ts @@ -1270,29 +1270,6 @@ Enabling this setting will disable the server config GUI. <html><head/><body><p>Для этого необходим пакет wl-clipboard.</p><p>Когда ты используешь wl-clipboard v2.2.1. Возникает ошибка перехвата фокуса, которая мешает использовать deskflowю. Это фиксется если использовать wl-clipboard из ветки master, если только ваш Compositor не поддерживает протокол wlroots-data-control.</p></body></html> - - TlsCertificate - - could not read from default certificate file - Не смог прочитать стандартный файл сертификата - - - could not load default certificate file to memory - Не получилось загрузить стандартный файл сертификата в память - - - default certificate key file does not contain valid public key - Стандартный файл сертификата не содержит действительного публичного ключа - - - public key in default certificate key file is not RSA or DSA - Публичный ключ в стандартном файле сертефеката не является RSA или DSA - - - public key in default certificate key file is too small - Публичный ключ в стандартном файле сертификата слишком мал - - deskflow::gui::TlsUtility diff --git a/translations/deskflow_zh_CN.ts b/translations/deskflow_zh_CN.ts index 5e6aa502c..db30930fb 100644 --- a/translations/deskflow_zh_CN.ts +++ b/translations/deskflow_zh_CN.ts @@ -1266,29 +1266,6 @@ Enabling this setting will disable the server config GUI. <html><head/><body><p>需要 wl-clipboard 包</p><p>使用 wl-clipboard v2.2.1 时存在一个焦点抢夺 Bug,可能导致 Deskflow 使用不便。该问题已在 wl-clipboard 的 master 分支中修复,除非您的合成器不支持 wlroots-data-control 协议。</p></body></html> - - TlsCertificate - - could not read from default certificate file - 无法从默认证书文件读取 - - - could not load default certificate file to memory - 无法将默认证书文件加载到内存 - - - default certificate key file does not contain valid public key - 默认证书密钥文件不包含有效的公钥 - - - public key in default certificate key file is not RSA or DSA - 默认证书密钥文件中的公钥不是 RSA 或 DSA - - - public key in default certificate key file is too small - 默认证书密钥文件中的公钥太短 - - deskflow::gui::TlsUtility