core: sslhelper: Extern openssl headers and add getSslError helper
openssl headers include C headers prior to #ifdef __cplusplus. Signed-off-by: Edward Kigwana <ekigwana@gmail.com>
This commit is contained in:
parent
d0786d1b62
commit
1bbd9ff6e3
1 changed files with 17 additions and 6 deletions
|
@ -1,21 +1,32 @@
|
|||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Albert Vaca <albertvaka@gmail.com>
|
||||
* SPDX-FileCopyrightText: 2023 Edward Kigwana <ekigwana@gmail.com>
|
||||
*
|
||||
* 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 <openssl/bn.h>
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/rsa.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/x509v3.h>
|
||||
extern "C" {
|
||||
#include <openssl/bn.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/rsa.h>
|
||||
#include <openssl/x509.h>
|
||||
}
|
||||
|
||||
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();
|
||||
|
|
Loading…
Reference in a new issue