qtopcua icon indicating copy to clipboard operation
qtopcua copied to clipboard

Possible fix for X509 compilation errors for 5.15.x versions

Open MichaelColonel opened this issue 3 years ago • 1 comments
trafficstars

Dear developers,

Linux distribution with: Qt-5.15.2, GCC-10.3, OpenSSL-1.1.1m

I usually use 5.12.2 version of OPC UA. I have a compilation error in more recent versions (with openssl support ).

In file included from x509/openssl_symbols.cpp:57:
x509/openssl_symbols.cpp: In function 'int q_BN_set_word(const BIGNUM*, long unsigned int)':
x509/openssl_symbols.cpp:276:48: error: invalid conversion from 'const BIGNUM*' {aka 'const bignum_st*'} to 'BIGNUM*' {aka 'bignum_st*'} [-fpermissive]
  276 | DEFINEFUNC2(int, BN_set_word, const BIGNUM *a, a, BN_ULONG w, w, return 0, return)
      |                                                ^
      |                                                |
      |                                                const BIGNUM* {aka const bignum_st*}
x509/openssl_symbols_p.h:217:45: note: in definition of macro 'DEFINEFUNC2'
  217 |     ret q_##func(arg1, arg2) { funcret func(a, b); }
      |                                             ^
In file included from /usr/include/openssl/asn1.h:23,
                 from x509/openssl_symbols_p.h:59,
                 from x509/openssl_symbols.cpp:57:
/usr/include/openssl/bn.h:271:25: note:   initializing argument 1 of 'int BN_set_word(BIGNUM*, long unsigned int)'
  271 | int BN_set_word(BIGNUM *a, BN_ULONG w);
      |                 ~~~~~~~~^
In file included from x509/openssl_symbols.cpp:57:
x509/openssl_symbols.cpp: In function 'int q_PEM_write_bio_PKCS8PrivateKey(BIO*, EVP_PKEY*, const EVP_CIPHER*, unsigned char*, int, int (*)(char*, int, int, void*), void*)':
x509/openssl_symbols.cpp:342:118: error: invalid conversion from 'unsigned char*' to 'char*' [-fpermissive]
  342 | 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)
      |                                                                                                                      ^
      |                                                                                                                      |
      |                                                                                                                      unsigned char*
x509/openssl_symbols_p.h:237:84: note: in definition of macro 'DEFINEFUNC7'
  237 |     ret q_##func(arg1, arg2, arg3, arg4, arg5, arg6, arg7) { funcret func(a, b, c, d, e, f, g); }
      |                                                                                    ^
In file included from x509/openssl_symbols_p.h:64,
                 from x509/openssl_symbols.cpp:57:
/usr/include/openssl/pem.h:330:35: note:   initializing argument 4 of 'int PEM_write_bio_PKCS8PrivateKey(BIO*, EVP_PKEY*, const EVP_CIPHER*, char*, int, int (*)(char*, int, int, void*), void*)'
  330 |                                   char *, int, pem_password_cb *, void *);
      |                                   ^~~~~~
make[2]: *** [Makefile:2717: .obj/openssl_symbols.o] Error 1

Could you check that this PR is appropriate for fix that issue. Compilation with that fix finished without problems.

MichaelColonel avatar Feb 23 '22 07:02 MichaelColonel

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
0 out of 2 committers have signed the CLA.

:x: Mikhail Polkovnikov
:x: basyskom-jvoe


Mikhail Polkovnikov seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

cla-assistant[bot] avatar Nov 15 '24 12:11 cla-assistant[bot]