diff options
author | Martin Klos <martin.klos@basyskom.com> | 2021-01-11 13:10:26 +0100 |
---|---|---|
committer | Martin Klos <martin.klos@basyskom.com> | 2021-01-12 12:46:42 +0100 |
commit | 4c9a3049e4c6abc3b868ff554cbe6cb4fdd685b2 (patch) | |
tree | d483fde09c59d231428cbd37f69b59ab425a7ae6 /src | |
parent | 42ff6cc0aa05d43c37ae748d6bb1168ecd6ebd3d (diff) |
Fix: openssl_symbols error
adapt function signature according to upstream openssl headers.
fix build issues according to const correctness.
Task-number: QTBUG-89219
Change-Id: I0b101f07d5a8922a5f42be8802d48df854472b25
Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/opcua/x509/openssl_symbols.cpp | 4 | ||||
-rw-r--r-- | src/opcua/x509/openssl_symbols_p.h | 4 | ||||
-rw-r--r-- | src/opcua/x509/qopcuakeypair_openssl.cpp | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/opcua/x509/openssl_symbols.cpp b/src/opcua/x509/openssl_symbols.cpp index 10c5d35..944733a 100644 --- a/src/opcua/x509/openssl_symbols.cpp +++ b/src/opcua/x509/openssl_symbols.cpp @@ -273,7 +273,7 @@ DEFINEFUNC3(int, BIO_read, BIO *a, a, void *b, b, int c, c, return -1, return) DEFINEFUNC3(int, BIO_write, BIO *a, a, const void *b, b, int c, c, return -1, return) DEFINEFUNC(int, BN_num_bits, const BIGNUM *a, a, return 0, return) DEFINEFUNC2(BN_ULONG, BN_mod_word, const BIGNUM *a, a, BN_ULONG w, w, return static_cast<BN_ULONG>(-1), return) -DEFINEFUNC2(int, BN_set_word, const BIGNUM *a, a, BN_ULONG w, w, return 0, return) +DEFINEFUNC2(int, BN_set_word, BIGNUM *a, a, BN_ULONG w, w, return 0, return) DEFINEFUNC(BIGNUM *, BN_new, void, DUMMYARG, return nullptr, return) DEFINEFUNC(void, BN_clear, BIGNUM *bignum, bignum, return, return) DEFINEFUNC(void, BN_free, BIGNUM *bignum, bignum, return, return) @@ -339,7 +339,7 @@ DEFINEFUNC4(DH *, PEM_read_bio_DHparams, BIO *a, a, DH **b, b, pem_password_cb * DEFINEFUNC7(int, PEM_write_bio_DSAPrivateKey, BIO *a, a, DSA *b, b, const EVP_CIPHER *c, c, unsigned char *d, d, int e, e, pem_password_cb *f, f, void *g, g, return 0, return) DEFINEFUNC7(int, PEM_write_bio_RSAPrivateKey, BIO *a, a, RSA *b, b, const EVP_CIPHER *c, c, unsigned char *d, d, int e, e, pem_password_cb *f, f, void *g, g, return 0, return) DEFINEFUNC7(int, PEM_write_bio_PrivateKey, BIO *a, a, EVP_PKEY *b, b, const EVP_CIPHER *c, c, unsigned char *d, d, int e, e, pem_password_cb *f, f, void *g, g, return 0, return) -DEFINEFUNC7(int, PEM_write_bio_PKCS8PrivateKey, BIO *a, a, EVP_PKEY *b, b, const EVP_CIPHER *c, c, unsigned char *d, d, int e, e, pem_password_cb *f, f, void *g, g, return 0, return) +DEFINEFUNC7(int, PEM_write_bio_PKCS8PrivateKey, BIO *a, a, EVP_PKEY *b, b, const EVP_CIPHER *c, c, char *d, d, int e, e, pem_password_cb *f, f, void *g, g, return 0, return) #ifndef OPENSSL_NO_EC DEFINEFUNC7(int, PEM_write_bio_ECPrivateKey, BIO *a, a, EC_KEY *b, b, const EVP_CIPHER *c, c, unsigned char *d, d, int e, e, pem_password_cb *f, f, void *g, g, return 0, return) #endif diff --git a/src/opcua/x509/openssl_symbols_p.h b/src/opcua/x509/openssl_symbols_p.h index 0241c51..864eb90 100644 --- a/src/opcua/x509/openssl_symbols_p.h +++ b/src/opcua/x509/openssl_symbols_p.h @@ -385,8 +385,8 @@ int q_PEM_write_bio_RSAPrivateKey(BIO *a, RSA *b, const EVP_CIPHER *c, unsigned int e, pem_password_cb *f, void *g); int q_PEM_write_bio_PrivateKey(BIO *a, EVP_PKEY *b, const EVP_CIPHER *c, unsigned char *d, int e, pem_password_cb *f, void *g); -int q_PEM_write_bio_PKCS8PrivateKey(BIO *a, EVP_PKEY *b, const EVP_CIPHER *c, unsigned char *d, - int e, pem_password_cb *f, void *g); +int q_PEM_write_bio_PKCS8PrivateKey(BIO *a, EVP_PKEY *b, const EVP_CIPHER *c, char *d, + int e, pem_password_cb *f, void *g); #ifndef OPENSSL_NO_EC int q_PEM_write_bio_ECPrivateKey(BIO *a, EC_KEY *b, const EVP_CIPHER *c, unsigned char *d, int e, pem_password_cb *f, void *g); diff --git a/src/opcua/x509/qopcuakeypair_openssl.cpp b/src/opcua/x509/qopcuakeypair_openssl.cpp index 66a7b7e..d59a232 100644 --- a/src/opcua/x509/qopcuakeypair_openssl.cpp +++ b/src/opcua/x509/qopcuakeypair_openssl.cpp @@ -240,7 +240,7 @@ QByteArray QOpcUaKeyPairPrivate::privateKeyToByteArray(QOpcUaKeyPair::Cipher cip } if (0 == q_PEM_write_bio_PKCS8PrivateKey(bio, m_keyData, enc, - enc ? (unsigned char*)password.toUtf8().constData() : NULL, + enc ? password.toUtf8().data() : NULL, enc ? password.length() : 0, NULL /* callback */, NULL /* userdata */)) { qCWarning(lcSsl) << "Failed to write private key:" << getOpenSslError(); |