|
Lines 41-47
Link Here
|
| 41 |
#include <openssl/pkcs12.h> |
41 |
#include <openssl/pkcs12.h> |
| 42 |
#include <openssl/ssl.h> |
42 |
#include <openssl/ssl.h> |
| 43 |
|
43 |
|
|
|
44 |
#ifndef RSA_F_RSA_OSSL_PRIVATE_DECRYPT |
| 45 |
#define RSA_F_RSA_OSSL_PRIVATE_DECRYPT RSA_F_RSA_EAY_PRIVATE_DECRYPT |
| 46 |
#endif |
| 47 |
|
| 48 |
#ifndef LIBRESSL_VERSION_NUMBER |
| 44 |
#include <openssl/kdf.h> |
49 |
#include <openssl/kdf.h> |
|
|
50 |
#endif |
| 45 |
|
51 |
|
| 46 |
using namespace QCA; |
52 |
using namespace QCA; |
| 47 |
|
53 |
|
|
Lines 1262-1267
class opensslPbkdf2Context : public KDFContext (public
Link Here
|
| 1262 |
protected: |
1268 |
protected: |
| 1263 |
}; |
1269 |
}; |
| 1264 |
|
1270 |
|
|
|
1271 |
#ifndef LIBRESSL_VERSION_NUMBER |
| 1265 |
class opensslHkdfContext : public HKDFContext |
1272 |
class opensslHkdfContext : public HKDFContext |
| 1266 |
{ |
1273 |
{ |
| 1267 |
Q_OBJECT |
1274 |
Q_OBJECT |
|
Lines 1291-1296
class opensslHkdfContext : public HKDFContext (public)
Link Here
|
| 1291 |
return out; |
1298 |
return out; |
| 1292 |
} |
1299 |
} |
| 1293 |
}; |
1300 |
}; |
|
|
1301 |
#endif // LIBRESSL_VERSION_NUMBER |
| 1294 |
|
1302 |
|
| 1295 |
class opensslHMACContext : public MACContext |
1303 |
class opensslHMACContext : public MACContext |
| 1296 |
{ |
1304 |
{ |
|
Lines 4990-4996
class MyTLSContext : public TLSContext (public)
Link Here
|
| 4990 |
case TLS::TLS_v1: |
4998 |
case TLS::TLS_v1: |
| 4991 |
ctx = SSL_CTX_new(TLS_client_method()); |
4999 |
ctx = SSL_CTX_new(TLS_client_method()); |
| 4992 |
SSL_CTX_set_min_proto_version(ctx, TLS1_VERSION); |
5000 |
SSL_CTX_set_min_proto_version(ctx, TLS1_VERSION); |
|
|
5001 |
#ifdef TLS1_3_VERSION |
| 4993 |
SSL_CTX_set_max_proto_version(ctx, TLS1_3_VERSION); |
5002 |
SSL_CTX_set_max_proto_version(ctx, TLS1_3_VERSION); |
|
|
5003 |
#else |
| 5004 |
SSL_CTX_set_max_proto_version(ctx, TLS1_2_VERSION); |
| 5005 |
#endif |
| 4994 |
break; |
5006 |
break; |
| 4995 |
case TLS::DTLS_v1: |
5007 |
case TLS::DTLS_v1: |
| 4996 |
default: |
5008 |
default: |
|
Lines 5011-5017
class MyTLSContext : public TLSContext (public)
Link Here
|
| 5011 |
QStringList cipherList; |
5023 |
QStringList cipherList; |
| 5012 |
for(int i = 0; i < sk_SSL_CIPHER_num(sk); ++i) { |
5024 |
for(int i = 0; i < sk_SSL_CIPHER_num(sk); ++i) { |
| 5013 |
const SSL_CIPHER *thisCipher = sk_SSL_CIPHER_value(sk, i); |
5025 |
const SSL_CIPHER *thisCipher = sk_SSL_CIPHER_value(sk, i); |
|
|
5026 |
#ifndef LIBRESSL_VERSION_NUMBER |
| 5014 |
cipherList += QString::fromLatin1(SSL_CIPHER_standard_name(thisCipher)); |
5027 |
cipherList += QString::fromLatin1(SSL_CIPHER_standard_name(thisCipher)); |
|
|
5028 |
#else |
| 5029 |
cipherList += QString::fromLatin1(SSL_CIPHER_get_name(thisCipher)); |
| 5030 |
#endif |
| 5015 |
} |
5031 |
} |
| 5016 |
sk_SSL_CIPHER_free(sk); |
5032 |
sk_SSL_CIPHER_free(sk); |
| 5017 |
|
5033 |
|
|
Lines 5404-5410
class MyTLSContext : public TLSContext (public)
Link Here
|
| 5404 |
sessInfo.version = TLS::TLS_v1; |
5420 |
sessInfo.version = TLS::TLS_v1; |
| 5405 |
} |
5421 |
} |
| 5406 |
|
5422 |
|
|
|
5423 |
#ifndef LIBRESSL_VERSION_NUMBER |
| 5407 |
sessInfo.cipherSuite = QString::fromLatin1(SSL_CIPHER_standard_name(SSL_get_current_cipher(ssl))); |
5424 |
sessInfo.cipherSuite = QString::fromLatin1(SSL_CIPHER_standard_name(SSL_get_current_cipher(ssl))); |
|
|
5425 |
#else |
| 5426 |
sessInfo.cipherSuite = QString::fromLatin1(SSL_CIPHER_get_name(SSL_get_current_cipher(ssl))); |
| 5427 |
#endif |
| 5408 |
|
5428 |
|
| 5409 |
sessInfo.cipherMaxBits = SSL_get_cipher_bits(ssl, &(sessInfo.cipherBits)); |
5429 |
sessInfo.cipherMaxBits = SSL_get_cipher_bits(ssl, &(sessInfo.cipherBits)); |
| 5410 |
|
5430 |
|
|
Lines 6751-6757
class opensslProvider : public Provider (public)
Link Here
|
| 6751 |
#endif |
6771 |
#endif |
| 6752 |
list += QStringLiteral("pbkdf1(sha1)"); |
6772 |
list += QStringLiteral("pbkdf1(sha1)"); |
| 6753 |
list += QStringLiteral("pbkdf2(sha1)"); |
6773 |
list += QStringLiteral("pbkdf2(sha1)"); |
|
|
6774 |
#ifndef LIBRESSL_VERSION_NUMBER |
| 6754 |
list += QStringLiteral("hkdf(sha256)"); |
6775 |
list += QStringLiteral("hkdf(sha256)"); |
|
|
6776 |
#endif |
| 6755 |
list += QStringLiteral("pkey"); |
6777 |
list += QStringLiteral("pkey"); |
| 6756 |
list += QStringLiteral("dlgroup"); |
6778 |
list += QStringLiteral("dlgroup"); |
| 6757 |
list += QStringLiteral("rsa"); |
6779 |
list += QStringLiteral("rsa"); |
|
Lines 6820-6827
class opensslProvider : public Provider (public)
Link Here
|
| 6820 |
#endif |
6842 |
#endif |
| 6821 |
else if ( type == QLatin1String("pbkdf2(sha1)") ) |
6843 |
else if ( type == QLatin1String("pbkdf2(sha1)") ) |
| 6822 |
return new opensslPbkdf2Context( this, type ); |
6844 |
return new opensslPbkdf2Context( this, type ); |
|
|
6845 |
#ifndef LIBRESSL_VERSION_NUMBER |
| 6823 |
else if ( type == QLatin1String("hkdf(sha256)") ) |
6846 |
else if ( type == QLatin1String("hkdf(sha256)") ) |
| 6824 |
return new opensslHkdfContext( this, type ); |
6847 |
return new opensslHkdfContext( this, type ); |
|
|
6848 |
#endif |
| 6825 |
else if ( type == QLatin1String("hmac(md5)") ) |
6849 |
else if ( type == QLatin1String("hmac(md5)") ) |
| 6826 |
return new opensslHMACContext( EVP_md5(), this, type ); |
6850 |
return new opensslHMACContext( EVP_md5(), this, type ); |
| 6827 |
else if ( type == QLatin1String("hmac(sha1)") ) |
6851 |
else if ( type == QLatin1String("hmac(sha1)") ) |