Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Using QCA Encrypt Library with Qt >5
QtWS25 Last Chance

Using QCA Encrypt Library with Qt >5

Scheduled Pinned Locked Moved Unsolved General and Desktop
13 Posts 2 Posters 2.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Hoehli
    wrote on last edited by Hoehli
    #1

    Hello,

    currently I'm trying to include the QCA-Libs (ver 2.1.3) into my program. I want to use the RSA Encryption and base64/sha algotithms.
    The Qt-Versions I'm using are 5.11.2 for the 32-bit version, and 5.12.1 for the 64-bit version.

    I've downloaded QCA from GitHub, and opened the CmakeLists with Qt-Creator.
    Running the rsatest , I'm getting follwing output:

    RSA not supported!
    

    Running the rsaunittest, I'm getting following output:

    ********* Start testing of RSAUnitTest *********
    Config: Using QtTest library 5.11.2, Qt 5.11.2 (i386-little_endian-ilp32 shared (dynamic) release build; by GCC 5.3.0)
    PASS   : RSAUnitTest::initTestCase()
    WARNING: RSAUnitTest::testrsa() RSA not supported for qca-ossl
    C:\Users\user\Downloads\qca-2.1.3\unittest\rsaunittest\rsaunittest.cpp(67) : failure location
    PASS   : RSAUnitTest::testrsa()
    WARNING: RSAUnitTest::testAsymmetricEncryption() RSA not supported
    C:\Users\user\Downloads\qca-2.1.3\unittest\rsaunittest\rsaunittest.cpp(157) : failure location
    SKIP   : RSAUnitTest::testAsymmetricEncryption() RSA not supported. skipping
    C:\Users\user\Downloads\qca-2.1.3\unittest\rsaunittest\rsaunittest.cpp(159) : failure location
    PASS   : RSAUnitTest::cleanupTestCase()
    Totals: 3 passed, 0 failed, 1 skipped, 0 blacklisted, 2ms
    ********* Finished testing of RSAUnitTest *********
    

    Does QCA run with QT>5? The readme says it's portet to Qt5.
    I'dont now if, but maybe the installation failed:
    within the CMakeLists file the install path is set to: C:\Qt\5.11.2\mingw53_32*, but the files are only located in the build folder of the project.

    Thank's for help in advance ;)

    Edit:

    at the /unittest/rsaunittest/rsaunittest.cpp is following defined:

    #if QT_VERSION >= 0x050000
    	    QSKIP("RSA not supported. skipping");
    #else
    	    QSKIP("RSA not supported. skipping",SkipAll);
    #endif
    

    So i guess it's not completely portet to Qt5?

    1 Reply Last reply
    0
    • H Offline
      H Offline
      Hoehli
      wrote on last edited by Hoehli
      #2

      ok, openSSL include path was missing, and because of that, the setup skipped compiling the "qca-ossl" plugin wich is nessesary for the RSA Encryption.

      Now i'm trying to include openssl... but i'm struggling at

      # include <openssl/opensslconf.h>
      

      the opensslconf.h is a architectur specific file and normally the file is generated while the compilation of openSSL.
      But I don't understand why it's not generated by the compiler in my case.

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi and welcome to devnet.

        Which version of OpenSSL are you using to build QCA ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • H Offline
          H Offline
          Hoehli
          wrote on last edited by
          #4

          Hi ;)

          i'v tryed multiple versions:

          • 1.1.1b
          • current master branch of the git repo
          • 1.1.0k
          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Just to be sure, I would check against the latest version of the 1.0 series.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • H Offline
              H Offline
              Hoehli
              wrote on last edited by Hoehli
              #6

              So, finally I build openSSL(1.1.1b) with minGW and got the corresponding headers.

              At the QCA CMakeList there is the macro: "OPENSSL_INCLUDE_DIR" i've set the path and it's working.
              But how can I link/set the Path to the openSSL lib?
              Somehow it's not compiling qca-ossl.cpp because of the missing lib.

              best

              1 Reply Last reply
              0
              • H Offline
                H Offline
                Hoehli
                wrote on last edited by
                #7

                ok, tried it with openSSL 1.0.2r, finally i'm getting ONLY one error while compiling qca-ossl.cpp:

                line 5810 :

                sessInfo.isCompressed = (0 != SSL_SESSION_get_compress_id(ssl->session));
                

                undefined reference to SSL_SESSION_get_compress_id

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @Hoehli said in Using QCA Encrypt Library with Qt >5:

                  SSL_SESSION_get_compress_id

                  Strange, that method is supposed to be available since 1.0.1...

                  Can you find it in the headers of your installed OpenSSL version ?

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • H Offline
                    H Offline
                    Hoehli
                    wrote on last edited by Hoehli
                    #9

                    Yes, it's defined in ssh.h which is included.

                    I also have trouble to include the 64bit build of openSSL: while compiling qca-ossl.cpp i'll get a alot of undefined reference errors.. using the same mingw64 compiler

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      Might be a silly question, but are you sure you are linking to the right version of OpenSSL ?

                      You might be hitting a cmake cache entry.

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      0
                      • H Offline
                        H Offline
                        Hoehli
                        wrote on last edited by Hoehli
                        #11

                        @SGaist said in Using QCA Encrypt Library with Qt >5:

                        Might be a silly question, but are you sure you are linking to the right version of OpenSSL ?

                        Yes, think so :D. I included C:/openSSL32 for 32-bit, and C:/openSSL64 for 64-bit, that's the path I put my compiled openSSL.

                        To compile openSSL (version 1.0.2r) I used MSYS2 and followed this discription. The minGW compiler I used was the one, shipped with QT at: c:/Qt/Tools/mingw530_32 for 32-bit and C:/Qt/Tools/mingw730_64.

                        Configured the openSSL with the perl script with this options:

                        ./Configure mingw shared no-idea no-mdc2 no-rc5 --prefix=/c/openSSL32
                        

                        and for 64-bit:

                        ./Configure mingw64 shared no-idea no-mdc2 no-rc5 --prefix=/c/openSSL64
                        

                        Between those two steps I restarted MSYS2 and reconfigured the PATH variables to the corresponding minGW compiler.

                        I also tried the mingw-w64 compiler (he didn't made it).

                        You might be hitting a cmake cache entry.

                        32-bit version: https://pastebin.com/2VYa47f0
                        64-bit version: https://pastebin.com/4x0Sn5Xm

                        If I'm comment the line 5810 (of qca-ossl.cpp - Version 2.1.3 of the QCA) out, the dll's are build and it's working (somehow but probably unstable).
                        Thanks for the support! I appreciate.

                        Edit:

                        I had a deeper look into the CMakeCache files:
                        at the 64bit-version i changed the Value for LIB_EAY from C:\Program Files (x86)\Intel\iCLS Client\libeay32.dll, to C:\Program Files\Intel\iCLS Client\ssleay32.dll.

                        This reduced the undefined reference errors, now I only get the same error as for the 32-bit version at line 5810.
                        YAY -> one step away :D

                        man, that's pain on windows... on Arch Linux QCA compiled "out of the box"...

                        Edit2:
                        tried the current master branch of openSSL (1.0.2s) still the same error.

                        1 Reply Last reply
                        0
                        • H Offline
                          H Offline
                          Hoehli
                          wrote on last edited by
                          #12

                          no more ideas?

                          1 Reply Last reply
                          0
                          • SGaistS Offline
                            SGaistS Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on last edited by SGaist
                            #13

                            Rather than replacing the library, did you try link them both ?

                            Interested in AI ? www.idiap.ch
                            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                            1 Reply Last reply
                            0

                            • Login

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • Users
                            • Groups
                            • Search
                            • Get Qt Extensions
                            • Unsolved