8#include <QtNetwork/private/qsslsocket_p.h>
10#include <QtCore/qscopeguard.h>
11#include <QtCore/qbytearray.h>
12#include <QtCore/qiodevice.h>
13#include <QtCore/qdebug.h>
15#include <openssl/bn.h>
16#include <openssl/dh.h>
20#ifndef OPENSSL_NO_DEPRECATED_3_0
51 const BIGNUM *
p =
nullptr;
52 const BIGNUM *
q =
nullptr;
53 const BIGNUM *
g =
nullptr;
58 if (residue == 11 || residue == 23)
59 status &= ~DH_NOT_SUITABLE_GENERATOR;
62 bad |= DH_CHECK_P_NOT_PRIME;
63 bad |= DH_CHECK_P_NOT_SAFE_PRIME;
64 bad |= DH_NOT_SUITABLE_GENERATOR;
66 return !(status & bad);
75#ifndef OPENSSL_NO_DEPRECATED_3_0
81 const unsigned char *
data =
reinterpret_cast<const unsigned char *
>(der.
data());
102 qCWarning(lcTlsBackend,
"Diffie-Hellman parameters are not supported, because OpenSSL v3 was built with deprecated API removed");
109#ifndef OPENSSL_NO_DEPRECATED_3_0
153 qCWarning(lcTlsBackend,
"Diffie-Hellman parameters are not supported, because OpenSSL v3 was built with deprecated API removed");
char * data()
\macro QT_NO_CAST_FROM_BYTEARRAY
qsizetype size() const noexcept
Returns the number of bytes in this byte array.
bool isEmpty() const noexcept
Returns true if the byte array has size 0; otherwise returns false.
static void ensureInitialized()
int dhParametersFromDer(const QByteArray &derData, QByteArray *data) const override
int dhParametersFromPem(const QByteArray &pemData, QByteArray *data) const override
Combined button and popup list for selecting options.
#define qCWarning(category,...)
GLenum GLuint GLenum GLsizei const GLchar * buf
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLdouble GLdouble GLdouble GLdouble q
QScopeGuard< typename std::decay< F >::type > qScopeGuard(F &&f)
[qScopeGuard]
DH * q_d2i_DHparams(DH **a, const unsigned char **pp, long length)
int q_DH_check(DH *dh, int *codes)
BN_ULONG q_BN_mod_word(const BIGNUM *a, BN_ULONG w)
int q_i2d_DHparams(DH *a, unsigned char **p)
int q_BN_is_word(BIGNUM *a, BN_ULONG w)
DH * q_PEM_read_bio_DHparams(BIO *a, DH **b, pem_password_cb *c, void *d)
void q_DH_get0_pqg(const DH *dh, const BIGNUM **p, const BIGNUM **q, const BIGNUM **g)
BIO * q_BIO_new_mem_buf(void *a, int b)