diff --git a/src/lib/net/SecureUtils.cpp b/src/lib/net/SecureUtils.cpp index a0aeb2316..39ccfcef4 100644 --- a/src/lib/net/SecureUtils.cpp +++ b/src/lib/net/SecureUtils.cpp @@ -62,23 +62,6 @@ Fingerprint sslCertFingerprint(const X509 *cert, QCryptographicHash::Algorithm t return {type, digestArray}; } -Fingerprint pemFileCertFingerprint(const std::string &path, QCryptographicHash::Algorithm type) -{ - auto fp = fopenUtf8Path(path, "r"); - if (!fp) { - throw std::runtime_error("could not open certificate path"); - } - auto fileClose = finally([fp]() { std::fclose(fp); }); - - X509 *cert = PEM_read_X509(fp, nullptr, nullptr, nullptr); - if (!cert) { - throw std::runtime_error("certificate could not be parsed"); - } - auto certFree = finally([cert]() { X509_free(cert); }); - - return sslCertFingerprint(cert, type); -} - void generatePemSelfSignedCert(const std::string &path, int keyLength) { auto expirationDays = 365; diff --git a/src/lib/net/SecureUtils.h b/src/lib/net/SecureUtils.h index a475c07a0..3f1063c35 100644 --- a/src/lib/net/SecureUtils.h +++ b/src/lib/net/SecureUtils.h @@ -9,7 +9,8 @@ #include "Fingerprint.h" -#include +#include + #include namespace deskflow { @@ -26,8 +27,6 @@ QString formatSSLFingerprintColumns(const QByteArray &fingerprint); Fingerprint sslCertFingerprint(const X509 *cert, QCryptographicHash::Algorithm type); -Fingerprint pemFileCertFingerprint(const std::string &path, QCryptographicHash::Algorithm type); - void generatePemSelfSignedCert(const std::string &path, int keyLength = 2048); QString generateFingerprintArt(const QByteArray &rawDigest);