66 lines
1.8 KiB
Diff
66 lines
1.8 KiB
Diff
--- a/plugins/qca-ossl/qca-ossl.cpp.bak 2020-08-13 20:47:26.316272036 +0200
|
|
+++ b/plugins/qca-ossl/qca-ossl.cpp 2020-08-13 21:14:09.838349311 +0200
|
|
@@ -41,7 +41,13 @@
|
|
#include <openssl/pkcs12.h>
|
|
#include <openssl/ssl.h>
|
|
|
|
+#if !defined(LIBRESSL_VERSION_NUMBER)
|
|
#include <openssl/kdf.h>
|
|
+#endif
|
|
+#ifdef LIBRESSL_VERSION_NUMBER
|
|
+#define SSL_CIPHER_standard_name SSL_CIPHER_get_name
|
|
+#define RSA_F_RSA_OSSL_PRIVATE_DECRYPT RSA_F_RSA_EAY_PRIVATE_DECRYPT
|
|
+#endif
|
|
|
|
using namespace QCA;
|
|
|
|
@@ -1262,6 +1268,7 @@
|
|
protected:
|
|
};
|
|
|
|
+#ifndef LIBRESSL_VERSION_NUMBER
|
|
class opensslHkdfContext : public HKDFContext
|
|
{
|
|
Q_OBJECT
|
|
@@ -1291,6 +1298,7 @@
|
|
return out;
|
|
}
|
|
};
|
|
+#endif
|
|
|
|
class opensslHMACContext : public MACContext
|
|
{
|
|
@@ -4990,7 +4998,11 @@
|
|
case TLS::TLS_v1:
|
|
ctx = SSL_CTX_new(TLS_client_method());
|
|
SSL_CTX_set_min_proto_version(ctx, TLS1_VERSION);
|
|
+#ifdef OPENSSL_NO_TLS1_3
|
|
+ SSL_CTX_set_max_proto_version(ctx, TLS1_2_VERSION);
|
|
+#else
|
|
SSL_CTX_set_max_proto_version(ctx, TLS1_3_VERSION);
|
|
+#endif
|
|
break;
|
|
case TLS::DTLS_v1:
|
|
default:
|
|
@@ -6751,7 +6763,9 @@
|
|
#endif
|
|
list += QStringLiteral("pbkdf1(sha1)");
|
|
list += QStringLiteral("pbkdf2(sha1)");
|
|
+#ifndef LIBRESSL_VERSION_NUMBER
|
|
list += QStringLiteral("hkdf(sha256)");
|
|
+#endif
|
|
list += QStringLiteral("pkey");
|
|
list += QStringLiteral("dlgroup");
|
|
list += QStringLiteral("rsa");
|
|
@@ -6820,8 +6834,10 @@
|
|
#endif
|
|
else if ( type == QLatin1String("pbkdf2(sha1)") )
|
|
return new opensslPbkdf2Context( this, type );
|
|
+#ifndef LIBRESSL_VERSION_NUMBER
|
|
else if ( type == QLatin1String("hkdf(sha256)") )
|
|
return new opensslHkdfContext( this, type );
|
|
+#endif
|
|
else if ( type == QLatin1String("hmac(md5)") )
|
|
return new opensslHMACContext( EVP_md5(), this, type );
|
|
else if ( type == QLatin1String("hmac(sha1)") )
|