Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to compile under openssl 3.x #1

Closed
DynastyKids opened this issue Mar 18, 2023 · 8 comments
Closed

Failed to compile under openssl 3.x #1

DynastyKids opened this issue Mar 18, 2023 · 8 comments

Comments

@DynastyKids
Copy link

Hi there,

Looks like it has not supporting for openssl 3.x on RSACipher.cpp as if condition only have 1.0.x and 1.1.x support. Any chance to update this one so can compile under Ubuntu 22 or other new systems?

Cheers,

@PerlaGCastillo
Copy link

Patching Navicat.
make: *** [Makefile:70: patcher] Error 1

@qbnil
Copy link

qbnil commented Sep 28, 2023

Got the same problem with openssl

banghia112 referenced this issue in banghia112/Navicat-Linux Oct 4, 2023
add libssl-dev installation prerequisties 
fix issue #1
@banghia112
Copy link
Contributor

To fix this problem, you have to install OpenSSL development package

sudo apt-get install libssl-dev

then redo make all

@SolracLeinad
Copy link

SolracLeinad commented Dec 14, 2023

To fix this problem, you have to install OpenSSL development package

sudo apt-get install libssl-dev

then redo make all

/usr/include/openssl/rsa.h:285:5: note: declared here
  285 | int RSA_private_encrypt(int flen, const unsigned char *from, unsigned char *to,
      |     ^~~~~~~~~~~~~~~~~~~
./common/RSACipher.hpp:217:50: warning: ‘int RSA_public_encrypt(int, const unsigned char*, unsigned char*, RSA*, int)’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
  217 |                 BytesWritten = RSA_public_encrypt(
      |                                ~~~~~~~~~~~~~~~~~~^
  218 |                     static_cast<int>(cbFrom),
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~     
  219 |                     reinterpret_cast<const unsigned char*>(lpFrom),
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  220 |                     reinterpret_cast<unsigned char*>(lpTo),
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  221 |                     Get(),
      |                     ~~~~~~                        
  222 |                     Padding
      |                     ~~~~~~~                       
  223 |                 );
      |                 ~                                 
/usr/include/openssl/rsa.h:282:5: note: declared here
  282 | int RSA_public_encrypt(int flen, const unsigned char *from, unsigned char *to,
      |     ^~~~~~~~~~~~~~~~~~
./common/RSACipher.hpp: In member function ‘size_t nkg::RSACipher::Decrypt(const void*, size_t, void*, int) const’:
./common/RSACipher.hpp:242:51: warning: ‘int RSA_private_decrypt(int, const unsigned char*, unsigned char*, RSA*, int)’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
  242 |                 BytesWritten = RSA_private_decrypt(
      |                                ~~~~~~~~~~~~~~~~~~~^
  243 |                     static_cast<int>(cbFrom),
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~      
  244 |                     reinterpret_cast<const unsigned char*>(lpFrom),
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  245 |                     reinterpret_cast<unsigned char*>(lpTo),
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  246 |                     Get(),
      |                     ~~~~~~                         
  247 |                     Padding
      |                     ~~~~~~~                        
  248 |                 );
      |                 ~                                  
/usr/include/openssl/rsa.h:291:5: note: declared here
  291 | int RSA_private_decrypt(int flen, const unsigned char *from, unsigned char *to,
      |     ^~~~~~~~~~~~~~~~~~~
./common/RSACipher.hpp:255:50: warning: ‘int RSA_public_decrypt(int, const unsigned char*, unsigned char*, RSA*, int)’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
  255 |                 BytesWritten = RSA_public_decrypt(
      |                                ~~~~~~~~~~~~~~~~~~^
  256 |                     static_cast<int>(cbFrom),
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~     
  257 |                     reinterpret_cast<const unsigned char*>(lpFrom),
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  258 |                     reinterpret_cast<unsigned char*>(lpTo),
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  259 |                     Get(),
      |                     ~~~~~~                        
  260 |                     Padding
      |                     ~~~~~~~                       
  261 |                 );
      |                 ~                                 
/usr/include/openssl/rsa.h:288:5: note: declared here
  288 | int RSA_public_decrypt(int flen, const unsigned char *from, unsigned char *to,
      |     ^~~~~~~~~~~~~~~~~~
./common/RSACipher.hpp: In instantiation of ‘static RSA* nkg::RSACipher::_ReadRSAFromBIO(BIO*) [with nkg::RSAKeyType __Type = nkg::RSAKeyType::PrivateKey; nkg::RSAKeyFormat __Format = nkg::RSAKeyFormat::PEM; RSA = rsa_st; BIO = bio_st]’:
./common/RSACipher.hpp:177:65:   required from ‘void nkg::RSACipher::ImportKeyFromFile(std::string_view) [with nkg::RSAKeyType __Type = nkg::RSAKeyType::PrivateKey; nkg::RSAKeyFormat __Format = nkg::RSAKeyFormat::PEM; std::string_view = std::basic_string_view<char>]’
./navicat-patcher/main.cpp:114:86:   required from here
./common/RSACipher.hpp:61:51: warning: ‘RSA* PEM_read_bio_RSAPrivateKey(BIO*, RSA**, int (*)(char*, int, int, void*), void*)’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
   61 |                 lpRSA = PEM_read_bio_RSAPrivateKey(lpBIO, nullptr, nullptr, nullptr);
      |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/openssl/pem.h:447:1: note: declared here
  447 | DECLARE_PEM_rw_cb_attr(OSSL_DEPRECATEDIN_3_0, RSAPrivateKey, RSA)
      | ^~~~~~~~~~~~~~~~~~~~~~
./common/RSACipher.hpp:61:51: warning: ‘RSA* PEM_read_bio_RSAPrivateKey(BIO*, RSA**, int (*)(char*, int, int, void*), void*)’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
   61 |                 lpRSA = PEM_read_bio_RSAPrivateKey(lpBIO, nullptr, nullptr, nullptr);
      |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/openssl/pem.h:447:1: note: declared here
  447 | DECLARE_PEM_rw_cb_attr(OSSL_DEPRECATEDIN_3_0, RSAPrivateKey, RSA)
      | ^~~~~~~~~~~~~~~~~~~~~~
make: *** [Makefile:70: patcher] Error 1

Seems like Debian 12 is using libssl-dev 3.0.11

@chiragkanhasoft
Copy link

make it compatible with Ubuntu 22.04 please

@fedocx
Copy link

fedocx commented Mar 6, 2024

By install openssl 1.1.1w I fix it,in follow steps

  1. install openssl
wget -c https://github.com/openssl/openssl/releases/download/OpenSSL_1_1_1w/openssl-1.1.1w.tar.gz
tar xvf openssl-1.1.1w.tar.gz
cd openssl-1.1.1w
./config --prefix=/usr/local/openssl1.1.1w
make && make install

vim /etc/ld.so.conf.d/openssl1.1.1w.conf

/usr/local/openssl1.1.1w/lib`
sudo ldconfig
  1. edit makefile
ifeq ($(UNAME),Darwin)
	OPENSSL_INCLUDE_PATH = /usr/local/opt/openssl@1.1/include
	OPENSSL_LIB_PATH = /usr/local/opt/openssl@1.1/lib
else
	OPENSSL_INCLUDE_PATH = /usr/local/openssl1.1.1w/include
	OPENSSL_LIB_PATH = /usr/local/openssl1.1.1w/lib
endif

FuLygon pushed a commit that referenced this issue Apr 16, 2024
@FuLygon
Copy link
Owner

FuLygon commented Apr 16, 2024

This hasn't been maintained since I'm no longer use navicat, look like there's some dependencies issue building navicat-patcher, I will look into some workaround to build navicat-patcher within docker container, this should resolve most issue with dependencies and rewrite documentation if needed

FuLygon added a commit that referenced this issue Apr 19, 2024
update README.md
@FuLygon
Copy link
Owner

FuLygon commented Apr 19, 2024

Patching method through docker container has been pushed, I also merged support for 16 by @DoubleLabyrinth, tho currently it won't work with the latest version and only support up to Navicat 16.1.8, for Navicat 15, please use branch 15. Closing this issue, if there any more issue, please open a new one.

@FuLygon FuLygon closed this as completed Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants