From 1bbd9ff6e3a5d2550720eefc40db9ad697a215ff Mon Sep 17 00:00:00 2001 From: Edward Kigwana Date: Sat, 15 Jul 2023 14:23:15 -0500 Subject: [PATCH] core: sslhelper: Extern openssl headers and add getSslError helper openssl headers include C headers prior to #ifdef __cplusplus. Signed-off-by: Edward Kigwana --- core/sslhelper.cpp | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/core/sslhelper.cpp b/core/sslhelper.cpp index 078918015..f7ade3ec0 100644 --- a/core/sslhelper.cpp +++ b/core/sslhelper.cpp @@ -1,21 +1,32 @@ /** * SPDX-FileCopyrightText: 2023 Albert Vaca + * SPDX-FileCopyrightText: 2023 Edward Kigwana * * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL */ #include "sslhelper.h" +#include "core_debug.h" -#include -#include -#include -#include -#include -#include +extern "C" { + #include + #include + #include + #include + #include + #include +} namespace SslHelper { +QString getSslError() +{ + char buf[256]; + ERR_error_string_n(ERR_get_error(), buf, sizeof(buf)); + return QString::fromLatin1(buf); +} + QSslKey generateRsaPrivateKey() { RSA *rsa = RSA_new();