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