Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 657720 | Differences between
and this patch

Collapse All | Expand All

(-)a/plugins/qca-ossl/qca-ossl.cpp (+24 lines)
Lines 41-47 Link Here
41
#include <openssl/ssl.h>
41
#include <openssl/ssl.h>
42
#include <openssl/x509v3.h>
42
#include <openssl/x509v3.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 1239-1244 public: Link Here
1239
protected:
1245
protected:
1240
};
1246
};
1241
1247
1248
#ifndef LIBRESSL_VERSION_NUMBER
1242
class opensslHkdfContext : public HKDFContext
1249
class opensslHkdfContext : public HKDFContext
1243
{
1250
{
1244
    Q_OBJECT
1251
    Q_OBJECT
Lines 1271-1276 public: Link Here
1271
        return out;
1278
        return out;
1272
    }
1279
    }
1273
};
1280
};
1281
#endif // LIBRESSL_VERSION_NUMBER
1274
1282
1275
class opensslHMACContext : public MACContext
1283
class opensslHMACContext : public MACContext
1276
{
1284
{
Lines 4951-4957 public: Link Here
4951
        case TLS::TLS_v1:
4959
        case TLS::TLS_v1:
4952
            ctx = SSL_CTX_new(TLS_client_method());
4960
            ctx = SSL_CTX_new(TLS_client_method());
4953
            SSL_CTX_set_min_proto_version(ctx, TLS1_VERSION);
4961
            SSL_CTX_set_min_proto_version(ctx, TLS1_VERSION);
4962
#ifdef TLS1_3_VERSION
4954
            SSL_CTX_set_max_proto_version(ctx, TLS1_3_VERSION);
4963
            SSL_CTX_set_max_proto_version(ctx, TLS1_3_VERSION);
4964
#else
4965
            SSL_CTX_set_max_proto_version(ctx, TLS1_2_VERSION);
4966
#endif
4955
            break;
4967
            break;
4956
        case TLS::DTLS_v1:
4968
        case TLS::DTLS_v1:
4957
        default:
4969
        default:
Lines 4972-4978 public: Link Here
4972
        QStringList cipherList;
4984
        QStringList cipherList;
4973
        for (int i = 0; i < sk_SSL_CIPHER_num(sk); ++i) {
4985
        for (int i = 0; i < sk_SSL_CIPHER_num(sk); ++i) {
4974
            const SSL_CIPHER *thisCipher = sk_SSL_CIPHER_value(sk, i);
4986
            const SSL_CIPHER *thisCipher = sk_SSL_CIPHER_value(sk, i);
4987
#ifndef LIBRESSL_VERSION_NUMBER
4975
            cipherList += QString::fromLatin1(SSL_CIPHER_standard_name(thisCipher));
4988
            cipherList += QString::fromLatin1(SSL_CIPHER_standard_name(thisCipher));
4989
#else
4990
            cipherList += QString::fromLatin1(SSL_CIPHER_get_name(thisCipher));
4991
#endif
4976
        }
4992
        }
4977
        sk_SSL_CIPHER_free(sk);
4993
        sk_SSL_CIPHER_free(sk);
4978
4994
Lines 5345-5351 public: Link Here
5345
            sessInfo.version = TLS::TLS_v1;
5361
            sessInfo.version = TLS::TLS_v1;
5346
        }
5362
        }
5347
5363
5364
#ifndef LIBRESSL_VERSION_NUMBER
5348
        sessInfo.cipherSuite = QString::fromLatin1(SSL_CIPHER_standard_name(SSL_get_current_cipher(ssl)));
5365
        sessInfo.cipherSuite = QString::fromLatin1(SSL_CIPHER_standard_name(SSL_get_current_cipher(ssl)));
5366
#else
5367
        sessInfo.cipherSuite = QString::fromLatin1(SSL_CIPHER_get_name(SSL_get_current_cipher(ssl)));
5368
#endif
5349
5369
5350
        sessInfo.cipherMaxBits = SSL_get_cipher_bits(ssl, &(sessInfo.cipherBits));
5370
        sessInfo.cipherMaxBits = SSL_get_cipher_bits(ssl, &(sessInfo.cipherBits));
5351
5371
Lines 6629-6635 public: Link Here
6629
#endif
6649
#endif
6630
        list += QStringLiteral("pbkdf1(sha1)");
6650
        list += QStringLiteral("pbkdf1(sha1)");
6631
        list += QStringLiteral("pbkdf2(sha1)");
6651
        list += QStringLiteral("pbkdf2(sha1)");
6652
#ifndef LIBRESSL_VERSION_NUMBER
6632
        list += QStringLiteral("hkdf(sha256)");
6653
        list += QStringLiteral("hkdf(sha256)");
6654
#endif
6633
        list += QStringLiteral("pkey");
6655
        list += QStringLiteral("pkey");
6634
        list += QStringLiteral("dlgroup");
6656
        list += QStringLiteral("dlgroup");
6635
        list += QStringLiteral("rsa");
6657
        list += QStringLiteral("rsa");
Lines 6698-6705 public: Link Here
6698
#endif
6720
#endif
6699
        else if (type == QLatin1String("pbkdf2(sha1)"))
6721
        else if (type == QLatin1String("pbkdf2(sha1)"))
6700
            return new opensslPbkdf2Context(this, type);
6722
            return new opensslPbkdf2Context(this, type);
6723
#ifndef LIBRESSL_VERSION_NUMBER
6701
        else if (type == QLatin1String("hkdf(sha256)"))
6724
        else if (type == QLatin1String("hkdf(sha256)"))
6702
            return new opensslHkdfContext(this, type);
6725
            return new opensslHkdfContext(this, type);
6726
#endif
6703
        else if (type == QLatin1String("hmac(md5)"))
6727
        else if (type == QLatin1String("hmac(md5)"))
6704
            return new opensslHMACContext(EVP_md5(), this, type);
6728
            return new opensslHMACContext(EVP_md5(), this, type);
6705
        else if (type == QLatin1String("hmac(sha1)"))
6729
        else if (type == QLatin1String("hmac(sha1)"))

Return to bug 657720