Results 1 to 3 of 3

Thread: QtCrypto (qca-ossl) problem loading plugins

  1. #1
    Join Date
    Dec 2011
    Posts
    36
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QtCrypto (qca-ossl) problem loading plugins

    Hi,

    I'd appreciate some help with qca-ossl plugins.

    Problem:
    QCA::ProviderList... lists: "default" as list of plugin providers (which 'could' refer to the collection of qca-ossl plugins)
    BUT when I run e.g. the ciphertest (found at http://delta.affinix.com/qca/ (in file:: qca-ossl-2.0.0-beta3.tar.bz2) or any other tests, the result is always e.g.: AES128-CBC not supported!

    Question: to me it looks like a path or linker problem. But where and what needs to be included o linked to be able to use e.g. AES128-CBC??

    Configuration:
    System: Linux Ubuntu 11.04
    Software installed: Qt3, Qt4 SDK 4.74, OpenSSL 1.0.0e 6 Sep 2011, qca-2.0.3, qca-ossl-2.0.0-beta-3.
    Patches Applied: 1 to qca-ossl.cpp (remove MD2 support to install with openSSL 1.0.0e )
    Qt Creator Project file: (test.pro) contains includepath to libs, libs -L<path> -lqca and config += crypto
    Qt Creator main.cpp: all necessary includes e.g. <QtCrypto> work

    qcatool2 plugins --debug reports:
    Qt Code:
    1. Qt Library Paths:
    2. /usr/lib/qt4/plugins
    3. /usr/local/bin
    4. plugin: Checking Qt static plugins:
    5. plugin: (none)
    6. plugin: Checking Qt Library Path: /usr/lib/qt4/plugins
    7. plugin: libqca-ossl.so: (class: opensslPlugin) loaded as qca-ossl
    8. plugin: libqca-ossl.so.debug: not a library, skipping
    9. plugin: Checking Qt Library Path: /usr/local/bin
    10. plugin: (No 'crypto' subdirectory)
    11. Available Providers:
    12. qca-ossl
    13. This product includes cryptographic software written by Eric Young
    14. (eay@cryptsoft.com)
    15. *sha1
    16. *sha0
    17. *ripemd160
    18. *md4
    19. *md5
    20. *sha224
    21. *sha256
    22. *sha384
    23. *sha512
    24. *hmac(md5)
    25. *hmac(sha1)
    26. *hmac(sha224)
    27. *hmac(sha256)
    28. *hmac(sha384)
    29. *hmac(sha512)
    30. *hmac(ripemd160)
    31. *aes128-ecb
    32. *aes128-cfb
    33. *aes128-cbc
    34. *aes128-cbc-pkcs7
    35. *aes128-ofb
    36. *aes192-ecb
    37. *aes192-cfb
    38. *aes192-cbc
    39. *aes192-cbc-pkcs7
    40. *aes192-ofb
    41. *aes256-ecb
    42. *aes256-cbc
    43. *aes256-cbc-pkcs7
    44. *aes256-cfb
    45. *aes256-ofb
    46. *blowfish-ecb
    47. *blowfish-cbc-pkcs7
    48. *blowfish-cbc
    49. *blowfish-cfb
    50. *blowfish-ofb
    51. *tripledes-ecb
    52. *tripledes-cbc
    53. *des-ecb
    54. *des-ecb-pkcs7
    55. *des-cbc
    56. *des-cbc-pkcs7
    57. *des-cfb
    58. *des-ofb
    59. *cast5-ecb
    60. *cast5-cbc
    61. *cast5-cbc-pkcs7
    62. *cast5-cfb
    63. *cast5-ofb
    64. *pbkdf1(sha1)
    65. *pbkdf2(sha1)
    66. *pkey
    67. *dlgroup
    68. *rsa
    69. *dsa
    70. *dh
    71. *cert
    72. *csr
    73. *crl
    74. *certcollection
    75. *pkcs12
    76. *tls
    77. *cms
    78. *ca
    79. plugin: Unloaded: qca-ossl
    To copy to clipboard, switch view to plain text mode 

    main.cpp example:
    Qt Code:
    1. #include <QtCrypto>
    2. #include <QDebug>
    3. #include <cstdio>
    4.  
    5. int main(int argc, char **argv)
    6. {
    7. QCA::Initializer init;
    8. QCA::SecureArray arg = (argc >= 2) ? argv[1] : "hello";
    9. if(!QCA::isSupported("aes128-cbc-pkcs7"))
    10. printf("AES128-CBC not supported!\n");
    11. else {
    12. QCA::SymmetricKey key(16);
    13. QCA::InitializationVector iv(16);
    14. QCA::Cipher cipher(QString("aes128"),QCA::Cipher::CBC, QCA::Cipher::DefaultPadding,QCA::Encode,key,iv);
    15. QCA::SecureArray u = cipher.update(arg);
    16. if (!cipher.ok())
    17. {
    18. printf("Update failed\n");
    19. }
    20. printf("AES128 encryption of %s is [%s]\n",arg.data(),qPrintable(QCA::arrayToHex(u.toByteArray())) );
    21. QCA::SecureArray f = cipher.final();
    22. if (!cipher.ok())
    23. {
    24. printf("Final failed\n");
    25. }
    26. printf("Final block for AES128 encryption is [0x%s]\n", qPrintable(QCA::arrayToHex(f.toByteArray())) );
    27. cipher.setup( QCA::Decode, key, iv );
    28. QCA::SecureArray cipherText = u.append(f);
    29. QCA::SecureArray plainText = cipher.update(cipherText);
    30. if (!cipher.ok())
    31. {
    32. printf("Update failed\n");
    33. }
    34. printf("Decryption using AES128 of [0x%s] is %s\n",qPrintable(QCA::arrayToHex(cipherText.toByteArray())), plainText.data());
    35. plainText = cipher.final();
    36. if (!cipher.ok())
    37. {
    38. printf("Final failed\n");
    39. }
    40. printf("Final decryption block using AES128 is %s\n", plainText.data());
    41. printf("One step decryption using AES128: %s\n",QCA::SecureArray(cipher.process(cipherText)).data() );
    42. }
    43. return 0;
    44. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Feb 2008
    Posts
    491
    Thanks
    12
    Thanked 142 Times in 135 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: QtCrypto (qca-ossl) problem loading plugins

    Just FYI, your app runs fine on my Debian Sid box:
    Qt Code:
    1. AES128 encryption of hello is []
    2. Final block for AES128 encryption is [0x6941a6aebe7f0ff0a1559f65c9a1ce81]
    3. Decryption using AES128 of [0x6941a6aebe7f0ff0a1559f65c9a1ce81] is (null)
    4. Final decryption block using AES128 is hello
    5. One step decryption using AES128: hello
    To copy to clipboard, switch view to plain text mode 
    The only difference that I see in our setups is that I have qca-ossl-2.0.0-beta-3-1 from the Debian repositories installed. The Debian package is in the Ubuntu repositories also: link


    In addition to the patch that you applied (detect_md2_available.diff) the beta-3-1 package contains two others:
    1. detect_ssl2_available.diff
    2. remove_whirlpool_algo.diff

    If you can't install the Ubuntu package, try applying the above patches and recompiling.

  3. #3
    Join Date
    Dec 2011
    Posts
    36
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QtCrypto (qca-ossl) problem loading plugins

    Thx NoRoBro for you quick reply.
    The additional patching didn't solve the problem reinstalling did.
    Here is what I did on Natty's version of Ubuntu to make it work:
    1. Uninstall:
      I uninstalled all the aforementioned programs (Qt3, Qt4 SDK 4.74, OpenSSL 1.0.0e 6 Sep 2011, qca-2.0.3, qca-ossl-2.0.0-beta-3), then I made sure to clean all my directories (/usr/local and such).
    2. Reinstall:
      First openssl, then QT Creator from Ubuntu's software repositories.
      Note that I deliberately removed my path to <QTDIR> from bashrc, and I deliberately left out QT3, to make sure that both QCA's will find qmake-qt4 in the /usr/bin and not qmake-qt3.
      I installed qca-2.0.3 without any problems.
      After the installation of QCA-2.0.3, I patched CMakelist and qca-ossl.cpp. I encountered 1 setback with the .configure from qca-ossl, it would'nt recognize the qca-2.0.3 install. Even after feeding argument --with-qca=/usr/local/qca-2.0.3 directory to the qca-ossl configure file, it would not recognize the installation. I needed to run sudo /sbin/ldconfig before the qca-ossl installation.
      After installation I ran qcatool2 plugin --debug. It provide the same results as my first post.
      I altered the .pro file to find the newly installed libraries (INCLUDEPATH =/usr/local/qca-2.0.3/) and (LIBS += -L/usr/local/lib -lqca) and CONFIG += crypto
      Then somehow my code (main.cpp) started working.
    3. Conclusion:
      It must have been a linker problem, maybe even a permission problem on a library or a missing library (I have small kids playing on my computer).

Similar Threads

  1. Replies: 1
    Last Post: 9th March 2011, 23:24
  2. QtCrypto problem
    By pucara_faa in forum Newbie
    Replies: 2
    Last Post: 1st June 2010, 13:17
  3. Problem loading plugins throught generated bundle
    By mourad in forum Installation and Deployment
    Replies: 0
    Last Post: 25th March 2008, 11:23
  4. Problems loading static plugins
    By Rodrigo in forum Qt Programming
    Replies: 2
    Last Post: 11th July 2007, 12:42
  5. Designer log messages while loading plugins
    By cocheci in forum Qt Tools
    Replies: 3
    Last Post: 18th May 2006, 14:50

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.